Chapter 7 Logic

# 7.3 Constructing Truth Tables

Learning Objectives

By the end of this section, you will be able to:

• Interpret and apply negations, conjunctions, and disjunctions.
• Construct a truth table using negations, conjunctions, and disjunctions.
• Construct a truth table for a compound statement and interpret its validity.

Are you familiar with the Choose Your Own Adventure book series written by Edward Packard? These gamebooks allow the reader to become one of the characters and make decisions that affect what happens next, resulting in different sequences of events in the story and endings based on the choices made. Writing a computer program is a little like what it must be like to write one of these books. The programmer must consider all the possible inputs that a user can put into the program and decide what will happen in each case, then write their program to account for each of these possible outcomes.

truth table is a graphical tool used to analyze all the possible truth values of the component logical statements to determine the validity of a statement or argument along with all its possible outcomes. The rows of the table correspond to each possible outcome for the given logical statement identified at the top of each column. A single logical statement $p$ has two possible truth values, true or false. In truth tables, a capital T will represent true values, and a capital F will represent false values.

In this section, you will use the knowledge built in Section 7.1 and Section 7.2 to analyze arguments and determine their truth value and validity. A logical argument is valid if its conclusion follows from its premises, regardless of whether those premises are true or false. You will then explore the truth tables for negation, conjunction, and disjunction, and use these truth tables to analyze compound logical statements containing these connectives.

# Interpret and Apply Negations, Conjunctions, and Disjunctions

The negation of a statement will have the opposite truth value of the original statement. When $p$ is true, $\sim{p}$ is false, and when $p$ is false, $\sim{p}$ is true.

Example 1

For each logical statement, determine the truth value of its negation.

a) $p: 3+5=8$

$p$ is true because $3+5$ does equal 8; therefore, the negation of $p$, $\sim{p}:3+5 \neq 8$, is false.

b) $q$: All horses are mustangs.

$q$ is false because there are other types of horses besides mustangs, such as Clydesdales or Arabians; therefore, the negation of $q$, $\sim{q}$ is true.

c) $\sim{r}$: Baton Rouge is the capital of Louisiana.

$\sim{r}$ is false because Baton Rouge is the capital of Louisiana; therefore, the negation of $\sim{r}$, $r$, is true.

Exercise 1

For each logical statement, determine the truth value of its negation.

a) $\sim{p}: 3 \times 5 = 14$

b) $\sim{q}$: Some houses are built with bricks.

c) $r$: New Orleans is not the capital of Louisiana.

Solution

a) $p: 3 \times 5 \neq 14$; true

b) $q$: No houses are build with bricks; false

c) $\sim{r}$: New Orleans is the capital of Louisiana; false

A conjunction is a logical and statement. For a conjunction to be true, both statements that make up the conjunction must be true. If at least one of the statements is false, the and statement is false.

Example 2

Given $p: 4+7=11$, $q: 11-3=7$, and $r: 7 \times 11=77$, determine the truth value of each conjunction.

a) $p \land q$

$p$ is true, and $q$ is false. Because one statement is true, and the other statement is false, this makes the complete conjunction false.

b) $\sim{q} \land r$

$q$ is false, so $\sim{q}$ is true, and $r$ is true. Therefore, both statements are true, making the complete conjunction true.

c) $\sim{p} \land q$

$\sim{p}$ is false, and $q$ is false. Because both statements are false, the complete conjunction is false.

Exercise 2

Given $p$: Yellow is a primary color, $q$: Blue is a primary color, and $r$: Green is a primary color, determine the truth value of each conjunction.

a) $p \land q$

b) $q \land r$

c) $\sim{r} \land p$

Solution

a) True

b) False

c) True

A disjunction is a logical inclusive or statement, which means that a disjunction is true if one or both statements that form it are true. The only way a logical inclusive or statement is false is if both statements that form the disjunction are false.

Example 3

Given $p: 4+7=11$, $q: 11-3=7$, and $r: 7 \times 11=77$, determine the truth value of each disjunction.

a) $p \lor q$

$p$ is true, and $q$ is false. One statement is true, and one statement is false, which makes the complete disjunction true.

b) $\sim{q} \lor r$

$q$ is false, so $\sim{q}$ is true, and $r$ is true. Therefore, one statement is true, and the other statement is true, which makes the complete disjunction true.

c) $\sim{p} \lor q$

$\sim{p}$ is false, and $q$ is false. When all of the component statements are false, the disjunction is false.

Exercise 3

Given $p$: Yellow is a primary color, $q$: Blue is a primary color, and $r$: Green is a primary color, determine the truth value of each disjunction.

(a) $p \lor q$

(b) $\sim{p} \lor r$

(c) $q \lor r$

Solution

(a) True

(b) False

(c) True

In the next example, you will apply the dominance of connectives to find the truth values of compound statements containing negations, conjunctions, and disjunctions and use a table to record the results. When constructing a truth table to analyze an argument where you can determine the truth value of each component statement, the strategy is to create a table with two rows. The first row contains the symbols representing the components that make up the compound statement. The second row contains the truth values of each component below its symbol. Include as many columns as necessary to represent the value of each compound statement. The last column includes the complete compound statement with its truth value below it.

## Videos for Extra Help

Example 4

Given $p: 4+7=11$, $q: 11-3=7$, and $r: 7 \times 11=77$, construct a truth table to determine the truth value of each compound statement.

a) $\sim{p} \land q \lor r$

Step 1: The statement “$\sim{p} \land q \lor r$” contains three basic logical statements, $p$, $q$, and $r$, and three connectives. When we place parentheses in the statement to indicate the dominance of connectives, the statement becomes $(((\sim{p}) \land q) \lor r)$.

Step 2: After we have applied the dominance of connectives, we create a two row table that includes a column for each basic statement that makes up the compound statement, and an additional column for the contents of each parentheses. Because we have three sets of parentheses, we include a column for $\sim{p}$, the innermost parentheses, a column for $(\sim{p}) \land q$, the next set of parentheses, and $((\sim{p}) \land q) \lor r$ in the last column for the third parentheses.

Step 3: Once the table is created, we determine the truth value of each statement starting from left to right. The truth values of $p$, $q$, and $r$ are true, false, and true, respectively, so we place T, F, and T in the second row of the table. Because $p$ is true, $\sim{p}$ is false.

Step 4: Next, evaluate $\sim{p} \land q$ from the table: $\sim{p}$ is false, and $q$ is also false, so $\sim{p} \land q$ is false, because a conjunction is only true if both of the statements that make it are true. Place an F in the table below its heading.

Step 5: Finally, using the table, we understand that $(\sim{p} \land q)$ is false and $r$ is true, so the complete statement $(\sim{p} \land q) \lor r$ is false or true, which is true (because a disjunction is true whenever at least one of the statements that make it is true). Place a T in the last column of the table. The complete statement $\sim{p} \land q \lor r$ is true.

$\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{p} & (\sim{p}) \land q & ((\sim{p}) \land q) \lor r \\ \hline \text{T} & \text{F} & \text{T} & \text{F} & \text{F}& \textbf{T} \\ \hline \end{array}$

b) $\sim{p} \lor q \land r$

Step 1: Applying the dominance of connectives to the original compound statement $\sim{p} \lor q \land r$ we get $(((\sim{p}) \lor q) \land r)$.

Step 2: The table needs columns for $p$, $q$, $r$, $\sim{p}$, $(\sim{p}) \lor q$, and $((\sim{p}) \lor q) \land r$.

Step 3:The truth values of $p$, $q$, $r$, and $\sim{p}$ are the same as in Question (a).

Step 4: Next, $\sim{p} \lor q$ is false or false, which is false, so we place an F below this statement in the table. This is the only time that a disjunction is false.

Step 5: Finally, $\sim{p} \lor q$ and $r$ are the conjunction of the statements, $\sim{p} \lor q$ and $r$, and so the expressions evaluate to false and true, which is false. Recall that the only time an “and” statement is true is when both statements that form it are also true. The complete statement $\sim{p} \lor q \land r$ is false.

$\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{p} & (\sim{p}) \lor q & ((\sim{p}) \lor q) \land r \\ \hline \text{T} & \text{F} & \text{T} & \text{F} & \text{F}& \textbf{F} \\ \hline \end{array}$

c) $\sim{(p \land r)} \lor q$

Step 1: Applying the dominance of connectives to the original statement, we have: $((\sim{(p \land r)}) \lor q)$.

Step 2: So, the table needs the following columns: $p$, $q$, $r$, $\sim{(p \land r)}$, and $\sim{(p \land r)} \lor q$.

Step 3: The truth values of $p$, $q$, and $r$ are the same as in Questions 1 and 2.

Step 4: From the table it can be seen that $p \land r$ is true and true, which is true. So the negation of $p$ and $r$ is false, because the negation of a statement always has the opposite truth value of the original statement.

Step 5: Finally, $\sim{(p \land r)} \lor q$ is the disjunction of $\sim{(p \land r)}$ with $q$ and so we have false or false, which makes the complete statement false.

$\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & p \land r & \sim{(p \land r)} & \sim{(p \land r)} \lor q \\ \hline \text{T} & \text{F} & \text{T} & \text{T} & \text{F}& \textbf{F} \\ \hline \end{array}$

Exercise 4

Given $p$: Yellow is a primary color, $q$: Blue is a primary color, and $r$: Green is a primary color, determine the truth value of each compound statement by constructing a truth table.

a) $\sim{q} \land p \lor r$

b) $p \lor q \land \sim{r}$

c) $\sim{(p \land r)} \land q$

Solution

a) $\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{q} & \sim{q} \land p & (\sim{q} \land p) \lor r \\ \hline \text{T} & \text{T} & \text{F} & \text{F} & \text{F}& \textbf{F} \\ \hline \end{array}$

b) $\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{r} & p \lor q & (p \lor q) \land (\sim{r}) \\ \hline \text{T} & \text{T} & \text{F} & \text{T} & \text{T}& \textbf{T} \\ \hline \end{array}$

c) $\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & (p \land r) & \sim{p \land r} & \sim{(p \land r)} \land q \\ \hline \text{T} & \text{T} & \text{F} & \text{F} & \text{T}& \textbf{T} \\ \hline \end{array}$

# Construct Truth Tables to Analyze All Possible Outcomes

Recall that the negation of a statement will always have the opposite truth value of the original statement; if a statement $p$ is false, then its negation $\sim{p}$ is true, and if a statement $p$ is true, then its negation $\sim{p}$ is false. To create a truth table for the negation of statement $p$, add a column with a heading of $\sim{p}$, and for each row, input the truth value with the opposite value of the value listed in the column for $p$, as depicted in the table below.

$\begin{array} {|c|c|} \hline p & \sim{p} \\ \hline \text{T} & \text{F} \\ \hline \text{F} & \text{T} \\ \hline \end{array}$

Conjunctions and disjunctions are compound statements formed when two logical statements combine with the connectives “and” and “or” respectively. How does that change the number of possible outcomes and thus determine the number of rows in our truth table? The multiplication principle, also known as the fundamental counting principle, states that the number of ways you can select an item from a group of $n$ items and another item from a group with $m$ items is equal to the product of $m$ and $n$. Because each proposition $p$ and $q$ has two possible outcomes, true or false, the multiplication principle states that there will be $2 \times 2 = 4$ possible outcomes: {TT, TF, FT, FF}.

The tree diagram and table below demonstrate the four possible outcomes for two propositions $p$ and $q$.

A conjunction is a logical and statement. For a conjunction to be true, both the statements that make up the conjunction must be true. If at least one of the statements is false, the and statement is false.

A disjunction is a logical inclusive or statement. Which means that a disjunction is true if one or both statements that make it are true. The only way a logical inclusive or statement is false is if both statements that make up the disjunction are false.

 Conjunction (AND) Disjunction (OR) $p$ $q$ $p \land q$ $p$ $q$ $p \lor q$ T T T T T T T F F T F T F T F F T T F F F F F F

## Videos for Extra Help

Example 5

Construct a truth table to analyze all possible outcomes for each of the following arguments.

a) $p \lor \sim{q}$

Step 1: Because there are two basic statements, $p$ and $q$, and each of these has two possible outcomes, we will have $2(2)=4$ rows in our table to represent all possible outcomes: TT, TF, FT, and FF. The columns will include $p$, $q$, $\sim{q}$, and $p \lor q$.

Step 2: Every value in column $\sim{q}$ will have the opposite truth value of the corresponding value in column $q$: F, T, F, and T.

Step 3: To complete the last column, evaluate each element in column $p$ with the corresponding element in column $\sim{q}$ using the connective or.

$\begin{array} {|c|c|c|c|} \hline p & q & \sim{q} & p \lor \sim{q} \\ \hline \text{T} & \text{T} & \text{F} & \textbf{T} \\ \hline \text{T} & \text{F} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{F} & \text{T} & \textbf{T} \\ \hline \end{array}$

b) $\sim{(p \land q)}$

Step 1: The columns will include $p$, $q$, $p \land q$, and $\sim{(p \land q)}$. Because there are two basic statements, $p$ and $q$, the table will have four rows to account for all possible outcomes.

Step 2: The $p \land q$ column will be completed by evaluating the corresponding elements in columns $p$ and $q$ respectively with the and connective.

Step 3: The final column, $\sim{(p \land q)}$, will be the negation of the $p \land q$ column.

$\begin{array} {|c|c|c|c|} \hline p & q & p \land q & \sim{p \land q} \\ \hline \text{T} & \text{T} & \text{T} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{F} & \text{F} & \textbf{T} \\ \hline \end{array}$

c) $(p \lor q) \land r$

Step 1: This statement has three basic statements, $p$, $q$, and $r$. Because each basic statement has two possible truth values, true or false, the multiplication principal indicates there are $2(2)(2)=8$ possible outcomes. So eight rows of outcomes are needed in the truth table to account for each possibility. Half of the eight possibilities must be true for the first statement, and half must be false.

Step 2: So, the first column for statement $p$, will have four T’s followed by four F’s. In the second column for statement $q$, when $p$ is true, half the outcomes for $q$ must be true and the other half must be false, and the same pattern will repeat for when $p$ is false. So, column $q$ will have TT, FF, TT, FF.

Step 3: The column for the third statement, $r$, must alternate between T and F. Once, the three basic propositions are listed, you will need a column for $\sim{q}$, $p \lor \sim{q}$, and $(p \lor \sim{q}) \land r$.

Step 4: The column for the negation of $q$, $\sim{q}$, will have the opposite truth value of each value in column $q$.

Step 5: Next, fill in the truth values for the column containing the statement $p \lor \sim{q} .$ The or statement is true if at least one of $p$ or $\sim{q}$ is true, otherwise it is false.

Step 6: Finally, fill in the column containing the conjunction $(p \lor \sim{q}) \land r$. To evaluate this statement, combine column $p \lor \sim{q}$ and column $r$ with the and connective. Recall, that only time “and” is true is when both values are true, otherwise the statement is false. The complete truth table is:

$\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{q} & p \lor \sim{q} & (p \lor \sim{q}) \land r \\ \hline \text{T} & \text{T} & \text{T} & \text{F} & \text{T} & \textbf{T} \\ \hline \text{T} & \text{T} & \text{F} & \text{F} & \text{T} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{T} & \text{T} & \text{T} & \textbf{T} \\ \hline \text{T} & \text{F} & \text{F} & \text{T} & \text{T} & \textbf{F} \\ \hline \text{F} & \text{T} & \text{T} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{T} & \text{F} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{F} & \text{T} & \text{T} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{F} & \text{F} & \text{T} & \text{T} & \textbf{F} \\ \hline \end{array}$

Exercise 5

Construct a truth table to analyze all possible outcomes for each of the following arguments.

a) $p \land \sim{q}$

b) $\sim{(p \lor q)}$

c) $(p \land \sim{q}) \lor r$

Solution

a) $\begin{array} {|c|c|c|c|} \hline p & q & \sim{q} & p \land \sim{q} \\ \hline \text{T} & \text{T} & \text{F} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{F} & \text{T} & \textbf{F} \\ \hline \end{array}$

b)

$\begin{array} {|c|c|c|c|} \hline p & q & p \lor q & \sim{p \lor q} \\ \hline \text{T} & \text{T} & \text{T} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{T} & \textbf{F} \\ \hline \text{F} & \text{T} & \text{T} & \textbf{F} \\ \hline \text{F} & \text{F} & \text{F} & \textbf{T} \\ \hline \end{array}$

c)

$\begin{array} {|c|c|c|c|c|c|} \hline p & q & r & \sim{q} & p \land \sim{q} & (p \land \sim{q}) \lor r \\ \hline \text{T} & \text{T} & \text{T} & \text{F} & \text{F} & \textbf{T} \\ \hline \text{T} & \text{T} & \text{F} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{T} & \text{T} & \text{T} & \textbf{T} \\ \hline \text{T} & \text{F} & \text{F} & \text{T} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{T} & \text{F} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{F} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{F} & \text{T} & \text{T} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{F} & \text{F} & \text{T} & \text{F} & \textbf{F} \\ \hline \end{array}$

# Determine the Validity of a Truth Table for a Compound Statement

A logical statement is valid if it is always true regardless of the truth values of its component parts. To test the validity of a compound statement, construct a truth table to analyze all possible outcomes. If the last column, representing the complete statement, contains only true values, the statement is valid.

Example 6

Construct a truth table to determine the validity of each of the following statements.

a) $\sim{p} \land q$

Step 1: Because there are two statements, $p$ and $q$, and each of these has two possible outcomes, there will be $2(2)=4$ rows in our table to represent all possible outcomes: TT, TF, FT, and FF.

Step 2: The columns, will include $p$, $q$, $\sim{p}$, and $\sim{p} \land q$. Every value in column $\sim{p}$ will have the opposite truth value of the corresponding value in column $p$.

Step 3: To complete the last column, evaluate each element in column $\sim{p}$ with the corresponding element in column $q$ using the connective and . The last column contains at least one false, therefore the statement $\sim{p} \land q$ is not valid.

$\begin{array} {|c|c|c|c|} \hline p & q & \sim{p} & \sim{p} \land q \\ \hline \text{T} & \text{T} & \text{F} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{F} & \text{T} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{F} & \text{T} & \textbf{F} \\ \hline \end{array}$

b) $\sim{(p \land \sim{p})}$

Step 1: Because the statement $\sim{(p \land \sim{p})}$ only contains one basic proposition, the truth table will only contain two rows. Statement $p$ may be either true or false.

Step 2: The columns will include $p$, $\sim{p}$, $p \land \sim{p}$, and $\sim{(p \land \sim{p})}$. Evaluate column $p \land \sim{p}$ with the and connective, because the symbol $\land$ represents a conjunction or logical and statement. True and false is false, and false and true is also false.

Step 3: The final column is the negation of each entry in the third column, both of which are false, so the negation of false is true. Because all the truth values in the final column are true, the statement $\sim{(p \land \sim{p})}$ is valid.

$\begin{array} {|c|c|c|c|} \hline p & \sim{p} & p \land \sim{p} & \sim{(p \land \sim{p})} \\ \hline \text{T} & \text{F} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{F} & \textbf{T} \\ \hline \end{array}$

Exercise 6

Construct a truth table to determine the validity of each of the following statements.

a) $p \lor \sim{p}$

b) $\sim{p} \lor \sim{q}$

Solution

a) Valid

$\begin{array} {|c|c|c|c|} \hline p & \sim{p} & p \lor \sim{p} \\ \hline \text{T} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{T} & \textbf{T} \\ \hline \end{array}$

b) Not Valid

$\begin{array} {|c|c|c|c|c|} \hline p & q & \sim{p} & \sim{q} & \sim{p} \lor q \\ \hline \text{T} & \text{T} & \text{F} & \text{F} & \textbf{F} \\ \hline \text{T} & \text{F} & \text{F} & \text{T} & \textbf{T} \\ \hline \text{F} & \text{T} & \text{T} & \text{F} & \textbf{T} \\ \hline \text{F} & \text{F} & \text{T} & \text{T} & \textbf{T} \\ \hline \end{array}$