CH2 Logical Equivalence
CH2 Logical Equivalence
EQUIVALENCE &
SOUNDNESS
CSC510 – Discrete Structures
Example: p ∧ (q ∨ r)
Example: (p ∧ q) ∨ (p ∧ ¬ q)
NORMAL FORMS (cont.)
Three steps to obtain a CNF through algebraic
manipulations:
1) Remove all and ⇔.
2) If the expression contains any negated
compound subexpressions, either:
Remove the negation by using double-negation law
Use De Morgan’s law to reduce the scope of the
negation
3) Once an expression with no negated compound
subexpression is found, use the following two
Laws/Rules to reduce the scope of ∨:
Rule I: A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C)
Rule II: (A ∧ B) ∨ C ≡ (A ∨ C) ∧ (B ∨ C)
NORMAL FORMS (cont.)
EXAMPLE:
Convert the following expression into CNF:
¬ ((P ∨ ¬Q) ∧ ¬R)
SOLUTION:
De Morgan’s
¬ ((P ∨ ¬Q) ∧ ¬R) ≡ ¬ (P ∨ ¬Q) ∨ ¬¬R
Law
Double
≡ ¬ (P ∨ ¬Q) ∨ R
Negation
De Morgan’s
≡ (¬P ∧ ¬¬Q) ∨ R
Law
Double
≡ (¬P ∧ Q) ∨ R
Negation
≡ (¬P ∨ R) ∧ (Q ∨ R) Rule II
NORMAL FORMS (cont.)
Three steps to obtain a CNF using
truth table:
1) Get the False (F) value from the
table.
2) Read in disjunctive form of F
value.
3) Complement of every item in
disjunctive expression.
NORMAL FORMS (cont.)
Find the full CNF for output given by table below:
P Q R OUTPUT
T T T T
T T F T
T F T F
T F F F
F T T T
F T F T
F F T F
F F F T
Eg: friend(ali,abu)
Existential (∃)
◦ Indicates an expression is true for some terms.
Translate:
Every courses there is a student who is not a
Bachelor of Computer Science major and a
student is taking all courses.
RULE OF INFERENCE
Rule of inference Tautology Name
pq
p [ p ( p q )] q Modus ponens
q
q
pq [q ( p q )] p Modus tollen
p
pq
qr [( p q ) (q r )] ( p r ) Hypothetical syllogism
pr
pq
*Note:
p (( p q ) p ) q Disjunctive syllogism
that = implies
q and = but =
p
p ( p q) Addition however
pq
pq
( p q) p Simplification
p
p
q (( p ) (q)) ( p q ) Conjunction
pq
pq
p r [( p q ) (p r )] ( p r ) Resolution
q r
EXAMPLE 1
“It is not sunny this afternoon and it is colder than
yesterday”; “We will go swimming only if it is sunny”; “If we
do not go swimming, then we will take a canoe trip”; and “If
we take a canoe trip, then we will be home by sunset”. Lead
to a conclusion “We will be home by sunset”.
SOLUTION:
p: It is sunny this afternoon
q: It is colder than yesterday
r: We will go swimming
s: We will take a canoe trip
t: We will be home by sunset
Hypothesis: ¬p ∧ q, r p, ¬r s, s t
Conclusion: t
Solution:
(1) FS Premise 1
(2) ¬S ¬F Contrapositive using (1)
(3) GF Premise 3
(4) ¬F ¬G Contrapositive using (3)
Hypothetical Syllogism using (2)
(5) ¬S ¬G
& (4)
(6) ¬G ¬L Premise 2
Hypothetical Syllogism using (5)
(7) ¬S ¬L
& (6)
METHOD OF PROOF - DEFINITIONS
DEFINITION 1 An integer n divides an integer m (written as n/m) if m
= kn, for some integer k.
DEFINITION 2 A positive integer p > 1 is prime if the only positive
integers that divide p are 1 and p.
DEFINITION 3 A triangle is isosceles if two of its sides have equal length.
DEFINITION 4 Two ordered pairs of real numbers (x1, y1) and (x2, y2) are
equal if x1 = x2 and y1 = y2.
DEFINITION 5 An integer n is even if the remainder on dividing n by 2 is
0 and n = 2k.
DEFINITION 6 An integer n is odd if n = 2k+1 for some integer k.
DEFINITION 7 A real number is rational if r can be expressed as the ratio
of two integers p and q in which the denominator q is not
0.
DEFINITION 8 The statements A and B are equivalent if “A implies B”
and “B implies A”.
DEFINITION 9 The statements A AND B (A ∧ B) is true when A is true
and B is true.
DEFINITION 10 The statements A OR B (A ∨ B) is true in all cases except
when A is false and B is false.
METHOD OF PROOF
Direct proof
◦ (A B)
Contrapositive
◦ (¬B ¬A)
INDIRECT Contradiction
PROOF ◦ 1) A B
◦ 2) A ∧ ¬B Prove that it
is false.
◦ 3) FALSE
Proof by Cases
◦ Range of numbers
DIRECT PROOF
STATEMENT: A B “If A then B” OR “A implies B”
Hypothesis/Prem Conclusion
STEPS TO DO PROOF:
ise
EXAMPLE:
Show that “If x+10 is odd, then x is odd” using contraposition.
SOLUTION:
1. Suppose x is not odd. (¬B)
2. Then, x is even and by definition, some integer k such that x =
2k.
Then, x + 10 = 2k + 10
= 2 (k + 5)
= 2m for integer m = k + 5.
Thus, x + 10 is even. That is x + 10 is not odd.
3. Therefore, the contrapositive:
If x + 10 is odd, then x is odd is also true.
CONTRADICTION
We want to prove A B.
To reject A B, show that (A ∧ ¬B) can be true.
To reject (A ∧ ¬B), show that either B or ¬A is true.
EXAMPLE:
“If 3n+2 is odd, then n is odd.”
SOLUTION:
1. Assume 3n+2 is odd and n is even (A ∧ ¬B), that is n = 2k,
where k is an integer.
SOLUTION:
CASE 1: Assume x ≥ 7,
Then, x – 7 ≥ 0 and |x – 7| = x -7.
So, x + |x – 7| = x + (x – 7)
= 2x – 7 ≥ 2(7) – 7
= 14 – 7 = 7 ≥ 7