← Logic for the TMUA

Truth Tables

What you will get from this section. You will learn what truth tables are, how to construct truth tables for "and", "or", and implication, and how truth tables can be used to check whether two logical statements are equivalent.

Disclaimer

Most of this section is optional nice-to-know material, and provided for completeness of this logic course. However, there is one important point that is a must know. That is: another equivalent way to express

PQP \Rightarrow Q

is:

P and ¬Q cannot both be true.P \text{ and } \neg Q \text{ cannot both be true.}

This is because if PP and ¬Q\neg Q were both true, then this immediately contradicts PQP \Rightarrow Q.

The rest of the section is less central for TMUA preparation, so it can be skipped on a first reading.

What is a truth table?

A truth table is a table that lists all possible truth values of some statements.

For example, suppose PP and QQ are two statements. Each of them can be either true or false. So there are four possible cases:

PPQQ
TT
TF
FT
FF

Here TT means true, and FF means false.

These four rows cover every possible combination of truth values for PP and QQ.

The point of a truth table is to ask: in each row, what is the truth value of a larger statement built from PP and QQ?

Truth table for "PP and QQ"

The statement "PP and QQ" is true only when both PP and QQ are true.

PPQQP and QP \text{ and } Q
TTT
TFF
FTF
FFF

So "PP and QQ" is a very strict statement. It fails as soon as one of PP or QQ is false.

For example, suppose:

P:James is tallP: \text{James is tall}

and

Q:James is clever.Q: \text{James is clever}.

Then "PP and QQ" means:

James is tall and James is clever.\text{James is tall and James is clever}.

This is true only if James is both tall and clever.

Truth table for "PP or QQ"

The statement "PP or QQ" is true when at least one of PP or QQ is true.

PPQQP or QP \text{ or } Q
TTT
TFT
FTT
FFF

So "PP or QQ" only fails when both PP and QQ are false.

In mathematics, "or" usually means inclusive or. This means "PP or QQ" allows the possibility that both PP and QQ are true.

For example, if a number is divisible by 22 or 33, it is allowed to be divisible by both 22 and 33.

Truth table for "PQP \Rightarrow Q"

Now we come to the most important truth table for this course.

The implication

PQP \Rightarrow Q

means:

if P, then Q.\text{if } P,\text{ then } Q.

The formal truth table is:

PPQQPQP \Rightarrow Q
TTT
TFF
FTT
FFT

The key row is the second row:

PPQQPQP \Rightarrow Q
TFF

This is the only way for an implication to fail.

An implication PQP \Rightarrow Q says that whenever PP is true, QQ must also be true. So the implication is false exactly when PP is true but QQ is false.

This is exactly the same idea as counterexamples. To disprove

PQ,P \Rightarrow Q,

we need a case where PP is true and QQ is false.

What the implication truth table is really telling us

The implication truth table can feel strange at first.

For "PP and QQ", each row feels very direct. If PP is true and QQ is false, then "PP and QQ" is definitely false.

For "PP or QQ", each row also feels direct. If PP is true and QQ is false, then "PP or QQ" is definitely true.

But implication is slightly different. When we are testing a general implication PQP \Rightarrow Q, the rows are best understood like this:

PPQQWhat this case tells us about PQP \Rightarrow Q
TTCould still be true
TFDefinitely false
FTCould still be true
FFCould still be true

The only row that destroys the implication is:

P true and Q false.P \text{ true and } Q \text{ false}.

The other three rows do not prove the implication by themselves. They only mean the implication has not been broken by that case.

So when the formal truth table says:

PPQQPQP \Rightarrow Q
TTT

we should not think that one example where PP and QQ are both true proves the whole implication.

Instead, we should think:

this case is compatible with PQ.\text{this case is compatible with } P \Rightarrow Q.

Application 1: checking equivalent statements

Truth tables are useful because they can show whether two logical statements are equivalent.

Two statements are equivalent if they always have the same truth value in every row of the truth table.

For example, consider the implication:

PQP \Rightarrow Q

and its contrapositive:

¬Q¬P.\neg Q \Rightarrow \neg P.

Here is the truth table:

PPQQ¬P\neg P¬Q\neg QPQP \Rightarrow Q¬Q¬P\neg Q \Rightarrow \neg P
TTFFTT
TFFTFF
FTTFTT
FFTTTT

The final two columns are exactly the same.

Therefore,

PQP \Rightarrow Q

is equivalent to

¬Q¬P.\neg Q \Rightarrow \neg P.

This confirms, using truth tables, that an implication and its contrapositive are equivalent.

Application 2: seeing why the converse is different

Now compare an implication with its converse.

The implication is:

PQ.P \Rightarrow Q.

The converse is:

QP.Q \Rightarrow P.

Here is the truth table:

PPQQPQP \Rightarrow QQPQ \Rightarrow P
TTTT
TFFT
FTTF
FFTT

The final two columns are not the same.

Therefore,

PQP \Rightarrow Q

is not equivalent to

QP.Q \Rightarrow P.

This confirms what we saw earlier: an implication and its converse are not automatically both true.

Summary

  • A truth table lists all possible truth values of the basic statements involved.
  • For two statements PP and QQ, there are four possible rows.
  • "PP and QQ" is true only when both PP and QQ are true.
  • "PP or QQ" is true when at least one of PP or QQ is true.
  • The formal truth table for PQP \Rightarrow Q has only one false row: PP true and QQ false.
  • When testing a general implication, the row PP true and QQ false means "definitely false"; the other rows mean "could still be true".
  • Truth tables can be used to check whether two statements are equivalent.
  • Truth tables show that PQP \Rightarrow Q is equivalent to its contrapositive ¬Q¬P\neg Q \Rightarrow \neg P.
  • Truth tables also show that PQP \Rightarrow Q is not automatically equivalent to its converse QPQ \Rightarrow P.