Logical Equivalence and De Morgan's Laws
Two statements are equivalent when they agree in every possible case, so you can swap one for the other whenever it's convenient. De Morgan's laws tell you how to push a "not" inside: it flips "and" to "or" and back, so "not both" means "at least one fails."
What the symbols mean
- Not both
It isn't the case that p and q are both true.
- At least one fails
p is false or q is false (or both).
- Neither
It isn't the case that at least one is true.
- Both fail
p is false and q is false.
Explanation
Two statements are logically equivalent when they simply say the same thing in different words: in every possible situation, they're both true or both false. "Equivalent" literally means "equal in value," and here the value is true or false. That's useful because you can always trade one for the other, to simplify a condition or to find the right way to negate it. De Morgan's laws, named after the 19th-century logician Augustus De Morgan, look intimidating, but each is a small, familiar idea: (it's not true that both happened) is the same as (at least one didn't happen), and (neither happened) is the same as (both didn't happen). You already use these every day without noticing. The symbols just make them exact.
You've already met one equivalence: and its contrapositive have identical truth tables. That's the definition. Two statements are logically equivalent, written , when they agree in every row. And just like and in algebra, equivalent statements can replace each other anywhere, which is how you simplify a messy condition. These are the ones you'll use most:
- Double negation: .
- Commutative and associative: , and the same for .
- Distributive: , and with and swapped.
- De Morgan: negation flips to and back.
- Implication: .
Why does De Morgan work? Think about what it takes for " and " to fail. You don't need both to be false; one failure is enough. So "not ( and )" means " fails or fails." In the same way, " or " fails only when neither one happens, so "not ( or )" means " fails and fails."
A tautology is true in every row (like ) and a contradiction is false in every row (like ). This gives a neat test: two statements are equivalent exactly when their biconditional is a tautology, since "they always agree" is what being always true means.
A common mistake. When negating "the server is up and the disk is full," it's tempting to just negate each part and keep the "and": "the server is down and the disk is not full." That's too strong. It describes only one of the ways the original can fail. The correct negation flips the connective too: "the server is down or the disk is not full."
See it
Worked examples
Simplify .
- 1
De Morgan doesn't apply to an arrow directly, so first rewrite the implication as an "or": .
Practice
Type your answer and check it. Solve them all to complete the lesson.
Which statement is equivalent to ?
The negation of "the server is up and the disk is full" is:
Is a tautology, a contradiction or neither?
To check that two statements in 3 variables are equivalent, how many rows of the truth table must agree?
An access check denies a request when . Which condition means the same thing?
Which statement is equivalent to ?
The hardest one here. Get it, and you've got this lesson.
Simplify as far as possible.
Where it's used
Compilers simplify conditions with these laws, and chip designers use De Morgan's laws to build any circuit out of a single gate type (NAND or NOR).