# 2.9: And and Or Statements

- Page ID
- 2148

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\id}{\mathrm{id}}\)

\( \newcommand{\Span}{\mathrm{span}}\)

\( \newcommand{\kernel}{\mathrm{null}\,}\)

\( \newcommand{\range}{\mathrm{range}\,}\)

\( \newcommand{\RealPart}{\mathrm{Re}}\)

\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

\( \newcommand{\Argument}{\mathrm{Arg}}\)

\( \newcommand{\norm}[1]{\| #1 \|}\)

\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)

\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)

\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vectorC}[1]{\textbf{#1}} \)

\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Truth tables for conjunctions and disjunctions.

The words “and” and “or” are common in everyday language. In mathematics, there are some subtle differences that you need to watch out for, especially considering the word “or”.

It will rain or it will snow.

When is this statement true and when is it false?

## Introduction to Logic

- \(P=It\: is\: snowing.\)
- \(Q=I\: am\: cold.\)

The **truth value** of a statement is whether the statement is true or false. As a mathematician, your job is to determine when a logical statement is true and when it is false. If you don’t have enough information to determine whether the original statements are true or false, you can build a truth table to organize all the possible cases.

Consider the atomic statement P joined with the atomic statement \(Q\). The following sentence can be written using the symbol “ \(\lor\) ” for the logical connective “or”.

\(It\: is \:snowing \:or \:I \:am \:cold.\)

\(P\lor Q\)

This statement is a little strange because it seems to imply that it is always the case that one or both of those atomic statements is happening. Your common sense may dictate that this statement isn’t true because of course there are times when it is sunny and you are warm. It’s important to remember that not all statements are true! Your job is to determine what has to be true for the above statement to be true. To organize your work, you should construct a truth table. A truth table considers all possible combinations of the original atomic statements being true or false, and then uses logic to deduce the truth value of the compound statement in each case.

**Here is the truth table for OR:**

\(P\) | \(Q\) | \(P \lor Q\) |

T |
T |
T |

T |
F |
T |

F |
T |
T |

F |
F |
F |

Notice that there are four possible truth combinations of \(P\) and \(Q\) (both true, first true/second false, first false/second true, both false). Only one of these combinations yields a false statement for \(P \lor Q\). What this means is that the statement “It is snowing or I am cold” is only false if “it is snowing” is false and “I am cold” is false. Note that if “it is snowing” is true and “I am cold” is also true, then “It is snowing or I am cold” is true. In mathematics, the word “or” does not mean exactly one or the other. It means “one or the other or both”.

Next consider the truth table for the following statement that uses the connective “and”. The following sentence can be written using the symbol “ \(\wedge\) ” for the logical connective “and”.

\(It\: is \:snowing \:and \:I \:am \:cold.\)

\(P\wedge Q\)

**Here is the truth table for AND:**

P | Q | P \wedge Q |

T |
T |
T |

T |
F |
F |

F |
T |
F |

F |
F |
F |

Notice that a compound statement using “and” is true only if each atomic statement is individually true.

Watch the portion of this video focusing on truth tables of **conjunction** and **disjunction**:

Example \(\PageIndex{1}\)

Earlier, you were asked when the statement "It will rain or it will snow" will be true and false. In English, most people use the word “or” to mean exclusive “or”. If you were told “you can have a brownie or a cookie for dessert”, you would assume you had to choose just one and couldn’t have both the brownie and the cookie. In mathematics, the word “or” means “one or the other or both”. Therefore in logic, “or” includes the case when both atomic parts of the state are true.

\(P=It\: will\: rain.\)

\(Q=It\: will\: snow.\)

\(P \lor Q\)

**Solution**

\(P\) | \(Q\) | \(P \lor Q\) |

T |
T |
T |

T |
F |
T |

F |
T |
T |

F |
F |
F |

The statement is only false when both parts of the statement are false. In other words, the statement is only false if “it will rain” is false and “it will snow” is also false. When one or both parts of an “or” statement are true then the whole statement is true.

Example \(\PageIndex{2}\)

Identify the atomic statements in the following compound sentence. Then, use logical connectives to rewrite the sentence with symbols.

I am tired and hungry and I want a burger or a nap.

- \(P=I\: am\: tired.\)
- \(Q=I\: am\: hungry.\)
- \(R=I \:want \:a\: burger.\)
- \(S=I\: want\: a\: nap.\)

**Solution**

The sentence could be rewritten with symbols as: \((P \wedge Q) \wedge (R \lor S)\)

Example \(\PageIndex{3}\)

Identify the atomic statements in the following compound sentence. Then, use logical connectives to rewrite the sentence with symbols.

For lunch you had a ham and cheese sandwich and an apple or an orange.

- \(A=You\: had\: a\: ham\: and\: cheese\: sandwich\: for\: lunch.\)
- \(B=You\: had\: an\: apple\: for\: lunch.\)
- \(C=You\: had\: an\: orange\: for\: lunch.\)

**Solution**

The sentence could be rewritten with symbols as: \(A \wedge (B \lor C)\).

Note that each statement \(A\),\(B\),\(C\) contains the words “you had” and “for lunch” and is a complete sentence.

Example \(\PageIndex{4}\)

Diagram the sentence from Guided Practice #1 using the logical connectives “\(\lor\) ” for “or” and “ \(\wedge\) ” for “and”.

**Solution**

The hardest part in diagramming the logical connectives is often determining which parts of the sentence should be grouped together. In this case there is a clear separation between the three positive outcomes and with the two negative outcomes:

\((M \wedge B \wedge D) \lor (W \wedge J)\)

Example \(\PageIndex{5}\)

Use a truth table to identify all cases when the statement in Guided Practice #1 is true or false.

**Solution**

Truth tables of complex sentences can be overwhelming, especially since 5 atomic statements means that there should be 25 rows in the truth table to account for all of the T/F combinations. To save time and space you can note that the statement \(M \wedge B \wedge D\) is only true when \(M\),\(B\), and \(D\) are all true and \(W \wedge J\) is only true when both \(W\) and \(J\) are true. This means that you now only need 4 rows in the truth table.

\(M \wedge B \wedge D\) | \(W \wedge J\) | (M \wedge B \wedge D) \lor (W \wedge J) |

T |
T |
T |

F |
T |
T |

T |
F |
T |

F |
F |
F |

The statement is true if:

- \(M\),\(B\), and \(D\) are all true.
- \(W\) and \(J\) are both true.
- \(M\),\(B\),\(D\),\(W\), and \(J\) are all true.

The statement is false if:

- Not all of \(M\),\(B\), and \(D\) are true and not both of \(W\) and \(J\) are true.

## Review

I go to school and do my work or stay home and play games.

1. Identify the atomic statements in the above compound sentence.

2. Use logical connectives to rewrite the sentence with symbols.

I have macaroni and cheese or steak and green beans or potatoes.

3. Identify the atomic statements in the above compound sentence.

4. Use logical connectives to rewrite the sentence with symbols.

I wear flip flops and either shorts and a t-shirt or a dress.

5. Identify the atomic statements in the above compound sentence.

6. Use logical connectives to rewrite the sentence with symbols.

It is dark outside and I light a candle.

7. Identify the atomic statements in the above compound sentence.

8. Use logical connectives to rewrite the sentence with symbols.

We will go to the beach and have a picnic or go to the movies and eat popcorn.

9. Identify the atomic statements in the above compound sentence.

10. Use logical connectives to rewrite the sentence with symbols.

Make a truth table for each of the following statements.

11. \((P \wedge Q) \lor R\)

12. \(P \wedge (Q \lor R)\)

13.\((P \lor Q) \lor R\)

14. \(P \lor (Q \lor R)\)

15. How does the placement of parentheses affect the truth values of compound statements?

## Vocabulary

Term | Definition |
---|---|

\(\wedge\) |
A conjunction is an "and" statement, which is a statement that combines two logical statements and is only true when both statements are true. The symbol for “and” is “\(\wedge\) ”. |

\(\lor\) |
A disjunction is an "or" statement, which is a statement that combines two logical statements and is only false when both statements are false. The symbol for “or” is “\(\lor\)”. |

atomic statement |
An atomic statement is a declarative statement without logical connectives that has a truth value. |

conjunction |
A conjunction is an "and" statement, which is a statement that combines two logical statements and is only true when both statements are true. The symbol for “and” is “\(\wedge\)”. |

disjunction |
A disjunction is an "or" statement that combines two logical statements, and is only false when both statements are false. The symbol for “or” is “\(\lor\)”. |

truth value |
The truth value of a statement is whether the statement is true or false. |

## Additional Resources

Interactive Element

Practice: And and Or Statements

Real World: Binary Logic