Introduction to Boolean Logic
Understanding AND
You need both a ticket AND a valid ID to enter. If you have a ticket (TRUE) but no ID (FALSE), can you enter?
Identify the values: Ticket = TRUE (1), ID = FALSE (0) = Two Boolean values
Apply AND rule: AND requires BOTH to be TRUE = TRUE AND FALSE
Evaluate: Since one value is FALSE, the result is FALSE = $1 \land 0 = 0$
Answer: No, you cannot enter. TRUE AND FALSE = FALSE
Understanding OR
You can pay with cash OR card. If you have no cash (FALSE) but have a card (TRUE), can you pay?
Identify the values: Cash = FALSE (0), Card = TRUE (1) = Two Boolean values
Apply OR rule: OR requires AT LEAST ONE to be TRUE = FALSE OR TRUE
Evaluate: Since one value is TRUE, the result is TRUE = $0 \lor 1 = 1$
Answer: Yes, you can pay. FALSE OR TRUE = TRUE
Understanding NOT
The door is locked (TRUE). What is NOT locked?
Identify the value: Locked = TRUE (1) = One Boolean value
Apply NOT rule: NOT reverses the value = NOT TRUE
Evaluate: The opposite of TRUE is FALSE = $\neg 1 = 0$
Answer: NOT TRUE = FALSE. The door is not locked (unlocked)
Combining Operators
Evaluate: (TRUE AND FALSE) OR TRUE
Solve inside parentheses first: TRUE AND FALSE = FALSE = Parentheses: FALSE
Replace and continue: FALSE OR TRUE = Simplified expression
Apply OR: At least one is TRUE = $0 \lor 1 = 1$
Final answer: (TRUE AND FALSE) OR TRUE = TRUE = TRUE
Answer: TRUE (or 1)
Real-World Application
A phone unlocks IF (correct_passcode OR face_recognized) AND NOT (phone_stolen). Passcode is wrong (FALSE), face is recognized (TRUE), and phone is not stolen (FALSE). Will it unlock?
Identify all values: Passcode = FALSE, Face = TRUE, Stolen = FALSE = Three values
Solve first parentheses: FALSE OR TRUE = TRUE = Access check: TRUE
Apply NOT: NOT FALSE = TRUE = Security check: TRUE
Final AND: TRUE AND TRUE = TRUE = $1 \land 1 = 1$
Answer: Yes, the phone unlocks! (TRUE AND TRUE = TRUE)
Mistake: Thinking OR means 'one or the other, but not both'
Why: In everyday language, 'or' often implies exclusivity. In Boolean logic, OR includes the case where both are true.
Correct: In Boolean logic: TRUE OR TRUE = TRUE. OR means 'at least one is true'.
Mistake: Confusing AND with OR
Why: Both combine two values, so it's easy to mix them up.
Correct: AND is stricter (needs BOTH true). OR is more lenient (needs just ONE true).
Mistake: Forgetting that NOT flips the value completely
Why: Students sometimes think NOT makes something 'less true' rather than the opposite.
Correct: NOT is absolute: NOT TRUE = FALSE, NOT FALSE = TRUE. No middle ground.
Search Engines
Search engines use Boolean logic to filter results based on your query.
Searching 'pizza AND delivery AND NOT expensive' finds pizza places that deliver but aren't pricey.
Video Game Logic
Games use Boolean logic constantly to make decisions about gameplay.
In a racing game: boost_available = (fuel > 50) AND (NOT already_boosting) AND (speed < max_speed)
Security Systems
Security and access control systems rely heavily on Boolean logic.
Access granted IF (valid_badge AND correct_PIN) OR (is_admin AND emergency_override)
Boolean logic uses only two values: TRUE (1) and FALSE (0)
AND ($\land$) returns TRUE only when BOTH inputs are TRUE
OR ($\lor$) returns TRUE when AT LEAST ONE input is TRUE
NOT ($\neg$) reverses the value: TRUE becomes FALSE, FALSE becomes TRUE
Boolean logic is the foundation of all computing and digital technology
Q: Why is it called Boolean?
A: It's named after George Boole, an English mathematician who developed this system of logic in the 1840s. His work laid the foundation for digital computing.
Q: Why do computers use 1 and 0?
A: Computer circuits can easily distinguish between two states: electricity flowing (1/TRUE) or not flowing (0/FALSE). This binary system is efficient and reliable.
Q: Is Boolean OR the same as everyday 'or'?
A: Not quite! In everyday speech, 'Would you like coffee or tea?' usually means one or the other. In Boolean logic, OR includes both - if both are TRUE, the result is still TRUE (called 'inclusive or').
Introduction to Boolean Logic
1 / 14
Introduction to Boolean Logic
Learn the fundamentals of Boolean logic and how TRUE/FALSE values work in mathematics and computing.