Skip to main content
Mathematics LibreTexts

5.2: Truth Tables- Conjunction (and), Disjunction (or), Negation (not)

  • Page ID
    113158
  • \( \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}}\)

    Learning Objectives
    • Construct a truth table for the negation of a statement
    • Construct a truth table for the conjunction and disjunction of statements

    Because compound statements can get tricky to think about, we can create a truth table to keep track of what truth values for the simple statements make the compound statement true and false.

    Truth Table

    A truth table is a table showing what the resulting truth value of a compound statement is for all the possible truth values for the simple statements.

    Example \(\PageIndex{1}\)

    Suppose you’re picking out a new couch, and your significant other says “get a sectional or something with a chaise”.

    This is a compound statement made of two simpler conditions: “is a sectional”, and “has a chaise”. For simplicity, let’s use \(p\) to designate “is a sectional”, and \(q\) to designate “has a chaise”.

    A truth table for this situation would look like this:

    \(\begin{array}{|c|c|c|}
    \hline p & q & p \text { or } q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} \\ \hline
    \end{array}\)

    In the table, T is used for true, and F for false. In the first row, if \(p\) is true and \(q\) is also true, then the compound statement “\(p\) or \(q\)” is true. This would be a sectional that also has a chaise, which meets our desire. (Remember that or in logic is not exclusive; if the couch has both features, it meets the condition.)

    In the previous example about the couch, the truth table was really just summarizing what we already know about how the or statement works. The truth tables for the basic and, or, and not statements are shown below.

    Basic Truth Tables

    Negation - Expresses "not" which means the opposite truth value.

    \(\begin{array}{|c|c|}
    \hline p & \sim p \\
    \hline \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} \\
    \hline
    \end{array}\)

    Conjunction - Expresses "and" which means both \(p\) and \(q\) must be true.

    \(\begin{array}{|c|c|c|}
    \hline p & q & p \wedge q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline
    \end{array}\)

    Disjunction - Expresses "or" which means either \(p\) or \(q\) can be true or both.

    \(\begin{array}{|c|c|c|}
    \hline p & q & p \vee q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline
    \end{array}\)

    Truth tables have different numbers of rows, depending on how many variables (or simple statements) that we have. When there is only one simple statement (such as our truth table for negation), we have two rows, one for true and another for false. When we have two simple statements, \(p\) and \(q\), there are four rows in the truth table. For three simple statements, \(p\), \(q\) and \(r\), there are eight rows in the truth table. So for each new simple statement, the number of rows doubles. This pattern continues, so we can generalize it as follows.

    Definition: The Number of Lines in a Truth Table

    A statement with \(k\) variables - or simple statements - will have a truth table with \(2^k\) rows.

    Note

    To construct the \(2^k\) rows of a truth table, start by keeping the first column at T for half of the \(2^k\) rows and at F for the second half of the rows. Now consider the the first half of the rows where the first column is fixed a T. The second column and beyond make their own smaller table with \(2^(k-1)\) rows. Now repeat the process for these (2^(k-1)\) rows and the second column, first half T, second half F. Continuing this pattern, the last column should end up alternating T and F.

    Truth tables really become useful when we analyze more complex compound statements.

    Example \(\PageIndex{2}\)

    Create a truth table for the statement \(p \ \vee \sim q\).

    Solution

    When we create the truth table, we need to list all the possible truth value combinations for \(p\) and \(q\). Notice how the first column contains 2 Ts followed by 2 Fs, and the second column alternates T, F, T, F. This pattern ensures that all 4 combinations are considered.

    \(\begin{array}{|c|c|}
    \hline p & q \\
    \hline \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} \\
    \hline
    \end{array}\)

    After creating columns with those initial values, we create a third column for the expression \(\sim q\). Now we will temporarily ignore the column for \(p\) and write the truth values for \(\sim q\).

    \(\begin{array}{|c|c|c|}
    \hline p & q & \sim q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} \\
    \hline
    \end{array}\)

    Next we can find the truth values of \(p \ \vee \sim q,\) using the first and third columns.

    \(\begin{array}{|c|c|c|c|}
    \hline p & q & \sim q & p \ \vee \sim q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline
    \end{array}\)

    The truth table shows that \(p \ \vee \sim q\) is true in three cases and false in one case. If you're wondering what the point of this is, suppose it is the last day of the baseball season and two teams, who are not playing each other, are competing for the final playoff spot. Anaheim will make the playoffs if it wins its game or if Boston does not win its game. (Anaheim owns the tie-breaker; if both teams win, or if both teams lose, then Anaheim gets the playoff spot.) If \(p=\) Anaheim wins its game and \(q=\) Boston wins its game, then \(p \ \vee \sim q\) represents the situation "Anaheim wins its game or Boston does not win its game". The truth table shows us the different scenarios related to Anaheim making the playoffs. In the first row, Anaheim wins its game and Boston wins its game, so it is true that Anaheim makes the playoffs. In the second row, Anaheim wins and Boston does not win, so it is true that Anaheim makes the playoffs. In the third row, Anaheim does not win its game and Boston wins its game, so it is false that Anaheim makes the playoffs. In the fourth row, Anaheim does not win and Boston does not win, so it is true that Anaheim makes the playoffs.

    Try It \(\PageIndex{1}\)

    Create a truth table for this statement: \(\sim p \wedge q\)

    Answer

    \(\begin{array}{|c|c|c|c|}
    \hline p & q & \sim p & \sim p \wedge q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline
    \end{array}\)

    Example \(\PageIndex{3}\)

    Create a truth table for the statement \(p \ \wedge \sim(q \vee r)\).

    Solution

    It helps to work from the inside out when creating a truth table, and to create columns in the table for intermediate operations. We start by listing all the possible truth value combinations for \(p, q,\) and \(r .\) Notice how the first column contains 4 Ts followed by 4 Fs, the second column contains 2 Ts, 2 Fs, then repeats, and the last column alternates T, F, T, F, ... This pattern ensures that all 8 combinations are considered. After creating columns with those initial values, we create a fourth column for the innermost expression, \(q \vee r .\) Now we will temporarily ignore the column for \(p\) and focus on \(q\) and \(r\), writing the truth values for \(q \vee r\).

    \(\begin{array}{|c|c|c|}
    \hline p & q & r \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline
    \end{array}\)

    \(\begin{array}{|c|c|c|c|}
    \hline p & q & r & q \vee r \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline
    \end{array}\)

    Next we can find the negation of \(q \vee r\), working off the \(q \vee r\) column we just created. (Ignore the first three columns and simply negate the values in the \(q \vee r\) column.)

    \(\begin{array}{|c|c|c|c|c|}
    \hline p & q & r & q \vee r & \sim(q \vee r) \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{F} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{T} \\
    \hline
    \end{array}\)

    Finally, we find the values of \(p\) and \(\sim(q \vee r)\). (Ignore the second, third, and fourth columns.)

    \(\begin{array}{|c|c|c|c|c|c|}
    \hline p & q & r & q \vee r & \sim (q \vee r) & p \ \wedge \sim (q \vee r \text { ) } \\
    \hline \text { T } & \text { T } & \text { T } & \text { T } & \text { F } & \text { F } \\
    \hline \text { T } & \text { T } & \text { F } & \text { T } & \text { F } & \text { F } \\
    \hline \text { T } & \text { F } & \text { T } & \text { T } & \text { F } & \text { F } \\
    \hline \text { T } & \text { F } & \text { F } & \text { F } & \text { T } & \text { T } \\
    \hline \text { F } & \text { T } & \text { T } & \text { T } & \text { F } & \text { F } \\
    \hline \text { F } & \text { T } & \text { F } & \text { T } & \text { F } & \text { F } \\
    \hline \text { F } & \text { F } & \text { T } & \text { T } & \text { F } & \text { F } \\
    \hline \text { F } & \text { F } & \text { F } & \text { F } & \text { T } & \text { F } \\
    \hline
    \end{array}\)

    It turns out that this complex expression is true in only one case: when \(p\) is true, \(q\) is false, and \(r\) is false. To illustrate this situation, suppose that Anaheim will make the playoffs if: (1) Anaheim wins, and (2) neither Boston nor Cleveland wins. TFF is the only scenario in which Anaheim will make the playoffs.

    Try It \(\PageIndex{2}\)

    Create a truth table for this statement: \((\sim p \wedge q) \ \vee \sim q\)

    Answer

    \(\begin{array}{|c|c|c|c|c|c|}
    \hline p & q & \sim p & \sim p \wedge q & \sim q & (\sim p \wedge q) \ \vee \sim q \\
    \hline \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{F} \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} & \mathrm{T} & \mathrm{F} & \mathrm{T} \\
    \hline \mathrm{F} & \mathrm{F} & \mathrm{T} & \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline
    \end{array}\)

    Tautology and Contradiction

    A tautology is a compound statement that is true for all possible truth values of its variables.

    A contradiction is a compound statement that is false for all possible truth values of its variables.

    Example \(\PageIndex{4}\)

    The compound statement "Either it is raining or it is not raining" is a tautology. This can be demonstrated with a truth table. First, let \(p\) be the statement "it is raining." The symbolic form of the compound statement is \(p \ \vee \sim p\). From the truth table below, we can see that the compound statement is always true.

    \(\begin{array}{|c|c|c|}
    \hline p & \sim p & p \ \vee \sim p \\
    \hline \mathrm{T} & \mathrm{F} & \mathrm{T}\\
    \hline \mathrm{F} & \mathrm{T} & \mathrm{T} \\
    \hline
    \end{array}\)

    Similarly, it can be shown that the compound statement "It is both raining and not raining" is a contradiction.

    Logically Equivalent

    Two statements are logically equivalent if they have the same simple statements and when their truth tables are computed, the final columns in the tables are identical. The symbol for equivalent statements is \(\equiv\).

    DeMorgan's Laws

    The negation of a conjunction is logically equivalent to the disjunction of the negation of the statements making up the conjunction. To negate an “and” statement, negate each part and change the “and” to “or”.

    \(\sim(p \wedge q) \ \equiv \ \sim p \ \vee \sim q\)

    The negation of a disjunction is logically equivalent to the conjunction of the negation of the statements making up the disjunction. To negate an “or” statement, negate each part and change the “or” to “and”.

    \(\sim(p \vee q) \ \equiv\ \sim p \ \wedge \sim q\)

    Example \(\PageIndex{5}\)

    For Valentine’s Day, you did not get your sweetie flowers or candy: Which of the following statements is logically equivalent?

    1. You did not get them flowers or did not get them candy.
    2. You did not get them flowers and did not get them candy.
    3. You got them flowers or got them candy.
    Solution

    Let \(f\) be the statement "You got your sweetie flowers" and let \(c\) be the statement "You got your sweetie candy." The compound statement "You did not get your sweetie flowers or candy" can be written symbolically as \(\sim(f \vee c)\). By DeMorgan's Laws,

    \(\sim(f \vee c) \ \equiv \ \sim f \ \wedge \sim c\)

    This is answer b, you did not get your sweetie flowers and you did not get your sweetie candy.

    Try It \(\PageIndex{3}\)

    To serve as the President of the US, a person must have been born in the US, must be at least 35 years old, and must have lived in the US for at least 14 years. What minimum set of conditions would disqualify someone from serving as President?

    Answer

    Failing to meet just one of the three conditions is all it takes to be disqualified since the compound statement is made up of conjunctions. A person is disqualified if they were not born in the US, or are not at least 35 years old, or have not lived in the US for at least 14 years. The key word here is “or” instead of “and”.


    This page titled 5.2: Truth Tables- Conjunction (and), Disjunction (or), Negation (not) is shared under a CC BY-SA license and was authored, remixed, and/or curated by David Lippman (The OpenTextBookStore) .