Skip to main content
Engineering LibreTexts

1.1.4: Logical equivalence

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

    Suppose we want to verify that, in fact, (pq)∧r and p∧(qr) do always have the same value. To do so, we have to consider all possible combinations of values of p, q, and r, and check that for all such combinations, the two compound expressions do indeed have the same value. It is convenient to organize this computation into a truth table. At ruth table is a table that shows the value of one or more compound propositions for each possible combination of values of the propositional variables that they contain. We call each such combination a situation. Figure 2.1 is a truth table that compares the value of (p q) ∧ r to the value of p ∧ (q r) for all possible values of p, q, and r. There are eight rows in the table because there are exactly eight different ways in which truth

    屏幕快照 2019-06-23 23.46.11.png

    Figure 2.1: A truth table that demonstrates the logical equivalence of (p ∧ q) ∧ r and p ∧ (q ∧ r). The fact that the last two columns of this table are identical shows that these two expressions have the same value for all eight possible combinations of values of p, q, and r.

    values can be assigned to p, q, and r. In this table, we see that the last two columns, representing the values of (p q) ∧ r and p ∧ (q r), are identical.

    We discuss the creation of truth tables for statements written in propositional logic in more detail in one of the pencasts of this course: SOZqDm0bDuc. We also discuss using truth tables to test for equivalence in another pencast

    You can write the rows in a truth table in any order you like. I suggest you write them in a sorted order, as in Table 2.1. This helps you to be systematic in writing out the table.

    More generally, we say that two compound propositions are logically equivalent if they always have the same value, no matter what truth values are assigned to the pro- positional variables that they contain. If the number of propositional variables is small, it is easy to use a truth table to check whether or not two propositions are logically equivalent.

    When writing a piece of code you will often have your code make decisions. For instance in a bit of Java code—such as in your Object-Oriented Program- ming course—you might encounter an if-statement to check if the user has inputted the right type of data. Since the input you expect can be rather difficult, the if-statement is a complex combination of many simple checked chained together by &&’s and ||’s. After taking a look at the code, you be- lieve it can be simplified to a much smaller expression. Using a truth table you can prove that your simplified version is equivalent to the original.

    This page titled 1.1.4: Logical equivalence is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Stefan Hugtenburg & Neil Yorke-Smith (TU Delft Open) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.