Boolean variables and operations (AND, OR, NOT)
What is a Boolean variable?
WHAT we are studying: three fundamental operations —
- NOT (¬, overbar,
!) — takes 1 input. - AND (∧, ·,
&) — takes 2+ inputs. - OR (∨, +,
|) — takes 2+ inputs.
WHY only three? Because these three are functionally complete: any logic function whatsoever can be written using only NOT, AND, OR. Everything else (NAND, XOR…) is just shorthand built from these.
Deriving each operation from meaning (not memorising)
NOT — "the opposite"
HOW we build its truth table — a Boolean variable has only 2 values, so we only need 2 rows:
| 0 | 1 |
| 1 | 0 |
AND — "all must be true"
HOW we build the table — 2 inputs ⇒ rows:
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR — "at least one is true"
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |

Order of operations (precedence)
So means .
Worked Examples
Common Mistakes (Steel-manned)
Active Recall
Recall Quiz yourself (click to reveal)
- How many values can a Boolean variable take? → Two: 0 and 1
- AND of and ? → 0
- OR of and ? → 1
- ? → 1
- Precedence order? → NOT, then AND, then OR
- Why is OR not plain addition? → ==because must stay , it saturates==
Recall Feynman: explain to a 12-year-old
Imagine light switches. NOT is a naughty switch that always does the opposite of what you press. AND is a strict teacher: you get a sticker only if you did homework AND cleaned your room — miss one, no sticker. OR is a kind grandma: she gives you ice cream if it's hot OR if you're happy — either reason works. That's all a computer really does, millions of times a second, super fast.
Flashcards
How many values can a Boolean variable hold?
What are the three fundamental Boolean operations?
Truth-table result of AND when inputs are 1 and 0?
Truth-table result of OR when inputs are 1 and 0?
What is when ?
Why is Boolean OR written with + but not ordinary addition?
Formula for AND using arithmetic on 0/1 values?
Formula for OR that keeps output in {0,1}?
Precedence order of Boolean operators?
How many rows in a truth table with n Boolean inputs?
Why are AND, OR, NOT special together?
Correct simplification of ?
Connections
- Truth Tables — how we tabulate every input combination ( rows).
- Logic Gates — the physical circuit symbols for AND, OR, NOT.
- De Morgan's Laws — how NOT interacts with AND/OR.
- NAND and NOR gates — universal gates built from these basics.
- Boolean Algebra Laws — identity, null, idempotent, distributive rules.
- Binary Number System — where the 0/1 values physically come from.
Concept Map
Hinglish (regional understanding)
Intuition Hinglish mein samjho
Boolean algebra ka core idea simple hai: yahan har variable sirf do value le sakta hai — 0 ya 1, matlab OFF ya ON. Computer ke andar ek wire par ya to voltage hai ya nahi, beech ka kuch nahi hota. Isliye humein aisa maths chahiye jo sirf "haan/na" samjhe, aur wahi Boolean algebra hai.
Teen basic operations yaad rakho. NOT matlab ulta kar do — 1 ko 0, 0 ko 1. AND bahut strict hai: output tabhi 1 milega jab saare inputs 1 hon (jaise ATM: card bhi ho AND PIN bhi sahi ho). OR thoda generous hai: koi ek bhi input 1 ho to output 1 (jaise chhata chahiye agar baarish OR barf ho). AND ko multiply (.) aur OR ko plus (+) se likhte hain, par dhyaan rakho — OR mein 1+1 = 1 hota hai, 2 nahi, kyunki value {0,1} ke bahar nahi ja sakti.
Precedence bhi normal maths jaisa hi hai: pehle NOT, phir AND, phir OR. Confusion ho to brackets laga do. Sabse common galti yehi hoti hai ki log 1+1=2 likh dete hain ya NOT(A+B) ko galat todte hain — asli rule De Morgan hai: .
Yeh chhoti si cheez matter kyun karti hai? Kyunki inhi teen operations se hi processor, memory, calculator, sab kuch banta hai. Jab tumhe ye teen truth tables mooh-zabani yaad ho jaayen, to aage ke logic gates, circuits, sab aasan lagenge. 80/20 rule: bas teen tables + precedence + De Morgan pakad lo, aadha chapter clear.