Propositional Logic
Propositional Logic
By
Gershom Buri
Discrete vs Continuous
• Nature:
– Discrete Math: Deals with structures that are fundamentally discrete i.e.
separate e.g. when you role a dice, you can only get 1,2,3,4,5,6
– Continuous Math: Deals with structures that vary continuously e.g. when
you change the volume the radio or brightness of your phone, the value
could be anywhere between the max & min.
• Applications:
– Discrete Math: Widely used in computer science, cryptography, error
correction,
– Continuous Math: Essential in physics, engineering, biology (for modeling
continuous change or phenomenon)
• Why focus on Discrete Math in our case? Because at the core, computers are
binary systems, 0s and 1s.
Main Course Objective
Negation “not p”
Conjunction “p and q”
Disjunction “p or q or both”
Exclusive or “either p or q, but not
both”
Implication “if p then q”
Biconditional “p if and only if q”
Truth Tables
• The effect of logical operators can be
summarized using a truth table.
• Let p be a proposition and let us construct the
truth table for not p.
• Since p is a proposition, its possible truth
values are true (T) and false (F).
Truth Tables cont’d
• The truth table for not p has two rows to
correspond to the two possible truth values of
the proposition p:
p Not p
T F
F T
Truth Table for Compound Propositions
p q p and q p q p or q
T T T T T T
T F F T F T
F T F F T T
F F F F F F
Example
Give the truth table for the compound proposition
(not p) or q
Solution
p q not p (not p) or q
T T F T
T F F F
F T T T
F T T T
Example
By using truth tables, show that
not (p and q) is equivalent to
(not p) or (not q)
Solution
p q
T T T
T F F
F T T
F F T
BICONDITIONAL PROPOSITION
● The proposition p ↔ q, read “If and only if” is
called biconditional.
11/6/2023 37
If and only if
• Suppose you say to one of your friends
– if I go to lectures then I will do well at discrete maths. (not
necessarily)
• whereas to another friend you say
– if I do well at discrete maths then I have gone to lectures. (a direct
effect, places more weight on importance of lecturers in relation to
achievement)
• When you put these 2 together, you are essentially saying
– I do well at discrete maths if and only if I go to lectures
• This is a bi-directional relationship: not only is attending
necessary, but if you excel, it is because of the attendance
• It is a stronger commitment than either of the individual
statements because it ties success and action together
11/6/2023 38
Example
Given the proposition ‘ I go to the
supermarket if and only if I have run out of
food.’
The above statement is the same as saying :
▪ ‘If I have run out of food then I go to the
supermarket, and if I go to the supermarket then I
have run out of food.’
11/6/2023 39
Soln
• The symbol for if and only if is
• The truth table for
p q
T T T
T F F
F T F
F F T
11/6/2023 40
Logical Equivalence
• When two compound propositions have the same truth values no matter
what truth value their constituent propositions have, they are
called logically equivalent.
• For instance and are logically equivalent (Quiz: Show it),
and we write it:
11/6/2023 41
Exercise
Prove that p ↔ q is equivalent to p → q and q
→p
11/6/2023 42
Converse.
11/6/2023 43
Contrapositive
11/6/2023 44