Skip to main content
Statistics LibreTexts

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

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

    Learning Objectives
    • Construct a truth table for the negation of a statement
    • Construct a truth table for the conjunction and disjunction of statements
    • Determine if a statement is a tautology or contradiction

    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.)  If you get a couch that is a sectional but not a chaise (row 2), you have still satisfied your partner's wish.  Similarly, if you get a couch that is not a sectional but has a chaise (row 3), you have still satisfied your partner's wish.  The only time you have not met your partner's wish is when you pick a couch that is neither a sectional nor a chaise (row 4).

    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.  It is only true when both \(p\) and \(q\) are 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 are true.  It is only false when both \(p\) and \(q\) are false.

    \(\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.

    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}\)

    Try It \(\PageIndex{3}\)

    Is the statement "It is both raining and not raining" a tautology, contradiction or neither?

    Answer

    First, let \(p\) be the statement "it is raining." The symbolic form of the compound statement is \(p \ \wedge \sim p\). From the truth table below, we can see that the compound statement is always false, making the statement a contradiction.

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


    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) .