Discrete Mathematics: Truth Tables

An Introduction to Logical Connectives and Truth Table Construction

What is a Truth Table?

A truth table is a mathematical table used in logic to determine the truth value of a compound statement based on the truth values of its components. Each row represents a possible combination of truth values for the variables involved.

The two possible truth values are True (T) and False (F). For a statement with n variables, there are 2n possible rows.

Example: The statement p ∧ q ("p AND q") is only True when both p and q are True.

Common Logical Connectives

Symbol Name Read As True When…
¬p Negation "NOT p" p is False
p ∧ q Conjunction "p AND q" Both p and q are True
p ∨ q Disjunction "p OR q" At least one of p, q is True
p → q Conditional "If p, then q" p is False, OR q is True
p ↔ q Biconditional "p if and only if q" p and q have the same value
p ⊕ q Exclusive OR "p XOR q" Exactly one of p, q is True

Basic Truth Tables

Negation (¬p)

p¬p
TF
FT

Conjunction (p ∧ q)

pqp ∧ q
TTT
TFF
FTF
FFF

Disjunction (p ∨ q)

pqp ∨ q
TTT
TFT
FTT
FFF

Conditional (p → q)

pqp → q
TTT
TFF
FTT
FFT

Biconditional (p ↔ q)

pqp ↔ q
TTT
TFF
FTF
FFT

Compound Statements

Complex logical expressions can be broken down column by column in a truth table. Evaluate inner expressions first, then use their results to compute the outer expression.

Example: ¬p ∨ q

pq¬p¬p ∨ q
TT FT
TF FF
FT TT
FF TT
Notice that ¬p ∨ q has the same truth values as p → q — they are logically equivalent!

Tautologies & Contradictions

A tautology is a statement that is always True regardless of the truth values of its variables. A contradiction is always False.

Tautology: p ∨ ¬p

p¬pp ∨ ¬p
TFT
FTT

Contradiction: p ∧ ¬p

p¬pp ∧ ¬p
TFF
FTF

Truth table calculator

Variables: single uppercase letters (A–Z)  ·  Operators: AND && & · OR || | · NOT ! ~ · XOR ^ · NAND · XNOR · NOR · → (implies) · ↔ (biconditional)
Insert:
Enter an expression above to generate a truth table

Practice Problems

Problem 1:
What is the truth value of ¬p when p = True?

False. Negation flips the truth value, so ¬T = F.
Problem 2:
Evaluate p ∧ q when p = True and q = False.

False. A conjunction is True only when both operands are True. Since q = F, the result is F.
Problem 3:
Evaluate p → q when p = False and q = False.

True. A conditional is only False when the hypothesis (p) is True and the conclusion (q) is False. Since p = F here, the whole statement is True (vacuously true).
Problem 4:
Build the full truth table for p ↔ q.

pqp ↔ q
TTT
TFF
FTF
FFT
Problem 5:
How many rows does a truth table with 3 variables (p, q, r) have?

8 rows. With n variables there are 2n combinations. 23 = 8.

Challenge Problems

  1. Construct a full truth table for the compound statement (p ∧ q) → r with three variables p, q, and r.
  2. Show that p → q and ¬p ∨ q are logically equivalent by building both columns in a single truth table.
  3. Is (p ∨ q) ∧ ¬(p ∧ q) a tautology, contradiction, or neither? Build the truth table to justify your answer. (Hint: this is XOR!)