By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
"If your phone’s alarm only goes off when it’s both a school day AND after 6:30 AM, how does the phone ‘decide’ to wake you up? And why can’t it just use regular words like ‘maybe’ or ‘sometimes’—why does it need these weird AND/OR/NOT rules?"
Imagine you’re at a school carnival, and the ring-toss game has these rules: - You win a small prize if you land a ring on EITHER the red bottle OR the blue bottle.- You win a big prize if you land a ring on BOTH the red bottle AND the blue bottle.- But if you land a ring on the green bottle, you get NOTHING—no matter what else happens.
Your phone, a video game, or even a vending machine uses the same kind of "yes/no" rules to make decisions. Instead of bottles, they check things like: - "Is it a school day?" (yes/no) - "Is it after 6:30 AM?" (yes/no) - "Is the battery above 20%?" (yes/no)
Boolean logic is the set of rules that combines these yes/no questions to make a final decision. It’s like a digital referee that only understands "true" (yes) and "false" (no).
Note: In programming, Booleans are used in if-statements to control what code runs next.
AND (&&)
Note: In math, this is like the intersection of two sets (what they share).
OR (||)
Note: In logic, this is called "inclusive OR"—it includes the case where both are true (unlike "either/or" in everyday speech).
NOT (!)
!
!isRaining
height > 5ft AND hasParent
height > 5ft OR hasParent
isLate AND NOT isFriday
isLate OR isFriday
isLate AND isFriday
Prompt: "A video game character can jump if they are on the ground AND NOT carrying a heavy object. Write the Boolean expression for this rule."
Proficient Answer:canJump = isOnGround AND NOT isCarryingHeavy
canJump = isOnGround AND NOT isCarryingHeavy
Why It Works:- Uses AND correctly (both conditions must be true).- Includes NOT to flip the "heavy object" condition.- Matches the logic of the scenario (not just memorized syntax).
Question: "A robot can open a door if it has a key OR the door is unlocked. Which expression is correct?" - A) hasKey AND isUnlocked - B) hasKey OR isUnlocked - C) NOT hasKey OR isUnlocked
hasKey AND isUnlocked
hasKey OR isUnlocked
NOT hasKey OR isUnlocked
Common Wrong Answer: A) hasKey AND isUnlocked Why It Loses Credit:- The question says "OR", but the student used AND, which would mean the robot needs both a key and an unlocked door (impossible!).- Correct Approach: The robot only needs one condition to be true, so OR is correct.
Question: "A phone’s alarm rings if it’s a weekday AND NOT a holiday. Write the Boolean expression." Common Wrong Answer: isWeekday AND isHoliday Why It Loses Credit:- The student ignored the NOT, so the alarm would ring only on holidays (the opposite of what’s needed).- Correct Approach: isWeekday AND NOT isHoliday (the alarm rings on weekdays unless it’s a holiday).
isWeekday AND isHoliday
isWeekday AND NOT isHoliday
Question: "A vending machine gives a discount if you’re a student OR a senior citizen. Write the Boolean expression." Common Wrong Answer: isStudent AND isSenior OR hasCoupon Why It Loses Credit:- The student added an unnecessary condition (hasCoupon) that wasn’t in the prompt.- Correct Approach: isStudent OR isSenior (only the two given conditions matter).
isStudent AND isSenior OR hasCoupon
hasCoupon
isStudent OR isSenior
Within Computer Science: Boolean logic → Search engines — When you type "cats AND dogs", Google uses AND to show pages with both words, not just one.
"cats AND dogs"
Across Subjects: Boolean logic → Biology (genetics) — A child inherits traits like "brown eyes AND curly hair" (both must be present in the genes).
"brown eyes AND curly hair"
Outside School: Boolean logic → Smart home devices — Your thermostat might turn on the AC if "temperature > 75°F AND NOT windowOpen" (so it doesn’t waste energy).
"temperature > 75°F AND NOT windowOpen"
"If you combine AND, OR, and NOT in one expression—like (A AND B) OR NOT C—how many possible true/false combinations can there be? And why does this matter for things like password security?"
(A AND B) OR NOT C
Pointer Toward the Answer:- Each variable (A, B, C) has 2 possibilities (true/false), so for 3 variables, there are 2³ = 8 combinations.- In security, hackers try all combinations to guess passwords—so longer expressions (more variables) make it harder to crack! - Try drawing a truth table for (A AND B) OR NOT C to see all 8 cases.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.