Most mathematical theorems and most program logic have the form “if something, then something else”. This section explains the conditional “if p, then q” and the biconditional ”p if and only if q”. The truth table of the conditional surprises many students, so we will look at it slowly.
The conditional p→q
p
q
p→q
T
T
T
T
F
F
F
T
T
F
F
T
Many ways to say p→q
All of the following mean p→q:
if p, then q; p implies q; q if p; q whenever p
p only if q
p is sufficient for q
q is necessary for p
”p only if q” often confuses students. “You can board the plane only if you have a boarding pass” means: if you board the plane, then you have a boarding pass. It does not say that having a pass guarantees boarding.
Vacuously true and trivially true
When the hypothesis p is false, p→q is true whatever q is. We then say that p→q is vacuously true. When the conclusion q is true, p→q is true whatever p is; we then say p→q is trivially true.
Example: “If 3<0, then 5>0” is vacuously true (the hypothesis is false). It is also trivially true (the conclusion is true).
Converse, inverse and contrapositive
From one conditional p→q we can build three related conditionals.
Name
Form
Same truth table as p→q?
Original
p→q
—
Converse
q→p
No
Inverse
¬p→¬q
No
Contrapositive
¬q→¬p
Yes
Original
p → q
If it rains, the ground is wet.
Converse
q → p
If the ground is wet, it rains.
Not the same meaning
Inverse
¬p → ¬q
If it does not rain, the ground is not wet.
Not the same meaning
Contrapositive
¬q → ¬p
If the ground is not wet, it did not rain.
Same meaning as the original
The four conditionals built from p and q
The converse of "p→q" is read ”p if q”, or ”p is necessary for q” — the roles of p and q are swapped.
The biconditional p↔q
p
q
p→q
q→p
p↔q
T
T
T
T
T
T
F
F
T
F
F
T
T
F
F
F
F
T
T
T
Other readings: ”p is necessary and sufficient for q”, ”p implies and is implied by q”. In programming, p == q on two Booleans is exactly p↔q.
Key takeaways
p→q is false only when p is T and q is F.
”p only if q”, ”p is sufficient for q” and ”q is necessary for p” all mean p→q.
A conditional with a false hypothesis is vacuously true; one with a true conclusion is trivially true.
The contrapositive ¬q→¬p is equivalent to p→q; the converse and inverse are not.
p↔q is true when p and q have the same truth value.
Practice questions
Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 6 · short answer
Write the converse, inverse and contrapositive of “If an integer is divisible by 6, then it is divisible by 3”. Which of the four statements are true for all integers?
Show worked answer
Let p: ”n is divisible by 6” and q: ”n is divisible by 3”. Original p→q: true, because n=6k=3(2k). Converse q→p: “If n is divisible by 3, then it is divisible by 6” — false, counterexample n=3. Inverse ¬p→¬q: “If n is not divisible by 6, then it is not divisible by 3” — false, counterexample n=3. Contrapositive ¬q→¬p: “If n is not divisible by 3, then it is not divisible by 6” — true, because it is equivalent to the original. So the original and the contrapositive are true.
MCA Online notes are made for reading on screen. Open https://mcastudy.online/mcs-212/propositional-calculus/conditional-and-biconditional/ to read this page.