Vous êtes sur la page 1sur 49

http://fskik.upsi.edu.

my

1.5 RULES of INFERENCE

MTK3013
DISCRETE STRUCTURES
http://fskik.upsi.edu.my

Definitions
• A theorem is a valid logical assertion which can be
proved using
– Axioms: statements which are given to be true
– Rules of inference: logical rules allowing the deduction of
conclusions from premises
• A lemma is a ‘pre-theorem’ or a result which is
needed to prove a theorem.
• A corollary is a ‘post-theorem’ or a result which
follows directly from a theorem.
http://fskik.upsi.edu.my

Rules of Inference

H1
H2
H1, H2, … Hn are the hypotheses

Hn
We use conjunction: H1 ^ H2 ^ H3…

C C is the conclusion.
“” means “therefore” or “it follows that”
http://fskik.upsi.edu.my

Some Rules of Inference


p p  ( p  q) Addition
pq
pq ( p  q)  p Simplification
p
p (( p )  ( q ))  ( p  q ) Conjunction
q
pq
p ( p  ( p  q ))  q Modus Ponens
pq Mode that affirms

q
http://fskik.upsi.edu.my

Example: Simplification

pq ( p  q)  p Simplification
p

p:”it is below freezing”


q:”it is raining now”

• It is below freezing and raining now.


Therefore, it is below freezing.
http://fskik.upsi.edu.my

Example: Modus Ponens


from Latin: mode that affirms
p ( p  ( p  q ))  q
pq
q

• In other words
If the hypothesis p is true
and the hypothesis (p->q) is true
Then I can conclude q
http://fskik.upsi.edu.my

Example: Modus Ponens

• p : “n is greater than 3”
• q: “n2 is greater than 9”

• Assuming that p is true, and p q is true,


then
• if is n greater than 3, it follows that n2 is
greater than 9.
http://fskik.upsi.edu.my

More Rules of Inference


q (  q  ( p  q ))   p Modus Tollens
pq
mode that denies
 p
pq (( p  q )  ( q  r ))  ( p  r ) Hypothetical
qr Syllogism
pr

pq (( p  q)  p)  q Disjunctive


p Syllogism
q
http://fskik.upsi.edu.my

More Rules of Inference


pq
(( p  q)  (p  r ))  (q  r ) Resolution
p  r
q  r
http://fskik.upsi.edu.my

Exercise

• If It rains today, then we will not have a


barbecue today. If we do not have a
barbecue today, then we will have a
barbecue tomorrow
• Therefore, if it rains today, then we will
have a barbecue tomorrow.
http://fskik.upsi.edu.my

Validity of an Argument

• An argument is valid if
– whenever all hypotheses are true, the
conclusion is also true
• To prove that an argument is valid:
– Assume the hypotheses are true
– Use the rules of inference and logical
equivalences to determine that the conclusion
is true
http://fskik.upsi.edu.my

Recap 1.2: Important


Equivalences

pTp Identity

pFp
pTT Domination

pFF
ppp Idempotent

ppp
( p)  p Double Negation
http://fskik.upsi.edu.my

Recap 1.2: Important


Equivalences
pqqp Commutative

pqqp
(p  q)  r  p  (q  r) Associative

(p  q)  r  p  (q  r)
p  (q  r)  (p  q)  (p  r) Distributive

p  (q  r)  (p  q)  (p  r)
(p  q)  p  q De Morgan’s

(p  q)  p  q
http://fskik.upsi.edu.my

Recap 1.2: Important


Equivalences

p  (p  q)  p Absorption

p  (p  q)  p
p  p  T Negation

p  p  F
http://fskik.upsi.edu.my

Example

• Consider the following logical argument:


– If horses fly or cows eat artichokes, then the
mosquito is the national bird. If the mosquito is
the national bird then peanut butter tastes good
on hot dogs. But peanut butter tastes terrible on
hot dogs. Therefore, cows don’t eat artichokes.
• Assign propositional variables to each
component in the argument
http://fskik.upsi.edu.my

Example
• Assignments:
p Horses fly
q Cows eat artichokes
r The mosquito is the national bird
s Peanut butter tastes good on hot dogs
• Represent the argument using the
variables
(p  q)  r
rs
Hypotheses
s
 q Conclusion
http://fskik.upsi.edu.my

Example
Assertion Reasons
1. (p  q)  r Hypothesis
2. rs Hypothesis
3. (p  q)  s Hypothetical syll. on 1. and 2.
4. s Hypothesis
5. (p  q) Modus tollens on 3. and 4.
6. p  q DeMorgan on 5.
7. q  p Commutative on 6.
8. q Simplification on 7.

We got our conclusion of “cows don’t eat artichokes”


http://fskik.upsi.edu.my

Example

• Show that the following argument is valid:


– 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. If we take a canoe trip, then we will be
home by sunset. Therefore, we will be home by
sunset.
http://fskik.upsi.edu.my

Rules of Inference for


Quantified Statements
xP(x), then for any
C, therefore P(c) is true

we select any
element c and P(c) is true
Therefore xP(x)

xP(x)
therefore for at
least one specific c,
P(c) is true
we select a particular
element c and P(c) is true
Therefore, xP(x)
http://fskik.upsi.edu.my

Example
• Everyone in the discrete math class has taken a CS
course. Marla is a student in the discrete class.
Therefore, Marla has taken a CS course.

D(x): x is in the discrete math class x(D(x)  C(x))


D(Marla) Premises
C(x): x has taken a CS course

 C(Marla)

1. x(D(x)  C(x)) Premise


2. D(Marla)  C(Marla) Univ. Inst. using 1.
3. D(Marla) Premise
4. C(Marla) Modus ponens using 2. and 3.
http://fskik.upsi.edu.my

Exercise

• A student in this class has not read the


book. Everyone in this class passed the first
exam.
• Therefore, Someone who passed the first
exam has not read the book
http://fskik.upsi.edu.my

Fallacies

• Fallacies resemble rules of inference but


are based on contingencies rather than
tautologies. They are incorrect inferences.
• Three common fallacies
– Affirming the Consequent
– Denying the Hypothesis
– Circular Reasoning (begging the question)
http://fskik.upsi.edu.my

Fallacy of Affirming the Consequent


pq (( p  q )  q )  p
q
p
• ((p  q)  q)  p is not a tautology and therefore not a rule
of inference.
• If you do every problem in this book, then you will learn
discrete mathematics. You learned discrete mathematics.
Therefore, you did every problem in this book.
• Exercise. Compare with modus ponens and tollens
http://fskik.upsi.edu.my

Fallacy of Denying the Hypothesis


pq (( p  q )   p )   q
p
 q
• ((p  q)  p)  q is not a tautology and therefore not a
rule of inference.
• If you do every problem in this book, then you will learn
discrete mathematics. You did not do every problem in this
book. Therefore, you did not learn discrete mathematics.
• Exercise. Compare with modus ponens and tollens
http://fskik.upsi.edu.my

Circular Reasoning

• One or more steps of the proof are based


upon the truth of the statement being
proved.
• Also known as begging the question
http://fskik.upsi.edu.my

Methods of Proof
• Direct proof
• Indirect proof
• Vacuous proof
• Trivial proof
• Proof by contradiction
• Proof by cases
• Existence proof
http://fskik.upsi.edu.my

Proof Basics

• We want to establish the p q p q


truth of p  q T T T
T F F
• p may be a conjunction of
other hypotheses F T T
F F T
• p  q is a conjecture until a
proof is produced
http://fskik.upsi.edu.my

Direct Proof
• Assume the hypotheses are true
• Use rules of inference and any logical
equivalences to establish the truth of the
conclusion
• HOW TO PROVE:
– If p is true ,then q has to be true for p—>q to be
true
• Example: The proof we did earlier about
cows not eating artichokes was an example
of a direct proof
http://fskik.upsi.edu.my

Example

• Give a direct proof of the theorem: “If n is


an odd integer, then n2 is an odd integer”
(n is odd)  (n2 is odd)
• Using the following definition:
– If n is even, then exist an integer k such that
n=2k, and It is odd, if there exist and integer k
such that n=2k+1.
http://fskik.upsi.edu.my

Example (Cont)
• Assume the hypothesis “n is odd” true:
– n is odd
• Since n is odd, then k n=2k+1
• Now, is the conclusion “n2 is odd” true?
• n2 = (2k+1)2 = 4k2 +4k +1
= 2(2k2+2k)+1
= 2 (m) +1, where some integer m=2k2+2k

• Since n2 = 2(m)+1, then “n2 is odd” is true


• Proof complete
http://fskik.upsi.edu.my

Indirect Proof

• A direct proof of the contrapositive


– Remember: pq is equivalent to ~q  ~p
–Proof ~q  ~p
• Assume that q is true i.e., q is false
• Use rules of inference and logical
equivalences to show that p is true
i.e., p is false
http://fskik.upsi.edu.my

Example
• Give an indirect proof to the theorem “if
3n+2 is odd, then n is odd”
(3n+2 is odd)  (n is odd)

p: 3n+2 is odd, ~p: 3n+2 is even


q: n is odd, ~q: n is even

The contrapositive is:


~(n is odd)  ~ (3n+2 is odd) , in other words
(n is even)  (3n +2 is even)
http://fskik.upsi.edu.my

Example (Cont)
• Assuming the hypothesis (of the contra
positive) “n is even” true
• Then n=2k
• Now, is the conclusion (of the
contrapositive) “3n+2 is even” true?
3n+2 = 3(2k)+2=6k+2
=2(3k+1)
=2(m), where m =3k+1
• Then “3n+2 is even” is true
• Proof complete
http://fskik.upsi.edu.my

Vacuous Proof

• If we know one of the hypotheses in p is false then


pq is vacuously true.
• F  T and F  F are both true.
• Example:
– If I am both rich and poor, then hurricane Katrina was a mild
breeze.
– The hypotheses (pp) form a contradiction, therefore q
follows from the hypotheses vacuously.
• Sometimes used to proof theorems using UNIVERSAL
QUANTIFICATION
http://fskik.upsi.edu.my

Example

Show that P(0) is true where P(n): If n > 1, then n2 > n.

P(n): (n>1)  (n2 > n)


P(0): (0>1)  ( 02 > 0)

Since the hypothesis (0>1) is false, P(0) is automatically


true.
Note that we do not even pay attention to the conclusion
“02 > 0”
http://fskik.upsi.edu.my

Trivial Proof

• If we know q is true, then pq is true


• F  T and T  T are both true.
• Example:
– If it’s raining today then the empty set is a
subset of every set.
– The assertion is trivially true independent of the
truth value of p.
http://fskik.upsi.edu.my

Example

• Show that P(0) is true where P(n): If a  b > 0, then an


 bn.
P(n): (a  b > 0)  (an  bn)
P(0): (a b > 0)  (a0  b0), in other words
P(0): (a b > 0)  (1  1),

Since the conclusion (1  1) is true, hence P(0) is true.


Note that we do not even pay attention to the
hypothesis “(a b > 0) “
http://fskik.upsi.edu.my

Proof by Contradiction
Reductio ad absurdum
(reduction to the absurd )
• We want to proof that pq, but… what if we can proof
that ~p implies a contradiction (i.e., q is FALSE no matters
what, or an absurd)??
• Mathematical definition of the proof
– Find a contradiction q such that
pq  pF  T
• Consequently, if we show the contradiction, then the assumption
~p is wrong (FALSE), so p must be true
• To prove that p is true, you have to show that p leads to
a contradiction i.e., you have to prove that pF is true.
http://fskik.upsi.edu.my

Example

• Prove that √2 is irrational


– P: “√2 is irrational”
• What if ~p is true, “√2 is rational”
– Does this lead to a contradiction???
• If √2 is rational, then a,b integers such
that √2 =a /b (assuming r:”a and b have no
common factors”)
• √2 = a/ b , then 2 = a2/b2, then 2b2=a2
http://fskik.upsi.edu.my

Example cont

• Since a2=2 (b2), then a2 is even, therefore a is


even, then
• 2b2 = (2c)2, for some integer c
• 2b2=4c2, so b2=2c2
• Thus, b is even too.
• If a and b are even, then they have at least one
common factor (2), so the assumption r is
contradicted: p-> (r^~r)
• Therefore, ~p is false, p is true
» “√2 is irrational is true
http://fskik.upsi.edu.my

Proof by Contradiction
(Cont..)
• An indirect proof of an implication pq can be
rewritten as a proof by contradiction.
• In such proofs, firstly assume the negation of conclusion,
i.e., q.
• Assume that both p and q are true.
• Then use a direct proof to show that
q  p
• This leads to the contradiction pp.
• HOMEWORK. Example 22 (pg 67) If 3n+2 is odd, then n
is odd.
http://fskik.upsi.edu.my

Example cont
• Prove “if 3n+2 is odd, then n is odd”.
– (3n+2 is odd)  (n is odd)
p  q
– p: 3n+2 is odd, ~p: 3n+2 is even
– q: n is odd, ~q: n is even
• Assume both p and q are true.
– 3n+2 is odd  n is even.
http://fskik.upsi.edu.my

Example cont
• Then n=2k, this implies
– 3n+2 = 3(2k) +2
= 6k+2
= 2(3k+1)
= 2(t) , where some integer t=3k+1

• Therefore 3n+2 is even, i.e., p is true.


• Because both p and p are true, this leads to
the contradiction pp  F.
• F  q  T.
• Proof complete by contradiction, proving that
if 3n+2 is odd, then n is odd.
http://fskik.upsi.edu.my

Proof by Cases
• Break the premise of pq into an equivalent
disjunction of the form p1p2pn
• Then use the equivalence
[(p1p2pn)  q]  [(p1q)(p2 q)   (pnq)]
• Each of the implications pi q is a case.
• You must
– Convince the reader that the cases are inclusive (i.e., they
exhaust all possibilities)
– Establish all implications
http://fskik.upsi.edu.my

Proof by Cases (Cont..)

• If n is an integer, then n2+1 is positive.


p: n is an integer
q: n2+1 is positive
• p  (p1p2p3)
where, p1: n = 0
p2: n > 0
p3: n < 0
• Now prove that ((p1q)(p2 q)(p3 q)) is true
i.e., all the cases (p1q), (p2 q), and (p3 q) are
true.
http://fskik.upsi.edu.my

Proving an equivalence

• To prove that pq, you need to show that


pq is a tautology.
• You can do that by showing that pq and
qp are both true since,
pq  [(pq)(qp)]
• Example: The integer n is odd if and only if
n2 is odd.
http://fskik.upsi.edu.my

Existence Proof
• The proof of xP(x) is called an existence proof.
– Constructive
– Non-constructive
• Constructive existence proof
– Find an element c in the universe of discourse such
that P(c) is true
• Non-constructive existence proof
– Do not find c, rather, somehow prove xP(x) is true
– Generally, by contradiction
• Assume no c exists that makes P(c) true
• Derive a contradiction
http://fskik.upsi.edu.my

Exercise 1
• Prove that if m+n and n+p are even
integers, then m+p is even.
http://fskik.upsi.edu.my

Exercise 2
• Prove that if m and n are integers and mn is
even, then m is even or n is even.

Vous aimerez peut-être aussi