Teacher Guide: Boolean Expressions
Learn to write and evaluate Boolean expressions with 1 and 0, use the order of operations NOT, AND, OR, and build their full truth tables.
Use this lesson with your class
Free, no student accounts needed.
Share with students
Students open the lesson and practise with instant feedback.
Class quiz
10 questions on Boolean Logic. Students join with a name, you see everyone's score.
For Teachers
- Write Boolean expressions with variables, the values 1 and 0 and the symbols , ,
- Apply the order of operations (parentheses, NOT, AND, OR) to evaluate an expression for given inputs
- Explain how parentheses change the value of a Boolean expression
- Build the full truth table of an expression with 2 or 3 variables using rows
- Decide whether two expressions are equivalent by comparing their truth tables
- • The AND, OR and NOT operations and compound statements (The AND Operation, The OR Operation, The NOT Operation, Compound Boolean Statements)
- • Building truth tables with helper columns (Truth Tables)
- • Order of operations in arithmetic and powers of 2, such as
- 1. Why do you think mathematicians agreed on an order of operations instead of always working left to right?
- 2. Write a rule for your school, such as who may use the library, as a Boolean expression. Where do you need parentheses?
- 3. If two expressions agree for 7 of 8 inputs, are they equivalent? Why or why not?
- 4. AND works like multiplication with 0 and 1. Why does OR not work exactly like addition?
Boolean expressions are evaluated from left to right
Remediation: Compare with in arithmetic, then evaluate both ways. Only the order NOT, AND, OR gives the agreed result, and different orders give different answers.
NOT in front of a variable negates the whole rest of the expression
Remediation: Evaluate and for side by side. The results 0 and 1 show that NOT only touches the next variable unless there are parentheses.
Values can grow beyond 1, as in
Remediation: Remind students that 1 and 0 are labels for true and false, not amounts. Ask: is 'true OR true' more true? The answer stays 1.
For Struggling Students:
- • Start with expressions with only one operator and one NOT, using 2 variables
- • Have students rewrite every expression with full parentheses before evaluating it
- • Use color: circle the NOT parts in one color, the AND parts in another, and evaluate the colors in order
For On-Level Students:
- • Evaluate expressions with 3 variables and mixed operators for given inputs
- • Build complete truth tables with helper columns for 2 and 3 variables
- • Decide whether pairs of expressions are equivalent from their truth tables
For Advanced Students:
- • Find an expression whose truth table matches a given final column
- • Translate rules from a program or spreadsheet into Boolean expressions and test them
- • Look for a shorter expression with the same truth table and check it row by row
- HSA.SSE.A.1 (CCSS.MATH.CONTENT.HSA.SSE.A.1)
Interpret expressions that represent a quantity in terms of its context
- CCSS.MATH.PRACTICE.MP6 (MP6)
Attend to precision
- CCSS.MATH.PRACTICE.MP7 (MP7)
Look for and make use of structure
- visualInteractive Truth Table
Students fill in the result column for AND, OR and NOT with 2 variables and check their answers
- activityParentheses Race
Teams get the same inputs and an expression without parentheses, then add parentheses to change the result and explain why
- worksheetEvaluate and Compare
Expressions to evaluate for given inputs, plus pairs of expressions to compare with full truth tables
Lesson Content
Everything students see: definition, examples, common mistakes, applications. Tap to open.
Lesson Content
Everything students see: definition, examples, common mistakes, applications. Tap to open.
Definition
- flips the value: and
- is only when both and are
- is when at least one of them is
Worked Examples
Evaluate for and .
Substitute the values
Replace with and with →
Do NOT first
→
Do AND
Both values are , so AND gives
Answer: (true) for , .
Common Mistakes
Working left to right:
Why it's wrong: AND comes before OR, just as multiplication comes before addition. Without parentheses, the AND part is done first.
Correct:
Applying NOT to everything after it: reading as
Why it's wrong: Without parentheses, NOT applies only to the variable directly after it.
Correct: . To negate the whole AND, write .
Adding like numbers:
Why it's wrong: A Boolean expression can only be or . OR asks whether at least one value is , it does not count them.
Correct: , and . The answer is always or .
Calling two expressions equivalent after testing only one or two inputs
Why it's wrong: and give the same value in 6 of the 8 rows, yet they are different.
Correct: Build the full table with rows and compare every row. One row that differs means not equivalent.
Why It Matters
- Programming: every if-condition is a Boolean expression, such as (age at least 12 AND NOT banned) OR has a parent. Forget the parentheses and the program lets in the wrong people
- Search and filters: online shops and libraries combine filters like in stock AND (red OR blue)
- Spreadsheets: functions such as AND(), OR() and NOT() decide which rows are highlighted
- Electronics: every chip turns Boolean expressions into circuits of logic gates, as you will see in the Logic Gates lesson
- Games and smart homes: a door opens or a light switches on when an expression of several sensors equals 1
Real World Applications
Rules in a Program
Programmers write rules as Boolean expressions and test every combination of inputs before the program goes live.
Example:
A theme park ride lets you in if : = you have a ticket, = you are tall enough, = a parent rides with you.
The ride rule is . A child has a ticket (), is not tall enough () and rides with a parent ().
How many test cases does the rule have, and may the child ride?
Step 1: Write the mathematical expression
Write the number of test cases as a power of 2:
Spam Filters
An email program decides with a Boolean expression whether a message goes to the spam folder.
Example:
A filter marks an email as spam if : = sender is on a block list, = suspicious words, = sender is in your contacts.
The rule is . An email from a friend in your contacts () contains a suspicious word (), and the sender is not on the block list (). With 0 and 1, AND works like multiplication and NOT like .
Does the email go to spam?
Step 1: Write the mathematical expression
Write as a calculation:
Smart Home Rules
Two different expressions can control a device in exactly the same way. A truth table shows when a long rule can be replaced by a short one.
Example:
A garden light uses the rule : = motion detected, = it is night.
An engineer wants to replace the rule with the shorter rule .
Do the two rules always switch the light the same way?
Step 1: Write the mathematical expression
Write the number of rows as a power of 2:
Key Takeaways
- 1A Boolean expression combines variables, the values 1 (true) and 0 (false) and the operators , ,
- 2The value of a Boolean expression is always 1 or 0, never 2 or more
- 3Order of operations: parentheses first, then NOT, then AND, then OR
- 4NOT applies only to what comes directly after it: is not
- 5An expression with variables has a truth table with rows, starting with the row where all variables are 0
- 6Two expressions are equivalent when their final columns are the same in every row
Frequently Asked Questions
Why does AND come before OR?
Can I just use parentheses everywhere?
Are 1 and 0 the same as true and false?
Is there a faster way than a truth table to show that two expressions are equivalent?
Glossary
- Boolean variable
- A letter such as , or that can only take the values 1 (true) or 0 (false)
- Boolean expression
- A formula made of Boolean variables, the values 1 and 0 and the operators , ,
- Order of operations
- The rule for which operator is done first: parentheses, then NOT, then AND, then OR
- Truth table
- A table that lists the value of an expression for all combinations of its variables
- Equivalent
- Two expressions are equivalent when they have the same value in every row of the truth table
Formula Card
Order of operations
Parentheses first, then NOT, then AND, then OR
NOT
Flips the value of what comes directly after it
AND and OR
AND is 1 only if both are 1; OR is 0 only if both are 0
Number of rows
$n$ is the number of variables: $2^2 = 4$, $2^3 = 8$