← Logic

Logic

Truth Tables

Lesson

A truth table lists every possible combination of truth values for the variables and computes the result of a compound statement.

Number of rows

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

For nn variables. 1 variable → 2 rows. 2 variables → 4 rows. 3 variables → 8 rows.

Evaluating compound statements

Work from the inside out: handle negations and parentheses first, then AND, then OR, then conditionals/biconditionals.

Worked example

(pq)¬p(p \wedge q) \vee \neg p with p=T, q=F:

p∧q = T∧F = F. ¬p = F. F ∨ F = F.

Practice

Work through these. Stuck? Click Get a hint.

Warm-Up

Quick problems to get going.

Problem 1

Rows in truth table for 1 variable\text{Rows in truth table for 1 variable}

Problem 2

Rows in truth table for 2 variables\text{Rows in truth table for 2 variables}

Problem 3

Rows for 3 variables\text{Rows for 3 variables}

Problem 4

Rows for 4 variables\text{Rows for 4 variables}

Practice

Standard problems matching the lesson.

Problem 5

p=T,q=F; pqp = T, q = F; \ p \wedge q

Problem 6

p=T,q=F; pqp = T, q = F; \ p \vee q

Problem 7

p=T,q=F; pqp = T, q = F; \ p \to q

Problem 8

p=T,q=F; qpp = T, q = F; \ q \to p

Problem 9

p=T,q=F; (pq)¬pp = T, q = F; \ (p \wedge q) \vee \neg p

Problem 10

p=T,q=T; (pq)¬pp = T, q = T; \ (p \wedge q) \vee \neg p

Problem 11

p=F,q=T; (pq)¬pp = F, q = T; \ (p \wedge q) \vee \neg p

Problem 12

p=F,q=F; (pq)¬pp = F, q = F; \ (p \wedge q) \vee \neg p

Problem 13

p=T,q=F; ¬(pq)p = T, q = F; \ \neg(p \vee q)

Problem 14

p=F,q=F; ¬(pq)p = F, q = F; \ \neg(p \vee q)

Problem 15

p=T,q=T; pqp = T, q = T; \ p \leftrightarrow q

Problem 16

p=T,q=F; pqp = T, q = F; \ p \leftrightarrow q

Problem 17

Rows for 5 variables\text{Rows for 5 variables}

Problem 18

p=T,q=T; ¬pqp = T, q = T; \ \neg p \to q

Challenge

Harder problems — edge cases, trickier numbers, multiple steps.

Problem 19

p=T,q=F,r=T; (pq)rp = T, q = F, r = T; \ (p \to q) \wedge r

Problem 20

p=T,q=T,r=F; (pq)rp = T, q = T, r = F; \ (p \to q) \vee r

Problem 21

p=F,q=T,r=T; p(qr)p = F, q = T, r = T; \ p \wedge (q \vee r)

Problem 22

p=T,q=F; ¬(pq)p = T, q = F; \ \neg(p \to q)

Problem 23

p=T,q=T; ¬p¬qp = T, q = T; \ \neg p \vee \neg q

Problem 24

p=F,q=F; ¬p¬qp = F, q = F; \ \neg p \wedge \neg q

Problem 25

p=T,q=F,r=F; (pq)rp = T, q = F, r = F; \ (p \vee q) \to r

Ask the tutor

Stuck on a concept? Want another example? Ask anything about this topic.

Type your own question below, or tap one of the suggestions. The tutor can re-explain the lesson, work through a specific problem with you, generate fresh practice tuned to where you are, or check your reasoning.

Quiz

Test yourself on this topic →

10 questions, no hints. About 5 minutes.