Steply

Truth tables

Discrete Math · 22 problems, easy to harder

▶ Watch the first one solved

How we do it

  1. Rows for p and q
  2. Column for p ∨ q
  3. Column for ¬(p ∨ q)
  4. Check

The steps for Truth table of ~(p or q). Every solution names its steps, so you always know what comes next.

Worked examples

Truth table of p -> q Easy

The question

Question: make the truth table of p → q.

p → q

1 Rows for p and q

Each letter can be true or false.

Two letters give 2 × 2 = 4 rows: every way they can go.

= two letters: 2 × 2 = 4 rows

We make a table: a column for each letter, then a column for each part, from the inside out.

We write T for true and F for false.

T = true, F = false

p: the first half T, the second half F.

This way no row is missed.

q: T, F, T, F, down the column.

2 Column for p → q

We read the arrow as if, then.

→ = if ..., then ...

p → q is a promise: if p, then q.

It is broken only when p is true and q is false.

p → q: F only when p is T and q is F

So it is F only in row 2.

Careful!

If the if-part is false, the promise is not broken.

So F → F is T, and so is F → T.

Careful: not F → F = F ✗

The last column is the answer: when p → q is true.

Top to bottom: T, F, T, T.

= p → q: T, F, T, T

3 Check

Let's check row 2 by hand.

In row 2, p is true and q is false.

row 2: p = T, q = F

Put them in: T → F.

It gives F, as in the table.

Right!

T → F = F

Let's look back.

First: rows for p and q.

Then: column for p → q.

Last: check.

Answer
= p → q: T, F, T, T

▶ Watch it solved

Truth table of ~(p or q) Medium

The question

Question: make the truth table of ¬(p ∨ q).

¬(p ∨ q)

1 Rows for p and q

Each letter can be true or false.

Two letters give 2 × 2 = 4 rows: every way they can go.

= two letters: 2 × 2 = 4 rows

We make a table: a column for each letter, then a column for each part, from the inside out.

We write T for true and F for false.

T = true, F = false

p: the first half T, the second half F.

This way no row is missed.

q: T, F, T, F, down the column.

2 Column for p ∨ q

We read this sign as or.

∨ = or

p ∨ q is true when at least one of them is true.

It is false only when both are false.

p ∨ q: F only when both are F

So it is F only in row 4.

3 Column for ¬(p ∨ q)

We read this sign as not.

¬ = not

¬(p ∨ q) is the opposite of p ∨ q: T becomes F, F becomes T.

¬(p ∨ q): the opposite of (p ∨ q)

So it is T only in row 4.

Careful!

The ¬ is for the whole bracket, not only the first letter.

Careful: ¬ in front of a bracket: the opposite of the whole bracket

The last column is the answer: when ¬(p ∨ q) is true.

Top to bottom: F, F, F, T.

= ¬(p ∨ q): F, F, F, T

4 Check

Let's check row 1 by hand.

In row 1, p is true and q is true.

row 1: p = T, q = T

Put them in: ¬(T ∨ T).

The inside first.

It gives F, as in the table.

Right!

¬(T ∨ T) = ¬T = F

Let's look back.

First: rows for p and q.

Then: column for p ∨ q.

Then: column for ¬(p ∨ q).

Last: check.

Answer
= ¬(p ∨ q): F, F, F, T

▶ Watch it solved

Truth table of (p and q) -> r Harder

The question

Question: make the truth table of (p ∧ q) → r.

(p ∧ q) → r

1 Rows for p, q and r

Each letter can be true or false.

Three letters give 2 × 2 × 2 = 8 rows: every way they can go.

= three letters: 2 × 2 × 2 = 8 rows

We make a table: a column for each letter, then a column for each part, from the inside out.

We write T for true and F for false.

T = true, F = false

p: the first half T, the second half F.

This way no row is missed.

q: two T, two F, and again.

r: T, F, T, F, down the column.

2 Column for p ∧ q

We read this sign as and.

∧ = and

p ∧ q is true only when p and q are both true.

p ∧ q: T only when both are T

So it is T only in rows 1 and 2.

3 Column for (p ∧ q) → r

We read the arrow as if, then.

→ = if ..., then ...

(p ∧ q) → r is a promise: if p ∧ q, then r.

It is broken only when p ∧ q is true and r is false.

(p ∧ q) → r: F only when (p ∧ q) is T and r is F

So it is F only in row 2.

Careful!

If the if-part is false, the promise is not broken.

So F → F is T, and so is F → T.

Careful: not F → F = F ✗

The last column is the answer: when (p ∧ q) → r is true.

Top to bottom: T, F, T, T, T, T, T, T.

= (p ∧ q) → r: T, F, T, T, T, T, T, T

4 Check

Let's check row 2 by hand.

In row 2, p is true, q is true and r is false.

row 2: p = T, q = T, r = F

Put them in: (T ∧ T) → F.

The inside first.

It gives F, as in the table.

Right!

(T ∧ T) → F = T → F = F

Let's look back.

First: rows for p, q and r.

Then: column for p ∧ q.

Then: column for (p ∧ q) → r.

Last: check.

Answer
= (p ∧ q) → r: T, F, T, T, T, T, T, T

▶ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. truth table of p -> q
    Answer
    = p → q: T, F, T, T
  2. truth table of p and q
    Answer
    = p ∧ q: T, F, F, F
  3. truth table of p or q
    Answer
    = p ∨ q: T, T, T, F
  4. truth table of ~p or q
    Answer
    = ¬p ∨ q: T, F, T, T
  5. truth table of p <-> q
    Answer
    = p ↔ q: T, F, F, T
  6. truth table of ~p and q
    Answer
    = ¬p ∧ q: F, F, T, F
  7. truth table of p and ~q
    Answer
    = p ∧ ¬q: F, T, F, F
  8. truth table of ~(p and q)
    Answer
    = ¬(p ∧ q): F, T, T, T

Medium

  1. truth table of ~(p or q)
    Answer
    = ¬(p ∨ q): F, F, F, T
  2. truth table of (p -> q) and p
    Answer
    = (p → q) ∧ p: T, F, F, F
  3. truth table of p or ~p
    Answer
    = p ∨ ¬p: T, T
  4. truth table of p and ~p
    Answer
    = p ∧ ¬p: F, F
  5. truth table of ~p -> ~q
    Answer
    = ¬p → ¬q: T, T, F, T
  6. truth table of q -> p
    Answer
    = q → p: T, T, F, T
  7. truth table of (p or q) -> p
    Answer
    = (p ∨ q) → p: T, T, F, T
  8. truth table of p <-> ~q
    Answer
    = p ↔ ¬q: F, T, T, F
  9. truth table of ~(p -> q)
    Answer
    = ¬(p → q): F, T, F, F

Harder

  1. truth table of (p and q) -> r
    Answer
    = (p ∧ q) → r: T, F, T, T, T, T, T, T
  2. truth table of p or (q and r)
    Answer
    = p ∨ (q ∧ r): T, T, T, T, T, F, F, F
  3. truth table of (p -> q) or r
    Answer
    = (p → q) ∨ r: T, T, T, F, T, T, T, T
  4. truth table of (p and q) -> p
    Answer
    = (p ∧ q) → p: T, T, T, T
  5. truth table of ~p and (q or r)
    Answer
    = ¬p ∧ (q ∨ r): F, F, F, F, T, T, T, F