Skip to main content
Mathematics LibreTexts

3.2: Disjunctive Normal Form

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

    It is often desired (e.g. in computer programming or logic circuit design) to reverse the process: starting with a desired truth table, can we construct a Boolean polynomial with the same outputs?

    Example \(\PageIndex{1}\)

    Determine a Boolean polynomial \(p(x,y)\) that has the truth table below.

    \(x\) \(y\) \(p(x,y)\)
    \(1\) \(1\) \(1\)
    \(1\) \(0\) \(0\)
    \(0\) \(1\) \(0\)
    \(0\) \(0\) \(1\)

    Solution

    We want a “true” output when the inputs match the first or fourth rows, and only then. The inputs match the first row precisely when both \(x\) and \(y\) are true (i.e. when the conjunction \(x \land y\) is true), and they match the fourth row precisely when both \(x\) is not true and \(y\) is not true (i.e. when the conjunction \(x' \land y'\) is true). So take the disjunction of these two conjunctions: \(p(x,y) = (x \land y) \lor (x' \land y')\text{.}\)

    Remark \(\PageIndex{1}\)

    In the solution to the above worked example, it might seem like we should take a conjunction of the two conjunctions instead of a disjunction, since we see an output of \(1\) in the first row and in the fourth row. However, we cannot be in the input “state” described by those two rows simultaneously, since neither \(x\) nor \(y\) can be both \(1\) and \(0\) simultaneously. So you should think of it this way instead: if we see an output state of \(1\text{,}\) then we know we must be either in the input state of the first row or of the fourth row.

    Definition: Disjunctive Normal Form

    a Boolean polynomial in variables \(x_1,x_2,\ldots,x_n\) which is the disjunction of distinct terms of the form \(a_1 \land a_2 \land \cdots \land a_n\text{,}\) where each \(a_i\) is either \(x_i\) or \(x_i'\text{.}\)

    Convention \(\PageIndex{1}\)

    The zero polynomial is also considered to be in disjunctive normal form.

    Note \(\PageIndex{1}\)

    Disjunctive normal form is usually not the “nicest” or “simplest” Boolean polynomial with a desired truth table, but there is a relatively simple procedure to produce it.

    Procedure \(\PageIndex{1}\): To Produce the Disjunctive Normal Form Polynomial for a Given Boolean Truth Table

    Given a truth table with nonzero output, we may obtain a Boolean polynomial in disjunctive normal form with that truth table as follows.

    1. Identify rows the in truth table for which the desired output is \(1\)
    2. For each such row, form the conjunction of all variables, but negate those variables that have input value \(0\) for that row.
    3. Form a polynomial by taking the disjunction of all those conjunctions.

    Example \(\PageIndex{2}\)

    Determine a Boolean polynomial \(p(x,y,z)\) that has the truth table below.

    \(x\) \(y\) \(z\) \(p(x,y,z)\)
    \(1\) \(1\) \(1\) \(0\)
    \(1\) \(1\) \(0\) \(0\)
    \(1\) \(0\) \(1\) \(0\)
    \(1\) \(0\) \(0\) \(1\)
    \(0\) \(1\) \(1\) \(1\)
    \(0\) \(1\) \(0\) \(0\)
    \(0\) \(0\) \(1\) \(1\)
    \(0\) \(0\) \(0\) \(1\)

    Solution

    The fourth, fifth, seventh, and eigth rows have outcome \(1\text{.}\) The corresponding conjunctions are 

    fourth row

    \(x \land y' \land z'\text{;}\)

    fifth row

    \(x' \land y \land z\text{;}\)

    seventh row

        \(x' \land y' \land z\text{;}\) and

    eigth row

    \(x' \land y' \land z'\text{.}\)

    Therefore, the Boolean polynomial

    \begin{equation*} p(x,y,z) = (x \land y' \land z') \lor (x' \land y \land z) \lor (x' \land y' \land z) \lor (x' \land y' \land z') \end{equation*}

    is both in disjunctive normal form and will have the desired truth table.

    Example \(\PageIndex{3}\)

    Determine a Boolean polynomial \(q(x,y,z)\) that has the truth table below.

    \(x\) \(y\) \(z\) \(q(x,y,z)\)
    \(1\) \(1\) \(1\) \(1\)
    \(1\) \(1\) \(0\) \(1\)
    \(1\) \(0\) \(1\) \(0\)
    \(1\) \(0\) \(0\) \(1\)
    \(0\) \(1\) \(1\) \(1\)
    \(0\) \(1\) \(0\) \(1\)
    \(0\) \(0\) \(1\) \(1\)
    \(0\) \(0\) \(0\) \(1\)

    Solution 1

    Every row except the third has outcome \(1\text{,}\) so we must form conjunctions for all rows except that one:

    first row
        \(x \land y \land z\text{;}\)

    second row
        \(x \land y \land z'\text{;}\)

    fourth row
        \(x \land y' \land z'\text{;}\)

    fifth row
        \(x' \land y \land z\text{;}\)

    sixth row
        \(x' \land y \land z'\text{;}\)

    seventh row
        \(x' \land y' \land z\text{;}\) and

    eigth row
        \(x' \land y' \land z'\text{.}\)

    Therefore, the Boolean polynomial

    \begin{align*} q(x,y,z) & = (x \land y \land z) \lor (x \land y \land z') \lor (x \land y' \land z') \lor (x' \land y \land z)\\ & \phantom{=} \lor (x' \land y \land z') \lor (x' \land y' \land z) \lor (x' \land y' \land z') \end{align*}

    is both in disjunctive normal form and will have the desired truth table.

    Solution. 2 Alternative solution

    We can get a much simpler expression for \(q(x,y,z)\) by not using the procedure (though of course the result will not be in disjunctive normal form).

    Notice that we want the third row to have output value \(0\text{.}\) In logic terms, we want that combination (and only that combination) of input values to result in an output that is “not true”. So the Boolean polynomial

    \begin{equation*} q(x,y,z) = (x \land y' \land z)' = x' \lor y \lor z' \end{equation*}

    will produce the desired truth table.

    Note \(\PageIndex{2}\)

    The polynomials in the solutions to the preceding examples are in disjunctive normal form, but the alternative solution to the second example is not.

    Fact \(\PageIndex{1}\)

    From Procedure \(\PageIndex{1}\), it is easy to see that any Boolean polynomial can be expressed in disjunctive normal form.

    Example \(\PageIndex{4}\): Converting a Polynomial into Disjunctive Normal Form

    Rewrite the Boolean polynomial \(p(x,y,z) = (x \land z)' \lor (x'\land y)\) in disjunctive normal form.

    Solution

    First, produce the truth table.

    \(x\) \(y\) \(z\) \(x\land z\) \(x' \land y\) \(p(x,y,z)\)
    1 \(1\) \(1\) \(1\) \(0\) 0
    1 \(1\) \(0\) \(0\) \(0\) 1
    1 \(0\) \(1\) \(1\) \(0\) 0
    1 \(0\) \(0\) \(0\) \(0\) 1
    0 \(1\) \(1\) \(0\) \(1\) 1
    0 \(1\) \(0\) \(0\) \(1\) 1
    0 \(0\) \(1\) \(0\) \(0\) 1
    0 \(0\) \(0\) \(0\) \(0\) 1

    Then apply the disjunctive normal form procedure to obtain

    \begin{align*} p(x,y,z) =& (x \land y \land z') \lor (x \land y' \land z') \lor (x' \land y \land z)\\ & \lor (x' \land y \land z') \lor (x' \land y' \land z) \lor (x' \land y' \land z')\text{.} \end{align*}

    Check your understanding

    What do you think conjunctive normal form should mean? Can you come up with a procedure which takes a truth table and determines a Boolean polynomial in conjunctive normal form with the desired truth table?

    Hint

    Extend the idea of the Alternative solution for Worked Example \(\PageIndex{3}\)


    This page titled 3.2: Disjunctive Normal Form is shared under a GNU Free Documentation License 1.3 license and was authored, remixed, and/or curated by Jeremy Sylvestre via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.