Chapter 1 - Propositional Logic
Chapter 1 - Propositional Logic
Dr. Vu Khac Ky
[email protected]
1. Negation operator
I Notation: ¬p (sometimes ∼p).
I Examples:
1. He is rich −→ He is NOT rich.
2. The girl is pretty −→ The girl is NOT pretty.
3. Discrete math is not difficult −→ Discrete math is difficult.
I Truth table:
p ¬p
0 1
1 0
Propositional Operators
p q p∨q
0 0 0
0 1 1
1 0 1
1 1 1
Propositional Operators
p q p⊕q
0 0 0
0 1 1
1 0 1
1 1 0
Propositional Operators
5. Implication
I Notation: p → q
I Examples:
1. p = "You don’t water your plants". q ="The plants die."
p → q = If you don’t water your plants, they will die.
2. If I am a billionaire, I will buy each of my students a Mercedes G63.
I Truth table:
p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
Propositional Operators
6. Bi-conditional operator
I Notation: p ↔ q
I Examples:
1. x ≥ y ↔ x − y ≥ 0.
2. Two triangles are congruent if and only if all three pairs of
corresponding sides are congruent.
I Truth table:
p q p↔q
0 0 1
0 1 0
1 0 0
1 1 1
Precedence of Logical Operators
Evaluate:
A = ¬p → (q ⊕ r → ¬p ∧ q) ↔ s
in which p = 0, q = 1, r = 0, s = 1.
Solution: Substitute p, q, r , s to the expression:
A = ¬0 → (1 ⊕ 0 → ¬0 ∧ 1) ↔ 1
= 1 → (1 ⊕ 0 → 1 ∧ 1) ↔ 1
= 1 → (1 ⊕ 0 → 1) ↔ 1
= 1 → (1 → 1) ↔ 1
= 1→1↔1
= 1↔1
= 1.
Example 2: Formalize a proposition
Let p, q, and r be the propositions
I p: Grizzly bears have been seen in the area.
I q: Hiking is safe on the trail.
I r: Berries are ripe along the trail.
Write the following propositions using p, q, and r and logical connectives
(including negations).
1. Berries are ripe along the trail, but grizzly bears have not been seen in
the area.
2. Grizzly bears have not been seen in the area and hiking on the trail is
safe, but berries are ripe along the trail.
3. If berries are ripe along the trail, hiking is safe if and only if grizzly bears
have not been seen in the area.
4. It is not safe to hike on the trail, but grizzly bears have not been seen in
the area and the berries along the trail are ripe.
5. For hiking on the trail to be safe, it is necessary but not sufficient that
berries not be ripe along the trail and for grizzly bears not to have been
seen in the area.
6. Hiking is not safe on the trail whenever grizzly bears have been seen in
the area and berries are ripe along the trail.
Example 2 (continue)
I p: Grizzly bears have been seen in the area.
I q: Hiking is safe on the trail.
I r: Berries are ripe along the trail.
Solution
1. Berries are ripe along the trail, but grizzly bears have not been seen in
the area. r ∧ ¬p
2. Grizzly bears have not been seen in the area and hiking on the trail is
safe, but berries are ripe along the trail. ¬p ∧ q ∧ r
3. If berries are ripe along the trail, hiking is safe if and only if grizzly bears
have not been seen in the area. r → (q ↔ ¬p)
4. It is not safe to hike on the trail, but grizzly bears have not been seen in
the area and the berries along the trail are ripe. ¬q ∧ ¬p ∧ r
5. For hiking on the trail to be safe, it is necessary but not sufficient that
berries not be ripe along the trail and for grizzly bears not to have been
seen in the area. q → (¬r ∧ ¬p)
6. Hiking is not safe on the trail whenever grizzly bears have been seen in
the area and berries are ripe along the trail. p ∧ r → ¬q
Tautology, Contradiction and Logical Equivalences
Definitions
A contradiction is a statement that is always false.
A tautology is a statement that is always true.
If p ↔ q is a tautology, then p is logically equivalent to q. We
denote by p ≡ q.
Remark
I Two statements p and q are said to be logically equivalent if they
have the same truth value in every model.
I A logical equivalence can be verified by comparing the two
corresponding columns in the Truth Table.
p q ¬p p→q ¬p ∨ q
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
1 1 0 1 1
Useful logical equivalences
A long list, but the most important to remember are:
Propositional function
A propositional function is a mapping P : X → {0, 1}, in which X is
a given set of parameters.
Examples
I P(x): "x is the prettiest girl in our school".
I Q(x, y ): "x loves y".
I R(x, y , z): x 2 + y 2 + z 2 ≥ 3xy + 3yz + 3xz.
Quantifiers
Definition
I Universal quantifiers (∀) : ∀x. x passes the MAD exam.
I Existential quantifiers (∃): ∃x. x wins "Best Student" award.
I Uniquely existential quantifiers (∃!): ∃!x. x 3 = 27.
Examples
Negation of Quantified Expressions
Rules
I ¬ ∀x.P(x) ≡ ∃x.¬P(x).
I ¬ ∃x.Q(x) ≡ ∀x.¬Q(x).
I Negation of universal is existential and vice versa.
Nested quatifications