MathLogic1-Propositional-Logic
MathLogic1-Propositional-Logic
Chapter 1 Contents
Logical
Equivalences
Introduction to Mathematical Logic Exercise
on January 7, 2025
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 1 / 48
Contents
Contents
Propositional Logic
Logical
1 Propositional Logic Equivalences
Exercise
2 Logical Equivalences
3 Exercise
1.2
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 2 / 48
Contents
Contents
Propositional Logic
Exercise
L.O.1 Understanding of logic and discrete structures
L.O.1.1 – Describe definition of predicate logic
L.O.1.2 – Define basic discrete structures: set, map, graph
L.O.2 Represent & model practical problems with discrete structures
L.O.2.1 – Logically describe KEY problems in Computing
L.O.2.2 – Use proving methods: contrapositive, induction
L.O.2.3 – Explain problem modeling using discrete structures
1.3
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 3 / 48
CHAPTER 1.
Propositional Logic
Propositional Logic
Contents
Definition (Averroes)
Propositional Logic
The tool for distinguishing between the true and the false.
Logical
Equivalences
Exercise
1.5
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 5 / 48
Propositional Logic
Contents
Propositional Logic
Logical
• Design of computer circuits Equivalences
1.6
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 6 / 48
Propositional Logic
Contents
Propositional Logic
Definition
Logical
A proposition is a declarative sentence that is either true or Equivalences
Examples
• Hanoi is the capital of Vietnam.
• New York City is the capital of USA.
• 1+1=2
• 2+2=3
1.7
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 7 / 48
Propositional Logic
Contents
Logical
• How easy is logic! Equivalences
1.8
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 8 / 48
Propositional Logic
Contents
Propositional Logic
Logical
Equivalences
Exercise
1.9
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 9 / 48
Propositional Logic
Contents
Propositional Logic
Negation - : ¬p Logical
Equivalences
Exercise
p ¬p
T F
F T
1.10
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 10 / 48
Propositional Logic
Contents
Conjunction - : p ∧ q Disjunction -: p ∨ q Propositional Logic
“p and q” “p or q” Logical
Equivalences
Exercise
p q p∧q p q p∨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
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 11 / 48
Propositional Logic
Contents
Propositional Logic
Exclusive OR : p ⊕ q Implication : p → q Logical
“p or q (but not both)” “if p, then q” Equivalences
Exercise
p q p⊕q p q p→q
T T F T T T
T F T T F F
F T T F T T
F F F F F T
1.12
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 12 / 48
Propositional Logic
Contents
Propositional Logic
• if p, then q
Logical
• p implies q Equivalences
Exercise
• p is sufficient for q
• q if p
• p only if q
• q unless ¬p
• If you get 100% on the final, you will get 10 grade.
• If you feel asleep this afternoon, then 2 + 3 = 5.
1.13
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 13 / 48
Propositional Logic
Contents
Propositional Logic
Logical
Equivalences
• q → p (converse ) Exercise
• ¬q → ¬p (contrapositive )
• Prove that only contrapositive have the same truth
table with p → q
1.14
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 14 / 48
Propositional Logic
Propositional Logic
Exercise Contents
Propositional Logic
What are the converse and contrapositive of the following
Logical
conditional statement Equivalences
“If he plays online games too much, his girlfriend leaves Exercise
him.”
1.15
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 15 / 48
Propositional Logic
p↔q Contents
Logical
Equivalences
p q p↔q Exercise
T T T
T F F
F T F
F F T
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 16 / 48
Propositional Logic
Contents
Propositional Logic
Logical
Equivalences
• 1. in the bracket() Exercise
• 2. negation ¬
• 3. ∨, ∧, ⊕
• 4. →
• 5. ↔
1.17
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 17 / 48
Propositional Logic
Contents
Propositional Logic
Exercise Logical
Equivalences
I will buy a new phone only if I have enough money to buy
Exercise
iPhone 4 or my phone is not working.
• p → (q ∨ ¬r)
1.18
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 18 / 48
Propositional Logic
Contents
Propositional Logic
Logical
Equivalences
Exercise
Exercise
He will not run the red light if he sees the police unless he is
too risky.
1.19
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 19 / 48
Propositional Logic
Contents
Exercise Propositional Logic
p q ¬q p ∨ ¬q p∧q (p ∨ ¬q) → (p ∧ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F
1.20
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 20 / 48
Propositional Logic
¬p → (¬q ∨ r)
Contents
p q r ¬p ¬q ¬q ∨ r ¬p → (¬q ∨ r)
T T T F F T T Propositional Logic
T T F F F F T Logical
T F T F T T T Equivalences
T F F F T T T Exercise
F T T T F T T
F T F T F F F
F F T T T T T
F F F T T T T
a) (p ∧ q) → ¬q
b) (p ∨ r) → (r ∨ ¬p)
c) (p → q) ∨ (q → p)
d) (p ∨ ¬q) ∧ (¬p ∨ q)
e) (p → ¬q) ∨ (q → ¬p)
f) ¬(¬p ∧ ¬q)
g) (p ∨ q) → (p ⊕ q)
h) (p ∧ q) ∨ (r ⊕ q) 1.21
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 21 / 48
Propositional Logic
Contents
Propositional Logic
Logical
Equivalences
• System specifications
Exercise
• “When a user clicked on Help button, a pop-up will be
shown up”
• Boolean search
• type “dai hoc bach khoa” in Google
• means “dai AND hoc AND bach AND khoa”
1.22
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 22 / 48
Propositional Logic
Contents
Propositional Logic
1.23
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 23 / 48
Propositional Logic
Contents
Definition Propositional Logic
• Tautology:
• Contradiction:
Example
• p ∨ ¬p (tautology)
• p ∧ ¬p (contradiction)
1.24
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 24 / 48
Propositional Logic
Contents
Propositional Logic
Which of the following is a tautology
Logical
Hint: Apply truth table. Equivalences
Exercise
a) (p ∨ q) → (p ∧ q)
b) (p ∧ q) → (p ∨ q)
c) p → (¬q → p)
d) p → (p → q)
e) p → (p → p)
f) (p → q) → [(p → r) → (q → r)]
1.25
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 25 / 48
Propositional Logic
Contents
a) “Fansipan is the highest mountain in Vietnam.” Propositional Logic
b) “Two coprime numbers have the only common divisor of 1.” Logical
c) “The product of 3 continuous integers is divisible by 3.” Equivalences
e) “x+1=0”
f) “Hexagons have 8 vertices.”
g) “0 is a positive number.”
h) “The equation: x2 + 5x + 6 = 0 has no root.”
i) “is 2 a prime number?”
j) “The equation mx2 + 2x − 1 = 0 has a single root if and only if m=-1.”
k) “There is a prime that is even.”
l) “x2 + 1 > 0.”
1.26
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 26 / 48
Propositional Logic
Contents
Propositional Logic
m) “When will our class go camping?”
Logical
m) “Mercury is not a metal.” Equivalences
1.27
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 27 / 48
Logical Equivalences
Contents
Propositional Logic
Logical
Equivalences
Definition
Exercise
The compound compositions p and q are called logically
equivalent if p ↔ q is a tautology, denoted p ≡ q.
Example
Show that ¬(p ∨ q) and ¬p ∧ ¬q are logically equivalent.
1.28
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 28 / 48
Logical Equivalences
Contents
Propositional Logic
p∧T ≡ p Identity laws Logical
p∨F ≡ p Equivalences
Exercise
p∨T ≡ T Domination laws
p∧F ≡ F
p∨p ≡ p Idempotent laws
p∧p ≡ p
¬(¬p) ≡ p Double negation law
1.29
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 29 / 48
Logical Equivalences
Contents
p∨q ≡ q∨p Commutative laws Propositional Logic
p∧q ≡ q∧p Logical
Equivalences
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Associative laws Exercise
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive laws
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)
¬(p ∧ q) ≡ ¬p ∨ ¬q De Morgan’s law
¬(p ∨ q) ≡ ¬p ∧ ¬q
p ∨ (p ∧ q) ≡ p Absorption laws
p ∧ (p ∨ q) ≡ p
1.30
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 30 / 48
Logical Equivalences
Contents
Logical
p ∨ ¬p ≡ T Equivalences
p ∧ ¬p ≡ F Exercise
p→q ≡ ¬p ∨ q
(p → q) ∧ (p → r) ≡ p → (q ∧ r)
(p → r) ∧ (q → r) ≡ (p ∨ q) → r
(p → q) ∨ (p → r) ≡ p → (q ∨ r)
(p → r) ∨ (q → r) ≡ (p ∧ q) → r
p↔q ≡ (p → q) ∧ (q → p)
p↔q ≡ (¬p ∨ q) ∧ (p ∨ ¬q)
1.31
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 31 / 48
Logical Equivalences
Example
Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically Contents
Propositional Logic
equivalent by developing a series of logical equivalences.
Logical
Equivalences
Solution Exercise
1.32
Consequently, ¬(p ∨ (¬p ∧ q)) and ¬p ∧Propositional
Man VM. Nguyen (Math Depart., MUSC)
¬q are logically
Logic
equivalent. January 7, 2025 32 / 48
Exercise
a) p ∧ (q ∨ r) ∧ (¬p ∨ ¬q ∨ r)
b) (p ∧ q) → r
c) p ∨ q ∨ (¬p ∧ ¬q ∧ r)
d) [[[(p ∧ q) ∧ r] ∨ [(p ∧ r) ∧ ¬r]] ∨ ¬q] → s
1.33
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 33 / 48
Exercise
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 34 / 48
Exercise
Contents
Propositional Logic
Prove the following proposition are logical equivalence.
Logical
Hint: Apply truth table or the series of logical equivalences. Equivalences
Exercise
a) ¬(p ↔ q) and ¬p ↔ q
b) (p → q) ∧ (p → r) and p → (q ∧ r)
c) (p → r) ∧ (q → r) and (p ∨ q) → r
d) (p → q) ∨ (p → r) and p → (q ∨ r)
e) ¬p → (q → r) and q → (p ∨ r)
f) p ↔ q and (p → q) ∧ (q → p)
1.35
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 35 / 48
Exercise
Contents
b) p → q and ¬p ∨ (p ∧ q)
c) p → q and ¬p ∨ ¬q
d) ¬p and ¬(p ∨ q) ∨ (¬p ∧ q)
e) [(p ↔ q) ∧ (q ↔ r) ∧ (r ↔ p)] and
[(p → q) ∧ (q → r) ∧ (r → p)]
f) [(p ∧ q) ∨ (q ∧ r) ∨ (r ∧ p)] and [(p ∨ q) ∧ (q ∨ r) ∧ (r ∨ p)]
1.36
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 36 / 48
Exercise
a) p ∧ (p → q) ≡ p ∧ (¬p ∨ q) Exercise
≡ (p ∧ ¬p) ∨ (p ∧ q) ≡ 0 ∨ (p ∧ q) ≡ p ∧ q
b) ¬p ∨ (p ∧ q) ≡ ¬p ∨ (p ∧ q)
≡ (¬p ∨ p) ∧ (¬p ∨ q) ≡ 1 ∧ (¬p ∨ q)
≡ ¬p ∨ q ≡ p → q
d) ¬(p ∨ q) ∨ (¬p ∧ q)
≡ (¬p ∧ ¬q) ∨ (¬p ∧ q)
≡ ¬p ∧ (¬q ∨ q)
≡ ¬p ∧ 1
≡ ¬p
1.37
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 37 / 48
Exercise
d) “If the quadratic equation ax2 + bx + c = 0 has a.c < 0, it has root.”
e) “If two numbers x and y are both divisible by n, (x + y) is also divisible
by n.”
f) “If 45 ended with 5, 45 is divisible by 5.”
√ √ √
g) “If 2 is an irrational number then 2. 2 is an irrational number.”
h) “If Pythagoras is French, Vietnam belongs to Asia.”
i) “If 3n + 2 is an odd integer, n is an odd integer.”
j) “If 8 ¡ 9, 5 is a prime number.”
k) “A quadrilateral is a rhombus when it has 2 perpendicular diagonals.”
l) “If 5 ¡ 3, 7 is a prime number.”
1.38
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 38 / 48
Exercise
Logical
The statement that formalizes ”If Brandon likes reading, Equivalences
B) p → q
C) p ∨ q
D) p ∧ q
E) p ↔ q
F) ¬p → ¬q
G) ¬p ∨ (p ∧ q)
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 39 / 48
Exercise
Propositional Logic
• R: “Potter is studying English”.
Logical
Equivalences
Example Exercise
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 40 / 48
Exercise
Contents
Propositional Logic
Logical
Which of the following proposition is a truth. Equivalences
Exercise
A) (p ∨ ¬q) → q
B) p → (p ∧ q)
C) ¬p → (p → q)
D) ¬(p → q) → q
E) none of the others.
1.41
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 41 / 48
Exercise
Logical
• r: “ABC has a 60o angle”. Equivalences
Exercise
Q: Which of the following compounds formalize the
theorem: “if ABC is an isosceles triangle and has a 60o
angle then it is an equilateral triangle” ?
A) (p ∧ q) → r
B) (p ∧ r) → q
C) (p ∧ r) ∨ q
D) q → (p ∨ r)
E) none of the others.
1.42
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 42 / 48
Exercise
Contents
There are 6 soccer teams A, B, C, D, E, F contested in a Propositional Logic
tournament. The following are statements on which two Logical
Equivalences
teams are in the grand final:
Exercise
a. A and C
b. B and E
c. B and F
d. A and F
e. A and D
Knowing that there are 4 half true statements and 1 totally
false statement. What teams are in the grand final?
1.43
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 43 / 48
Exercise
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 44 / 48
Exercise
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 45 / 48
Exercise
Contents
Propositional Logic
Logical
a) “∀x ∈ N, x2
+ 5x + 6 is not a prime number.” → True. Equivalences
→ x2 + 5x + 6 = (x + 2).(x + 3) ...
Exercise
b) “∃x ∈ R, x2 + x + 1 ≤ 0” → False.
→ x2 + x + 1 = (x + 12 )2 + 34 > 0∀x ∈ R.
1.46
Man VM. Nguyen (Math Depart., MUSC) Propositional Logic January 7, 2025 46 / 48