Exercises — De Morgan's theorems
Before we start, one reminder of the only two facts we will use over and over — the two theorems from the parent note. A bar (the horizontal line, e.g. ) means "NOT": it flips a to a and a to a . A dot () means AND (output only when both inputs are ). A plus () means OR (output when at least one input is ).
Level 1 — Recognition
Here we only recognise which theorem applies and read a bar's scope. No heavy algebra yet.
Exercise 1.1
State the result of .
Recall Solution 1.1
The long bar sits over an AND. Break the bar, change the sign: the AND becomes OR and each variable gets its own bar.
Exercise 1.2
State the result of .
Recall Solution 1.2
The long bar sits over an OR. Break it: OR becomes AND, each variable negated.
Exercise 1.3
Which of the two theorems is being used in ?
Recall Solution 1.3
The bar covers a sum (, an OR), and it turned into a product (AND). That is Theorem 2 (break the OR). Renaming , changes nothing — the theorem holds for any variables.
Exercise 1.4
True or false: means the same as .
Recall Solution 1.4
False. Look at the length of the bar. In there are two short bars — each variable is negated first, then ANDed. In there is one long bar covering the whole AND. Different scope → different meaning. Concretely, (an OR), which is not .
Level 2 — Application
Now we apply the recipe once or twice, including double-negation (: negating twice returns the original).
Exercise 2.1
Simplify .
Recall Solution 2.1
Step 1 — WHAT: the outer bar sits over an AND, so apply Theorem 1. WHY: the top-level operator under the long bar is . Break it: Step 2 — WHAT: simplify . WHY: double negation cancels.
Exercise 2.2
Simplify .
Recall Solution 2.2
Step 1: top-level operator under the bar is OR → Theorem 2: Step 2: double negation :
Exercise 2.3
Express the NAND function using an OR gate and NOT gates only.
Recall Solution 2.3
Theorem 1 gives . In words: invert each input, then OR them. So a NAND gate = two NOT gates feeding an OR gate. This is the bubble-pushing view: a NAND drawn as an OR with bubbles on its inputs. See the figure — the bubble on the AND's output "slides" onto the OR's inputs.

Exercise 2.4
Negate (three-variable OR).
Recall Solution 2.4
Generalised Theorem 2: break the OR into an AND, negate each term.
Level 3 — Analysis
Here we handle nested bars, mixed operators, and verify by truth table.
Exercise 3.1
Simplify .
Recall Solution 3.1
Step 1 — WHAT: the top-level operator under the long bar is the (AND binds tighter than OR, so the expression is ). Apply Theorem 2. WHY: we always break the outermost operator first. Step 2 — WHAT: the leftover long bar is over an AND → Theorem 1. Result: .
Exercise 3.2
Simplify .
Recall Solution 3.2
Step 1: outer bar over an AND → Theorem 1: Step 2: each piece is a bar over an OR → Theorem 2 on both: Step 3: double negation (, ): This is the XOR function — output exactly when and differ.
Exercise 3.3
Verify by building the full truth table, and confirm the two columns match on all four rows.
Recall Solution 3.3
Two Boolean expressions are equal iff they give the same output on every input row.
| 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 | 0 |
The two bold columns are identical on all rows → the theorem holds. ∎
Exercise 3.4
A student claims . Find the input row that disproves it.
Recall Solution 3.4
The student negated only the first term and forgot to flip the operator. Test :
- True LHS: .
- Wrong RHS: .
→ the claim is false. (The correct answer is , which at gives , matching the LHS.)
Level 4 — Synthesis
Now we combine De Morgan with other laws to fully simplify or convert expressions.
Exercise 4.1
Negate the sum-of-products and simplify.
Recall Solution 4.1
Step 1: top-level operator is → Theorem 2: Step 2: ; and (Theorem 1):
Exercise 4.2
Convert (a 3-input AND) into NAND-only form.
Recall Solution 4.2
Idea: a NAND gives of an AND, so double-negate to recover the AND. Step 1 — double negation (put two bars on, which changes nothing): Step 2: the inner bar is exactly a 3-input NAND. The outer bar is a NOT, and a NOT built from a NAND is a NAND with its two inputs tied together (since ). So: feed into one 3-input NAND, then feed its output into a second NAND used as an inverter. See NAND and NOR Universal Gates. This is exactly why NAND is universal — De Morgan lets us rebuild any AND/OR/NOT from it.
Exercise 4.3
Simplify .
Recall Solution 4.3
First term: — bar over an AND → Theorem 1: Second term: — bar over an OR → Theorem 2: Combine: . By the absorption law (Boolean Algebra Laws), already covers (whenever , both and are , so too). Therefore:
Exercise 4.4
Show that a NOR gate () equals an AND gate fed by two inverted inputs.
Recall Solution 4.4
Theorem 2 directly: — "invert both inputs, then AND." So a NOR = two NOT gates feeding an AND gate. This is the mirror of Exercise 2.3 and again a Bubble Pushing move: push the output bubble of the OR back onto its inputs, and the OR becomes an AND.
Level 5 — Mastery
Full multi-step problems with mixed laws and general- reasoning.
Exercise 5.1
Fully simplify .
Recall Solution 5.1
Step 1: outer bar over an AND → Theorem 1: Step 2: double negation on both pieces: Result: .
Exercise 5.2
Negate and express the answer as a sum of products.
Recall Solution 5.2
Step 1: top-level operator under the bar is AND → Theorem 1: Step 2: each piece is a bar over an OR → Theorem 2 twice: Already a sum of products. Result: .
Exercise 5.3
Prove the generalised Theorem 1 for three variables, , by applying the two-variable theorem twice (associativity, not a new truth table).
Recall Solution 5.3
Step 1: group the AND: . Treat as one block . Apply two-variable Theorem 1: Step 2: now is again a bar over an AND → Theorem 1 once more: ∎ The same nesting extends to variables: each application peels one more variable.
Exercise 5.4
The exclusive-OR is . Find its complement (the XNOR) using De Morgan, and simplify.
Recall Solution 5.4
Step 1: ; top-level operator is → Theorem 2: Step 2: break each inner AND with Theorem 1 (and double-negate): Step 3: multiply out : Now and (a variable AND its own complement is always ): Result: — this is exactly XNOR (" when and are equal"), as expected. See Karnaugh Maps if you want to visualise this grouping.
Wrap-up recall
Recall One-line answers to the whole page
- Theorem 1 :::
- Theorem 2 :::
- Peel which operator first? ::: the outermost one under the bar
- equals ::: (XNOR)
- equals :::
Connections
- De Morgan's theorems — the parent note these exercises drill.
- Boolean Algebra Laws — absorption & complement laws used in L4–L5.
- Complement of a Function — De Morgan is the general complement recipe.
- NAND and NOR Universal Gates — L4.2 and L4.4 build gates from De Morgan.
- Bubble Pushing — graphical version used in Ex 2.3 and 4.4.
- Logic Gates - AND OR NOT — the physical gates behind every symbol.
- Karnaugh Maps — visual grouping to justify simplifications.