0% found this document useful (0 votes)
45 views

CH2 Logical Equivalence

The document discusses various logical concepts: - Normal forms such as conjunctive normal form and disjunctive normal form for representing logical statements. - Predicates and quantifiers such as universal and existential quantifiers. - Rules of inference like modus ponens, modus tollens, and resolution. - Definitions of logical and mathematical terms to use as the basis for proofs.

Uploaded by

irwan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

CH2 Logical Equivalence

The document discusses various logical concepts: - Normal forms such as conjunctive normal form and disjunctive normal form for representing logical statements. - Predicates and quantifiers such as universal and existential quantifiers. - Rules of inference like modus ponens, modus tollens, and resolution. - Definitions of logical and mathematical terms to use as the basis for proofs.

Uploaded by

irwan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

LOGICAL

EQUIVALENCE &
SOUNDNESS
CSC510 – Discrete Structures

Nur Azmina binti Mohamad Zamani

Faculty of Computer & Mathematical


Sciences
NORMAL FORMS
Conjunctive Normal Form
- A compound statement is in conjunctive normal form if it is
obtained by operating AND among variables (negation of
variables included) connected with ORs. In terms of set
operations, it is a compound statement obtained by
Intersection among variables connected with Unions.

Example: p ∧ (q ∨ r)

 Disjunctive Normal Form


- A compound statement is in conjunctive normal form if it is
obtained by operating OR among variables (negation of
variables included) connected with ANDs. In terms of set
operations, it is a compound statement obtained by Union
among variables connected with Intersections.

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

1) Get F value from the table.


2) DNF of F value: (P ∧ ¬Q ∧ R) ∨ (P ∧ ¬Q ∧ ¬R) ∨ (¬P ∧ ¬Q
∧ R)
3) Complement of DNF: (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q
∨ ¬R)

∴ CNF: (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q ∨ ¬R)


PREDICATE
Predicate:
◦ a propositional function describing certain
properties or relations that return True or False as
its value.
◦ involving named object (constant) and unnamed
object (variable).

Eg: friend(ali,abu)

The predicate friend(ali,abu) describes the


relationship between the constant terms ali and abu
- so if ali and abu are friends, then friend(ali,abu) is
True, else it is False.
QUANTIFIER
 Quantifier
◦ A logical expression with no free variable.
◦ All variables are bound by Universal or
Existential quantifiers:

UNIVERSAL (∀) EXISTENTIAL (∃)


for every for at least one
for all there exists
for each for some
for any someone
anyone few
whenever many
if…then… most
majority
QUANTIFIER (cont.)
 Universal (∀)
◦ Indicates an expression is true for all terms.

Example: All cars have wheels


∀x hasWheel(x)  denotes that hasWheel(x) is true for
every x.
[*NOTE: If it is false, it is called COUNTEREXAMPLE]

 Existential (∃)
◦ Indicates an expression is true for some terms.

Example: Some students can sing


∃x canSing(x)  denotes that canSing(x) is true for some x.
QUANTIFIER (cont.) -
Summary
STATEMEN WHEN FALSE
WHEN TRUE
T (COUNTEREXAMPLE)
There is an x for which
∀xP(x) P(x) is true for every x.
P(x) is false.
There is an x for which
∃xP(x) P(x) is false for every x.
P(x) is true.

NEGATING QUANTIFIED EXPRESSIONS (DE MORGAN’S


LAW)
EQUIVALENT
NEGATION WHEN TRUE WHEN FALSE
STATEMENT
¬∃xP(x) For every x, P(x) There is an x for
∀x ¬P(x)
is false. which P(x) is true.
There is an x for
¬∀xP(x) P(x) is true for
∃x ¬P(x) which P(x) is
every x.
false.
NESTED QUANTIFIERS
∀x ∀y trust(x,y) is true for all values of x and for all
values of y
◦ Everybody trusts everybody

∀x ∃y trust(x,y) is true if there is an element of y such


that trust(x,y) is true for an arbitrary element x
◦ Everybody trusts somebody

∃x ∀y trust(x,y) is true if at least one element x such


that trust(x,y) is true for every y
◦ Somebody trusts everybody

∃x ∃y trust(x,y) is true if for one value of x and for one


value of y, trust(x,y) is true
◦ Somebody trusts somebody
EXAMPLE 1
“If a person is a female and is a parent,
then this person is someone’s mother.”
Translate:
For every person x, if a person x is a female
and person x is a parent, then there exists a
person y such that person x is the mother of
person y.
∀x ((F(x) ∧ P(x))  ∃y M(x,y))
OR
∀x ∃y ((F(x) ∧ P(x))  M(x,y))
EXAMPLE 2
B(x): “x is a Bachelor of Computer Science
major”.
T(x,y): “x is taking y” where x represents
students and y represents courses.
∀y ∃x (¬B(x) ∧ T(x,y))

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
pq
p [ p  ( p  q )]  q Modus ponens
q
q
pq [q  ( p  q )]  p Modus tollen
 p
pq
qr [( p  q )  (q  r )]  ( p  r ) Hypothetical syllogism
pr
pq
*Note:
p (( p  q )  p )  q Disjunctive syllogism
that = implies
q and = but =
p
p  ( p  q) Addition however
pq
pq
( p  q)  p Simplification
p
p
q (( p )  (q))  ( p  q ) Conjunction
pq
pq
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 continues on the next slide…


EXAMPLE 1 (cont.)
(1) ¬p ∧ q Hypothesis
(2) ¬p Simplification using (1)
(3) rp Hypothesis
(4) ¬r Modus Tollens using (2) & (3)
(5) ¬r  s Hypothesis
(6) s Modus Ponens using (4) & (5)
(7) st Hypothesis
(8) t Modus Ponens using (6) & (7)
EXAMPLE 2
Premise 1: F  S
Premise 2: ¬G  ¬L
Premise 3: G  F
Conclusion: ¬S  ¬L

Solution:
(1) FS Premise 1
(2) ¬S  ¬F Contrapositive using (1)
(3) GF 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

A: Assume the hypothesis A is true.


Derive some other statement A1, that is true as a result of
A1:
A is true.
From A1 is true, we derive some other statement A2, A3
A2: and so on which are also true based on theorems and
rules of algebra.
We derive some true statement B2, B1 and so on based
B2:
on true statement from A2.
Finally, derive to the conclusion B which is true. Hence,
B:
the proof is completed.
DIRECT PROOF – EXAMPLE
1
“If n is an odd integer, then n2 is
odd”.Hypothesis (A) Conclusion (B)

A: Assume that n is an odd integer.


A1: By the definition of an odd integer(Definition 6); n =
2k+1, k ∈ Z.
B1: n2 = (2k + 1) 2
= 4k2 + 4k + 1
= 2(2k2 + 2k )+ 1
= 2 k + 1 for some integer k = 2k2 + 2k
B: Thus, n2 is odd.
DIRECT PROOF – EXAMPLE
2 n m

“If 2 divides x2, then 4 divides x2


for x ∈ Z”.
A: Assume that 2/x . 2

A1: By the definition of 2 divides x2,


x2 = 2y, for some integer y.
A2: Thus, x2 is an even integer and it follows that x is also an
even integer.
A3: By definition of even integer, x = 2k, k ∈ Z.
B2: Then, x2 = (2k)2 = 4k2
B1: x2/4 = k2
B: 4 divides x2 or 4/x2
CONTRAPOSITIVE
STATEMENT: A  B “If A then B” OR “A implies B”
so the contrapositive is ¬B  ¬A.

Hence, start the proof by assuming NOT B (¬B).

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.

2. Then, 3n+2 = 3(2k) + 2


= 6k + 2
= 2 (3k + 1)
3. Thus, 3n+2 is even. This is a contradiction with the
assumption that 3n+2 is odd. Therefore, n is odd.
PROOF BY CASES
EXAMPLE:
x + |x – 7| ≥ 7 for all real numbers x

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

CASE 2: Assume that x < 7,


Then, x – 7 < 0 and |x – 7| = - (x – 7) = 7 – x.
So, x + |x – 7| = x + (7 – x) = 7 ≥ 7

You might also like