Lecture 1 - Propositional Logic
Lecture 1 - Propositional Logic
DISCRETE STRUCTURES
PROPOSITIONAL LOGIC
Lecture 1: Introduction to Propositional Logic
Logic
4. She is very talented (Yes /No) since she is not specified, neither T nor F
More complex propositional statements can be build from the elementary statements using
logical connectives.
• Logical connectives:
1. Negation
2. Conjunction
3. Disjunction
4. Exclusive or
5. Implication
6. Biconditional
Negation
p ¬p
T F
F T
Example:
Let p denotes “The earth is round”, then ¬p denotes “It is not the case that the earth is
round,” or more simply “The earth is not round.”
Negation (cont.)
2 is a prime number.
• 2 is not a prime number
Definition: Let p and q be propositions. The proposition "p and q" denoted by p ∧ q, is true
when both p and q are true and is false otherwise. The proposition p ∧ q is called the
conjunction of p and q.
• Examples:
🠶 Shah Alam is located in Selangor and 5 + 2 = 8
🠶 It is raining today and 2 is a prime number.
🠶 2 is a prime number and 5 + 2 ≠ 8.
🠶 13 is a perfect square and 9 is a prime.
Disjunction
Definition: Let p and q be propositions. The proposition "p or q" denoted by p ∨ q, is false
when both p and q are false and is true otherwise. The proposition p ∨ q is called the
disjunction of p and q.
• Examples:
🠶 Shah Alam is located in Selangor or 5 + 2 = 8.
🠶 It is raining today or 2 is a prime number.
🠶 2 is a prime number or 5 + 2 ≠ 8.
🠶 13 is a perfect square or 9 is a prime.
Truth tables
p q p^q p∨ q
1 1 1 1
1 0 0 1
0 1 0 1
0 0 0 0
1 – TRUE
0 - FALSE
Exclusive or
Definition: Let p and q be propositions. The proposition "p exclusive or q" denoted by p ⊕ q,
is true when exactly one of p and q is true and is false otherwise.
p q p⊕ q
1 1 0
1 0 1
0 1 1
0 0 0
Implication
Definition: Let p and q be propositions. The proposition "p implies q" denoted by p → q is
called implication. It is false when p is true and q is false and is true otherwise.
p q p → q
1 1 1
1 0 0
0 1 1
0 0 1
Understanding Implication
🠶 In p →q there does not need to be any connection between the antecedent or the
consequent. The “meaning” of p →q depends only on the truth values of p and q.
🠶 These implications are perfectly fine, but would not be used in ordinary English.
🠶 “If the moon is made of green cheese, then I have more money than Bill Gates. ”
🠶 “If the moon is made of green cheese, then I’m on welfare.”
🠶 “If 1 + 1 = 3, then your grandma wears combat boots.”
Implication (cont.)
• Examples:
🠶 – if the moon is made of green cheese then 2 is a prime.
🠶 •T
🠶 – if today is friday then 2 * 3 = 8.
🠶 •F
Implication (cont.)
🠶 The converse of p → q is q → p
🠶 The contrapositive of p → q is ¬q → ¬p
🠶 The inverse of p → q is ¬p → ¬q
Examples:
Examples:
🠶 The contrapositive (¬q → ¬p) : If the traffic does not move slowly, then it does not
snow
🠶 The inverse (¬p → ¬q): If it does not snow, then traffic does not move slowly.
Biconditional
p q p ↔ q
1 1 1
1 0 0
0 1 0
0 0 1
Which of these sentences are propositions? What are the truth values of those that are
propositions?
c) 2 + 3 = 5.
d) 5 + 7 = 10.
e) x + 2 = 11.
a) ¬ p
b) p ∨ q
c) p → q
d) p ∧ q
e) p ↔ q
p : I love pink
q : I love black
a) ¬ p
b) (p → q)