Back to Lesson

Teacher Guide: Truth Tables

Learn to build a truth table for any compound expression step by step and use it to find tautologies, contradictions and equivalent expressions.

Use this lesson with your class

Free, no student accounts needed.

Share with students

Students open the lesson and practise with instant feedback.

Printable worksheet

All practice problems on paper, with a separate answer key.

Class quiz

10 questions on Boolean Logic. Students join with a name, you see everyone's score.

For Teachers

Learning Objectives
  • Determine the number of rows of a truth table using 2n2^n
  • Fill the variable columns of a truth table in a systematic order for 2 and 3 variables
  • Build the final column of a compound expression using helper columns
  • Identify tautologies, contradictions and contingencies from the final column
  • Use truth tables to decide whether two expressions are logically equivalent
Prerequisites
  • • Understanding of true and false statements (Introduction to Boolean Logic, True and False Statements)
  • • The AND, OR and NOT operations and their basic truth tables
  • • Powers of 2, such as 23=82^3 = 8
Discussion Starters
  • 1. Why do you think a table with 10 variables would be impractical to write by hand? How many rows would it have?
  • 2. Two friends say the same rule in different words. How could a truth table settle who is right?
  • 3. Can you think of a sentence that is always true no matter what? Why is it a tautology?
  • 4. Why is one row that differs enough to show that two expressions are not equivalent?
Common Misconceptions

The number of rows is 2×n2 \times n instead of 2n2^n

Remediation: Build the tables for 1, 2 and 3 variables together and count: 2, 4, 8. Ask students to predict 4 variables and check with a tree diagram that branches into T and F at every level.

NOT in front of a variable negates the whole expression

Remediation: Put ¬P∧Q\neg P \land Q and ¬(P∧Q)\neg(P \land Q) side by side and build both tables. The different final columns show that brackets change the meaning.

If two expressions agree in most rows, they are equivalent

Remediation: Compare ¬(P∧Q)\neg(P \land Q) with ¬P∧¬Q\neg P \land \neg Q: they match in two rows and differ in two. Stress that equivalence is an all-rows check, like two answer keys that must match on every question.

Differentiation Ideas

For Struggling Students:

  • • Start with one NOT and one AND or OR, using only 2 variables and 4 rows
  • • Give pre-printed tables with the variable columns already filled in
  • • Use colored highlighters: green for T, red for F, to make patterns visible

For On-Level Students:

  • • Build complete 3-variable tables with two helper columns
  • • Classify a list of expressions as tautology, contradiction or contingency
  • • Prove both De Morgan's laws with truth tables

For Advanced Students:

  • • Find an expression that matches a given final column (reverse truth table)
  • • Investigate why a table with 10 variables has 210=10242^{10} = 1024 rows and discuss why computers are used
  • • Prove the distributive law P∧(Q∨R)≡(P∧Q)∨(P∧R)P \land (Q \lor R) \equiv (P \land Q) \lor (P \land R)
Standards Alignment
  • CCSS.MATH.PRACTICE.MP6 (MP6)

    Attend to precision

  • CCSS.MATH.PRACTICE.MP7 (MP7)

    Look for and make use of structure

  • CCSS.MATH.PRACTICE.MP3 (MP3)

    Construct viable arguments and critique the reasoning of others

Lesson Resources
  • visualInteractive Truth Table

    Students fill in the result column for AND and OR and check their answers

  • activityRow Detectives

    Pairs receive a table with a missing and a repeated row and must find and fix them

  • worksheetEquivalent or Not?

    Pairs of expressions to compare with full truth tables, including both De Morgan's laws

Lesson Content

Everything students see: definition, examples, common mistakes, applications. Tap to open.

Definition

A truth table lists every possible combination of truth values of the variables in an expression and shows the value of the whole expression in each row.
How many rows? Each variable can be T or F, so every new variable doubles the number of rows:
rows=2n(n=number of variables)\text{rows} = 2^n \quad (n = \text{number of variables})
So 2 variables need 22=42^2 = 4 rows and 3 variables need 23=82^3 = 8 rows.
Building a table in 4 steps:
  1. 1.Count the variables and write 2n2^n empty rows.
  2. 2.Fill the variable columns in a fixed order: the first column is half T, then half F; each next column switches twice as often; the last column alternates T, F, T, F.
  3. 3.Add a helper column for every part of the expression, innermost part first (a NOT on a single variable, then the brackets).
  4. 4.Combine the helper columns into the final column.
Example: P∧¬QP \land \neg Q
PPQQ¬Q\neg QP∧¬QP \land \neg Q
TTFF
TFTT
FTFF
FFTF
The final column tells you everything: this expression is true in exactly one row, when PP is true and QQ is false.
Reading the final column:
  • All T: the expression is a tautology (always true).
  • All F: it is a contradiction (always false).
  • Two expressions with the same final column in every row are logically equivalent.

Worked Examples

Build the truth table for P∨¬QP \lor \neg Q.

1

Count the rows

There are 2 variables, PP and QQ, so we need 22=42^2 = 4 rows

2

Fill the variable columns

PP: T, T, F, F (half T, half F). QQ: T, F, T, F (alternating) → All 4 combinations appear once

3

Add the helper column ¬Q\neg Q

Flip every value of QQ: T, F, T, F becomes F, T, F, T → ¬Q\neg Q: F, T, F, T

4

Combine with OR

Row by row: T OR F = T, T OR T = T, F OR F = F, F OR T = T → P∨¬QP \lor \neg Q: T, T, F, T

Common Mistakes

Writing too few rows, for example 6 rows for 3 variables

Why it's wrong: The number of rows is not 2×n2 \times n. Each variable doubles the number of combinations, so 3 variables give 2×2×2=82 \times 2 \times 2 = 8 rows.

Correct: Always use 2n2^n rows: 4 for 2 variables, 8 for 3 variables, 16 for 4 variables.

Filling the variable columns in a random order

Why it's wrong: Without a system it is easy to write the same combination twice and miss another one. The table then gives a wrong verdict.

Correct: Use the fixed pattern: first column in blocks of half the rows, each next column in blocks half as long, last column alternating T, F.

Treating ¬P∧Q\neg P \land Q as if it were ¬(P∧Q)\neg(P \land Q)

Why it's wrong: Without brackets, NOT applies only to the variable right after it. The bracketed version flips the result of the whole AND.

Correct: Make a helper column for exactly what NOT touches: ¬P\neg P alone, or P∧QP \land Q first and then its negation.

Calling two expressions equivalent after checking only a few rows

Why it's wrong: Two expressions can agree on several rows and still differ in one. ¬(P∧Q)\neg(P \land Q) and ¬P∧¬Q\neg P \land \neg Q agree in rows 1 and 4 but not in rows 2 and 3.

Correct: Compare the final columns in every single row. Equivalent means identical in all 2n2^n rows.

Why It Matters

A truth table is the most reliable way to check a logical statement, because it leaves no case out:
  • Programming: before shipping a condition like (member OR coupon) AND NOT blocked, testers check every combination of inputs
  • Electronics: engineers use truth tables to design circuits and to replace a complicated circuit with a simpler, cheaper one that does the same job
  • Security and alarms: an alarm with 4 sensors has 24=162^4 = 16 possible states, and every one of them must behave correctly
  • Arguments and debates: a truth table shows whether two sentences really say the same thing or only sound alike
  • Puzzles and games: logic puzzles are solved by ruling out rows that cannot be true
You already know how AND, OR and NOT work on their own. Truth tables let you combine them into any expression and still be sure of the answer.

Real World Applications

Alarm Systems

Security engineers list every state of the sensors to make sure the alarm reacts correctly in each one.

Example:

An alarm with 3 door sensors has 23=82^3 = 8 states, from all doors closed to all doors open.

1Try It Yourself

A house alarm has 4 sensors, and each one is either on (T) or off (F). The alarm rings if at least one sensor is on (OR).

How many rows does the truth table have, and in how many of them does the alarm ring?

Step 1: Write the mathematical expression

Write the number of rows as a power of 2:

Testing Software

Programmers test a condition with every combination of inputs, which is exactly a truth table.

Example:

A login rule (correct password AND NOT locked) needs 22=42^2 = 4 test cases to be fully checked.

2Try It Yourself

An online shop gives a discount if (M∨C)∧¬B(M \lor C) \land \neg B, where MM = is a member, CC = has a coupon, BB = account is blocked.

In how many of the input combinations does the customer get the discount?

Step 1: Write the mathematical expression

Write the number of test cases as a power of 2:

Simplifying Circuits

If two circuits have the same truth table, engineers can use the one with fewer or cheaper parts.

Example:

De Morgan's laws let a designer swap a NOT-AND for an OR of two NOTs without changing what the circuit does.

3Try It Yourself

Circuit A computes ¬(P∨Q)\neg(P \lor Q). Circuit B computes ¬P∧¬Q\neg P \land \neg Q.

Do the two circuits always give the same output?

Step 1: Write the mathematical expression

Write the number of rows as a power of 2:

Key Takeaways

  • 1A truth table lists every combination of truth values and the value of the expression in each row
  • 2With nn variables the table has 2n2^n rows: 4 for 2 variables, 8 for 3 variables
  • 3Fill the variable columns in a fixed order: blocks of half the rows first, last column alternating T, F
  • 4Use helper columns for each part of the expression, innermost part first
  • 5All T in the final column means a tautology, all F means a contradiction
  • 6Two expressions are equivalent when their final columns match in every row

Frequently Asked Questions

Why does every new variable double the rows?

Each existing row can be continued with the new variable being T or being F. So every row splits into two: 2 rows become 4, 4 become 8, and so on, which gives 2n2^n.

Does the order of the rows matter?

Any order is correct as long as every combination appears exactly once. The standard order (starting with all T) makes it easy to check and to compare tables. Some books start with F instead; the rows are the same, only listed the other way round. The interactive tables in this lesson use the standard order.

What is an expression called if it is neither a tautology nor a contradiction?

It is called a contingency: its value depends on the inputs. Most everyday expressions, like P∧QP \land Q, are contingencies.

Do I always need helper columns?

They are not required, but they prevent most mistakes. With practice you can combine small steps in your head, but for 3 variables or brackets inside brackets, helper columns are the safest way.

Glossary

Truth table
A table that shows the value of an expression for every combination of its variables
Compound expression
An expression built from variables and operators, such as (P∧Q)∨¬R(P \land Q) \lor \neg R
Helper column
An extra column for one part of an expression, used to build the final column step by step
Tautology
An expression that is true in every row, such as P∨¬PP \lor \neg P
Contradiction
An expression that is false in every row, such as P∧¬PP \land \neg P
Logically equivalent
Two expressions with the same value in every row, written with ≡\equiv

Formula Card

Number of rows

rows=2n\text{rows} = 2^n

$n$ is the number of variables: $2^2 = 4$, $2^3 = 8$, $2^4 = 16$

Tautology

P∨¬PP \lor \neg P

Always true: the final column is all T

Contradiction

P∧¬PP \land \neg P

Always false: the final column is all F

De Morgan's laws

¬(P∧Q)≡¬P∨¬Q,¬(P∨Q)≡¬P∧¬Q\neg(P \land Q) \equiv \neg P \lor \neg Q, \quad \neg(P \lor Q) \equiv \neg P \land \neg Q

Two equivalences you can prove with a truth table

More in This Topic