Truth Tables Examples: 46 Problems with Answers

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Truth Tables.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in CS Thinking.

Concept Recap

A table listing every combination of boolean inputs and the resulting output for a logical expression.

Map out every possible True/False scenario to be sure you understand what a logical expression does.

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Truth tables exhaustively verify logical expressions and can reveal equivalences between different expressions.

Common stuck point: With n variables there are 2ⁿ rows — 3 variables means 8 rows, 4 means 16.

Sense of Study hint: To build a truth table, list all input variables as columns, then add a column for the output expression. Fill in all possible True/False combinations for the inputs (2n rows for n variables), then evaluate the expression for each row. Compare columns to check for logical equivalences.

Worked Examples

Example 1

medium
Build the truth table for (A AND B) OR C and count the number of True rows.

Answer

5

First step

1
List 8 rows for (A,B,C).

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

medium
Using De Morgan, what expression is equivalent to NOT(A OR B)? Then verify on the A=T,B=F row.

Example 3

medium
Use a truth table to decide whether A XOR A is equivalent to False (a contradiction).

Example 4

hard
Build the truth table for (A AND B) OR (NOT A AND NOT B). What standard operator does it match?

Example 5

hard
Use a truth table to test whether A AND (NOT A OR B) simplifies to A AND B.

Example 6

challenge
Verify with truth tables that NAND alone is functionally complete by expressing NOT, AND, and OR using only NAND.

Example 7

challenge
Two students disagree about whether (A OR B) AND (NOT A OR C) equals (A AND C) OR (NOT A AND B). Settle it with a truth table.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
How many rows does a truth table for 2 boolean variables have?

Example 2

easy
How many rows does a truth table for 3 boolean variables have?

Example 3

easy
In the truth table for A AND B, how many of the 4 rows are True?

Example 4

easy
In the truth table for A OR B, how many of the 4 rows are True?

Example 5

easy
In the truth table for A XOR B, how many of the 4 rows are True?

Example 6

easy
For the row A=True,B=False, what is A AND B?

Example 7

easy
How many rows does a truth table for 4 boolean variables have?

Example 8

easy
For the row A=False, what is NOT A?

Example 9

medium
Build the truth table for NOT A OR B. For which of the 4 (A,B) rows is it False?

Example 10

medium
Are A AND B and B AND A equivalent? Justify using the truth table.

Example 11

medium
Verify De Morgan: do NOT(A AND B) and (NOT A) OR (NOT B) match on all 4 rows?

Example 12

medium
Evaluate A AND (B OR C) for A=True,B=False,C=True.

Example 13

medium
In an 8-row truth table for A,B,C, how many rows have exactly one variable True?

Example 14

medium
Does A OR (A AND B) simplify to A? Check with the truth table.

Example 15

medium
A truth table for an expression in 5 variables would have how many rows, and why is exhaustive checking still feasible by computer?

Example 16

challenge
Two students claim A XOR B equals (A OR B) AND NOT(A AND B). Verify across ALL 4 rows.

Example 17

challenge
An expression's truth table is True on exactly the rows (T,F) and (F,T) for variables (A,B). Identify the standard operator it represents and write it using AND/OR/NOT.

Example 18

challenge
How many distinct truth tables (boolean functions) exist for 2 input variables, and why?

Example 19

medium
Build the truth table for A AND NOT B. On which (A,B) row is it True?

Example 20

medium
Are A OR B and B OR A equivalent? Justify with the truth table.

Example 21

easy
How many rows does a truth table for 5 boolean variables have?

Example 22

easy
For A=True,B=True, what is A OR B?

Example 23

easy
For A=False,B=True, what is A XOR B?

Example 24

easy
How many rows of the 4-row truth table for A XOR B are False?

Example 25

easy
Evaluate NOT(NOT A) when A=True.

Example 26

easy
Which row of the truth table for A AND B is the only True row?

Example 27

easy
True or False: a truth table guarantees logical equivalence only if matching outputs appear on every row.

Example 28

medium
Evaluate A OR (NOT B) when A=False,B=True.

Example 29

medium
Verify whether A AND (A OR B) is equivalent to A using all 4 rows.

Example 30

medium
Evaluate NOT(A OR B) when A=False,B=False.

Example 31

medium
In an 8-row truth table for A,B,C, how many rows have all three variables True?

Example 32

medium
Evaluate (A XOR B) AND C for A=T,B=F,C=T.

Example 33

medium
How many True rows does the truth table for A OR B OR C have?

Example 34

medium
How many True rows does the truth table for A AND B AND C have?

Example 35

hard
Are A AND (B OR C) and (A AND B) OR (A AND C) equivalent? Justify on all 8 rows.

Example 36

hard
An expression on A,B outputs True on rows (T,T) and (F,F), False elsewhere. Write a simple AND/OR/NOT expression matching it.

Example 37

hard
How many distinct boolean functions exist on 3 variables? Justify the count.

Example 38

hard
For n=10 boolean inputs, exhaustive truth-table checking requires how many rows? Express as a power of two and a decimal.

Example 39

challenge
A 3-input majority function MAJ(A,B,C) outputs True when at least two inputs are True. How many True rows does its truth table have, and write it in DNF.

Background Knowledge

These ideas may be useful before you work through the harder examples.

boolean logiclogical operators