De Morgan's law exercises with answers
Ten negations to push inward until every NOT sits on a single variable: a negated AND, a negated OR, a three-operand chain, a negated implication, and nested cases with two levels. Write the result in negation normal form and compare it with the engine.
The two laws: NOT (X AND Y) is NOT X OR NOT Y, and NOT (X OR Y) is NOT X AND NOT Y. Each application flips the operator and negates the operands; with a chain of three it flips the whole chain at once. Double negation then removes NOT NOT. For an implication, first rewrite X -> Y as NOT X OR Y, so that NOT (X -> Y) becomes X AND NOT Y: the only way an implication fails is antecedent TRUE, consequent FALSE.
The simplifier's step list shows De Morgan only where the rewrite makes the expression shorter, typically when double negations disappear afterwards; NOT (A AND B) stays as it is because NOT A OR NOT B is longer. So some problems show the laws on the page and some show no law applied; the solutions say which, and the truth table confirms the answer either way, since the result must be TRUE on exactly the rows where the original is.
1. Push the negation inward in NOT (A AND B). NOT (A AND B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT (A AND B) Classification: contingent
De Morgan over AND: NOT A OR NOT B. The step list shows no law applied, because this form is longer than the original; the table is FALSE only on A = TRUE, B = TRUE, as a NAND should be.
2. Push the negation inward in NOT (A OR B). NOT (A OR B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | TRUE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | FALSE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT (A OR B) Classification: contingent
De Morgan over OR: NOT A AND NOT B, neither one nor the other, TRUE on A = FALSE, B = FALSE only.
3. Push the negation inward in NOT (A AND B AND C). NOT (A AND B AND C)
| # | A | B | C | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | TRUE | TRUE | TRUE |
| 4 | TRUE | FALSE | FALSE | TRUE |
| 5 | TRUE | FALSE | TRUE | TRUE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT (A AND B AND C) Classification: contingent
The law applies to the whole chain at once: NOT A OR NOT B OR NOT C. FALSE only on the all-TRUE row.
4. Push the negation inward in NOT (NOT A OR B). NOT (NOT A OR B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
NOT (NOT A OR B)- De Morgan's law ·
NOT (A OR B) = NOT A AND NOT BNOT (NOT A OR B)→NOT NOT A AND NOT BResult:NOT NOT A AND NOT B - Double negation ·
NOT NOT A = ANOT NOT A→AResult:A AND NOT B
Classification: contingent
De Morgan gives NOT NOT A AND NOT B, and double negation gives A AND NOT B. The page shows both laws, since the result is shorter.
5. Push the negation inward in NOT (A -> B). NOT (A -> B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | FALSE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT (A -> B) Classification: contingent
Implication elimination first, NOT (NOT A OR B), then the previous problem: A AND NOT B. The negation of an implication is its one failing row, A = TRUE, B = FALSE; it is not NOT A -> NOT B.
6. Push the negation inward in NOT ((A OR B) AND C). NOT ((A OR B) AND C)
| # | A | B | C | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | TRUE | TRUE | FALSE |
| 4 | TRUE | FALSE | FALSE | TRUE |
| 5 | TRUE | FALSE | TRUE | FALSE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT ((A OR B) AND C) Classification: contingent
Outer law first: NOT (A OR B) OR NOT C; inner law next: (NOT A AND NOT B) OR NOT C. Every NOT now sits on a variable.
7. Push the negation inward in NOT ((A AND B) OR (C AND D)). NOT ((A AND B) OR (C AND D))
| # | A | B | C | D | f |
|---|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | FALSE | TRUE | TRUE | FALSE |
| 4 | FALSE | TRUE | FALSE | FALSE | TRUE |
| 5 | FALSE | TRUE | FALSE | TRUE | TRUE |
| 6 | FALSE | TRUE | TRUE | FALSE | TRUE |
| 7 | FALSE | TRUE | TRUE | TRUE | FALSE |
| 8 | TRUE | FALSE | FALSE | FALSE | TRUE |
| 9 | TRUE | FALSE | FALSE | TRUE | TRUE |
| 10 | TRUE | FALSE | TRUE | FALSE | TRUE |
| 11 | TRUE | FALSE | TRUE | TRUE | FALSE |
| 12 | TRUE | TRUE | FALSE | FALSE | FALSE |
| 13 | TRUE | TRUE | FALSE | TRUE | FALSE |
| 14 | TRUE | TRUE | TRUE | FALSE | FALSE |
| 15 | TRUE | TRUE | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT ((A AND B) OR (C AND D)) Classification: contingent
The outer OR becomes an AND of two negated ANDs, and each of those becomes an OR: (NOT A OR NOT B) AND (NOT C OR NOT D). TRUE unless A, B are both TRUE or C, D are both TRUE.
8. Push the negation inward in NOT (A AND NOT (B OR C)). NOT (A AND NOT (B OR C))
| # | A | B | C | f |
|---|---|---|---|---|
| 0 | FALSE | FALSE | FALSE | TRUE |
| 1 | FALSE | FALSE | TRUE | TRUE |
| 2 | FALSE | TRUE | FALSE | TRUE |
| 3 | FALSE | TRUE | TRUE | TRUE |
| 4 | TRUE | FALSE | FALSE | FALSE |
| 5 | TRUE | FALSE | TRUE | TRUE |
| 6 | TRUE | TRUE | FALSE | TRUE |
| 7 | TRUE | TRUE | TRUE | TRUE |
NOT (A AND NOT (B OR C))- De Morgan's law ·
NOT (A AND B) = NOT A OR NOT BNOT (A AND NOT (B OR C))→NOT A OR NOT NOT (B OR C)Result:NOT A OR NOT NOT (B OR C) - Double negation ·
NOT NOT A = ANOT NOT (B OR C)→B OR CResult:NOT A OR (B OR C) - Associativity ·
(A OR B) OR C = A OR B OR CNOT A OR (B OR C)→NOT A OR B OR CResult:NOT A OR B OR C
Classification: contingent
De Morgan over the AND: NOT A OR NOT NOT (B OR C); double negation: NOT A OR (B OR C); associativity flattens it to NOT A OR B OR C. The page shows all three steps.
9. Push the negation inward in NOT (NOT A AND NOT B). NOT (NOT A AND NOT B)
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | TRUE |
NOT (NOT A AND NOT B)- De Morgan's law ·
NOT A AND NOT B = NOT (A OR B)NOT A AND NOT B→NOT (A OR B)Result:NOT NOT (A OR B) - Double negation ·
NOT NOT A = ANOT NOT (A OR B)→A OR BResult:A OR B
Classification: contingent
De Morgan and double negation: A OR B. This is the second law read backwards, and the engine shows both steps.
10. Push the negation inward in NOT ((A -> B) AND (B -> A)). NOT ((A -> B) AND (B -> A))
| # | A | B | f |
|---|---|---|---|
| 0 | FALSE | FALSE | FALSE |
| 1 | FALSE | TRUE | TRUE |
| 2 | TRUE | FALSE | TRUE |
| 3 | TRUE | TRUE | FALSE |
The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.
NOT ((A -> B) AND (B -> A)) Classification: contingent
De Morgan over the AND: NOT (A -> B) OR NOT (B -> A); each negated implication is its failing row: (A AND NOT B) OR (B AND NOT A). That is A XOR B, the negation of the biconditional.
Questions
What is the classic slip here?
Distributing the NOT without flipping the operator, writing NOT A AND NOT B for NOT (A AND B). They differ on A = TRUE, B = FALSE: the first is FALSE there and the second is TRUE. Check one such row whenever you push a negation through.
Related
Worked examples
- De Morgan in practice: NOT (A AND B) rewritten and verified
- De Morgan in code: !(a && b) refactored to !a || !b, verified
Glossary
See also
- Lesson 6: De Morgan’s laws (intermediate, 12 min)
- De Morgan's laws: NOT (A AND B) = NOT A OR NOT B, with proof and examples
- NOT (A AND B) = NOT A OR NOT B, not NOT A AND NOT B
- “Neither A nor B” is NOT A AND NOT B
- The De Morgan slip: NOT (A AND B) vs NOT A AND NOT B
Practice
Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.