Practice Truth Tables in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick 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.

Showing a random 20 of 50 problems.

Example 1

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

Example 2

medium
In a 3-variable truth table, how many rows have at least one variable False?

Example 3

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

Example 4

easy
In the truth table for A XOR BA \text{ XOR } B, how many of the 4 rows are True?

Example 5

medium
Does A OR (A AND B)A \text{ OR (A AND B)} simplify to AA? Check with the truth table.

Example 6

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

Example 7

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

Example 8

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 9

medium
How many True rows does the truth table for A AND B AND CA \text{ AND } B \text{ AND } C have?

Example 10

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

Example 11

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

Example 12

hard
Use a truth table to test whether A AND (NOT A OR B)A \text{ AND (NOT } A \text{ OR } B) simplifies to A AND BA \text{ AND } B.

Example 13

medium
Use a truth table to decide whether A XOR AA \text{ XOR } A is equivalent to False (a contradiction).

Example 14

medium
Evaluate NOT(A OR B)\text{NOT}(A \text{ OR } B) when A=False,B=FalseA=\text{False}, B=\text{False}.

Example 15

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

Example 16

challenge
A 3-input majority function MAJ(A,B,C)(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.

Example 17

easy
In the truth table for A OR BA \text{ OR } B, how many of the 4 rows are True?

Example 18

medium
Verify whether A AND (A OR B)A \text{ AND (A OR B)} is equivalent to AA using all 4 rows.

Example 19

easy
For A=False,B=TrueA=\text{False}, B=\text{True}, what is A XOR BA \text{ XOR } B?

Example 20

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