DNF is read off the true rows
For each row where the formula is true, write the conjunction that describes that row; join them with ∨. The result is equivalent by construction.
Disjunctive and conjunctive normal form give every formula a canonical shape, readable straight off its truth table. The same algebra runs digital circuits, which is why ∧, ∨ and ¬ are AND, OR and NOT gates.
Core ideas
A normal form is a standard shape. Its value is that any formula can be put into it, so two formulas can be compared structurally.
For each row where the formula is true, write the conjunction that describes that row; join them with ∨. The result is equivalent by construction.
For each false row, write a disjunction ruling that row out; join them with ∧. This is the form SAT solvers consume.
{∧, ∨, ¬} can express every truth function. So can {∧, ¬} alone, and remarkably so can NAND by itself.
The material
How to produce each from a truth table, and why it always works.
A literal is a variable or its negation (p, ¬q). A clause is a disjunction of literals; a term is a conjunction of literals.
A formula is in DNF when it is a disjunction of terms — an OR of ANDs of literals.
A formula is in CNF when it is a conjunction of clauses — an AND of ORs of literals.
Given any truth table, an equivalent DNF and an equivalent CNF can be written down directly from it.
For DNF: take each row where the formula is true, and write the conjunction of literals that is true in exactly that row — p if p is T there, ¬p if it is F. Each such term is true in one row and false in every other. Their disjunction is therefore true in exactly the rows where the original is true.
For CNF, do the same with the false rows and take the complementary clause for each: the clause is false in exactly that row and true everywhere else, so the conjunction is false in exactly the rows where the original is false.
If the formula has no true rows it is a contradiction and its DNF is empty, conventionally F; if it has no false rows its CNF is T.
□
Suppose a formula in p, q is true exactly in rows TF and FT. Its DNF is (p ∧ ¬q) ∨ (¬p ∧ q), which is exactly p ⊕ q — and this is how any truth function whatever gets a formula.
A set of connectives is functionally complete if every truth function can be expressed using only those connectives.
{∧, ∨, ¬} is functionally complete, by the theorem above. {∧, ¬} is too, because De Morgan gives p ∨ q ≡ ¬(¬p ∧ ¬q); symmetrically so is {∨, ¬}. What is striking is that a single connective can suffice: NAND, written p ↑ q ≡ ¬(p ∧ q), expresses negation as p ↑ p and conjunction as (p ↑ q) ↑ (p ↑ q).
Replace T with 1, F with 0, ∧ with AND, ∨ with OR and ¬ with NOT, and every law of “Logical Equivalence” becomes a fact about digital circuits. A formula in DNF is a two-level circuit: a layer of AND gates feeding one OR gate. That correspondence is why NAND being functionally complete matters commercially — a chip can be built from one kind of gate.
The two-level DNF circuit is fast and often enormous. Minimising it — finding the smallest equivalent formula — is its own hard problem, and is what Karnaugh maps and the Quine–McCluskey algorithm address.
Interactive
Every assignment, evaluated
Method
From a formula, either go through the table or push negations inward.
The table route always works and needs no cleverness. Its cost is 2ⁿ rows, and its output may be far from minimal.
One term per true row, each literal positive where the variable is T and negated where it is F. Join with ∨.
One clause per false row, each literal negated relative to the row. Join with ∧. Getting this polarity backwards is the standard slip.
Eliminate → and ↔, push negations in with De Morgan until they sit on variables, then distribute. This can be much shorter, and can also blow up.
The algebraic route, since the table would be eight rows.
Spot-checking a single row does not prove the equivalence — the chain of named laws does that. The check is there to catch a slip in the chain, which is a different job and worth doing every time.
Take (p ⊕ q) ∧ r, build the table, and produce the canonical DNF and CNF. Check the term count against the number of true and false rows — they must match exactly.
Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.
No recommendations yet for this lesson.