Logical Equivalence and Conditionals
Prove statements equivalent with truth tables and laws such as De Morgan's, and keep the converse, inverse and contrapositive of a conditional straight.
Welcome back!
Step 1 of 12Learn
Same truth table, same meaning
Two compound statements are logically equivalent, written P ≡ Q, if they have the same truth value in every row of the truth table. Equivalent statements say the same thing in different words, so you can swap one for the other anywhere: in a proof, a circuit or a line of code.
Example. Compare p → q with ¬p ∨ q:
| p | q | p → q | ¬p | ¬p ∨ q |
|---|---|---|---|---|
| T | T | T | F | T |
| T | F | F | F | F |
| F | T | T | T | T |
| F | F | T | T | T |
The columns match, so p → q ≡ ¬p ∨ q. "If it's a weekday, I set an alarm" means the same as "It's not a weekday, or I set an alarm." This equivalence lets you rewrite any conditional using only ¬ and ∨.
Two other special kinds of statement:
- A tautology is true in every row. Example: p ∨ ¬p, "either it's raining or it isn't."
- A contradiction is false in every row. Example: p ∧ ¬p.
- Everything else is a contingency: true in some rows, false in others.
P and Q are equivalent exactly when P ↔ Q is a tautology. That's how automated tools, such as the ones that verify computer chips, check that two circuit designs do the same job: they test whether the biconditional of the two designs can ever be false.
Step 2 of 12Practice · Sort into groups
Classify each statement.
Tap an item, then tap its group (or drag it there).
Step 3 of 12Learn
De Morgan's laws and other rules
Like ordinary algebra, logic has laws for simplifying expressions. The most useful are De Morgan's laws:
- ¬(p ∧ q) ≡ ¬p ∨ ¬q
- ¬(p ∨ q) ≡ ¬p ∧ ¬q
In words: to negate an "and," negate each part and switch to "or" (and vice versa). The negation of "the file is open and saved" is "the file is not open or not saved." It's not "the file is not open and not saved"; that's too strong.
Other laws you'll use:
- Double negation: ¬¬p ≡ p.
- Commutative and associative laws: order and grouping don't matter within a string of ∧'s or a string of ∨'s.
- Distributive laws: p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r), and p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r). Unlike ordinary algebra, both directions work.
- Identity and domination: p ∧ T ≡ p, p ∨ F ≡ p, p ∨ T ≡ T, p ∧ F ≡ F.
- Absorption: p ∨ (p ∧ q) ≡ p.
Negating a conditional. Combine p → q ≡ ¬p ∨ q with De Morgan: ¬(p → q) ≡ ¬(¬p ∨ q) ≡ p ∧ ¬q. The negation of "if it rains, the game is canceled" is "it rains and the game is not canceled." It is not another if-then statement, which surprises many students.
Example simplification. ¬(p ∨ ¬q) ∨ q ≡ (¬p ∧ q) ∨ q ≡ q, by De Morgan, double negation and absorption.
Step 4 of 12Compare
De Morgan checked by truth table
| Aspect | ¬(p ∧ q) | ¬p ∨ ¬q |
|---|---|---|
| p = T, q = T | F | F |
| p = T, q = F | T | T |
| p = F, q = T | T | T |
| p = F, q = F | T | T |
Step 5 of 12Practice · Choose one
Which statement is the negation of "The server is up and the database is reachable"?
Step 6 of 12Flashcards
Laws of logic
Tap a card to flip it.
Step 7 of 12Learn
Converse, inverse and contrapositive
From any conditional p → q you can form three related statements:
- Converse: q → p
- Inverse: ¬p → ¬q
- Contrapositive: ¬q → ¬p
Take "If a number is divisible by 4, then it is even" (true).
- Converse: "If a number is even, then it is divisible by 4." False: 6 is even but not divisible by 4.
- Inverse: "If a number is not divisible by 4, then it is not even." False: 6 again.
- Contrapositive: "If a number is not even, then it is not divisible by 4." True.
The key fact: a conditional is always equivalent to its contrapositive, and the converse is always equivalent to the inverse. But a conditional is not equivalent to its converse. Mixing up a statement with its converse is one of the most common errors in reasoning, in math and everywhere else: "All doctors have degrees; she has a degree; so she's a doctor."
Why does the contrapositive work? If p always leads to q, then whenever q fails, p can't have happened. You can confirm it with a truth table, or algebraically: ¬q → ¬p ≡ ¬¬q ∨ ¬p ≡ q ∨ ¬p ≡ ¬p ∨ q ≡ p → q.
This equivalence is a proof technique in its own right. When proving p → q directly is hard, prove ¬q → ¬p instead. You'll use that in Module 2.
Step 8 of 12Practice · Diagram
The four forms of a conditional
Tap the form that is always logically equivalent to the original.
Tap the shape that answers the question, then press Check.
- Original: p → q
If divisible by 4, then even. True.
- Converse: q → p
If even, then divisible by 4. False (6).
- Inverse: ¬p → ¬q
Equivalent to the converse, not to the original.
- Contrapositive: ¬q → ¬p
If not even, then not divisible by 4. True.
Step 9 of 12Practice · Match the pairs
For the statement "If it is a square, then it is a rectangle," match each name with its statement.
Tap an answer, then tap the place where it belongs (or drag it there).
- Converse
- Inverse
- Contrapositive
- Negation
Step 10 of 12Practice · Spot the mistake
A student simplified ¬(p ∧ ¬q). Which step is wrong?
Step 11 of 12Note
Step 12 of 12Practice · True or false
The statements p → q and q → p are logically equivalent.
Lesson complete!