5 Inductive Proofs
-
Upload
hassan-alashour -
Category
Documents
-
view
4 -
download
0
description
Transcript of 5 Inductive Proofs
11/9/2008 1
College of Information Technology
Discrete Structures
Slides for a Course Based on the TextSlides for a Course Based on the TextDiscrete Mathematics & Its ApplicationsDiscrete Mathematics & Its Applications
(6(6thth Edition)Edition)
11/9/2008 2
Inductive Proofs
Rosen 6Rosen 6thth ed., ed., §§4.14.1
11/9/2008 3
§4.1: Mathematical Induction
•• A powerful, rigorous technique for proving A powerful, rigorous technique for proving that a predicate that a predicate PP((nn) is true for ) is true for everyeverynatural number natural number nn, no matter how large., no matter how large.
•• Essentially a Essentially a ““domino effectdomino effect”” principle.principle.•• Based on a predicateBased on a predicate--logic inference rule: logic inference rule:
PP(0)(0)∀∀nn≥≥00 ((PP((nn))→→PP((nn+1))+1))∴∀∴∀nn≥≥00 PP((nn))
“The First Principleof Mathematical
Induction”
11/9/2008 4
The “Domino Effect”
01
23
45
6
•• Premise #1:Premise #1: Domino #0 falls.Domino #0 falls.•• Premise #2:Premise #2: For every For every nn∈∈NN,,
if domino #if domino #nn falls, then so falls, then so does domino #does domino #nn+1.+1.
•• Conclusion:Conclusion: All ofAll ofthe dominoes fall the dominoes fall down!down!
Note:this works
even if thereare infinitely
many dominoes!
11/9/2008 5
•• The The principle of mathematical inductionprinciple of mathematical inductionis a useful tool for proving that a certain is a useful tool for proving that a certain predicate is true for predicate is true for all natural numbersall natural numbers..
•• It cannot be used to discover theorems, but It cannot be used to discover theorems, but only to prove them.only to prove them.
11/9/2008 6
•• If we have a propositional function If we have a propositional function P(nP(n), and we ), and we want to prove that want to prove that P(nP(n) is true for any natural ) is true for any natural number n, we do the following:number n, we do the following:
•• Show that P(0) is true.Show that P(0) is true.(basis step)(basis step)
•• Show that if Show that if P(nP(n) then ) then P(nP(n + 1) for any + 1) for any nn∈∈NN..(inductive step)(inductive step)
•• Then Then P(nP(n) must be true for any ) must be true for any nn∈∈NN. . (conclusion)(conclusion)
11/9/2008 7
Induction Example
•• Show that n < 2Show that n < 2nn for all positive integers n.for all positive integers n.
•• Let Let P(nP(n) be the proposition ) be the proposition ““n < 2n < 2nn..””
•• 1. Show that P(1) is true.1. Show that P(1) is true.(basis step)(basis step)
•• P(1) is true, because 1 < 2P(1) is true, because 1 < 211 = 2.= 2.
11/9/2008 8
Induction Example 1
•• 2. Show that if 2. Show that if P(nP(n) is true, then ) is true, then P(nP(n + 1) is true.+ 1) is true.(inductive step)(inductive step)
•• Assume that n < 2Assume that n < 2nn is true.is true.•• We need to show that We need to show that P(nP(n + 1) is true, i.e.+ 1) is true, i.e.•• n + 1 < 2n + 1 < 2n+1n+1
•• We start from n < 2We start from n < 2nn::•• n + 1 < 2n + 1 < 2nn + 1 + 1 ≤≤ 22nn + 2+ 2nn = 2= 2n+1n+1
•• Therefore, if n < 2Therefore, if n < 2nn then n + 1 < 2then n + 1 < 2n+1n+1
11/9/2008 9
Induction Example 1
•• Then Then P(nP(n) must be true for any positive ) must be true for any positive integer.integer.(conclusion)(conclusion)
•• n < 2n < 2nn is true for any positive integer.is true for any positive integer.
•• End of proof.End of proof.
11/9/2008 10
Induction Example 2
1 + 2 + 1 + 2 + …… + n = n (n + 1)/2+ n = n (n + 1)/2
•• Show that P(0) is true.Show that P(0) is true.(basis step)(basis step)
•• For n = 0 we get 0 = 0. For n = 0 we get 0 = 0. True.True.
11/9/2008 11
Induction Example 2
•• Show that if Show that if P(nP(n) then ) then P(nP(n + 1) for any + 1) for any nn∈∈NN. . (inductive step)(inductive step)
•• 1 + 2 + 1 + 2 + …… + n = n (n + 1)/2+ n = n (n + 1)/2•• 1 + 2 + 1 + 2 + …… + n + n + (n + 1)+ (n + 1) = n (n + 1)/2 = n (n + 1)/2 + (n + 1)+ (n + 1)•• = (2n + 2 + n (n + 1))/2= (2n + 2 + n (n + 1))/2•• = (2n + 2 + n= (2n + 2 + n22 + n)/2+ n)/2•• = (2 + 3n + n= (2 + 3n + n2 2 )/2)/2•• = (n + 1) (n + 2)/2= (n + 1) (n + 2)/2•• = = (n + 1)(n + 1) (((n + 1)(n + 1) + 1)/2+ 1)/2
11/9/2008 12
Induction Example 2
•• Then Then P(nP(n) must be true for any ) must be true for any nn∈∈NN. . (conclusion)(conclusion)
•• 1 + 2 + 1 + 2 + …… + n = n (n + 1)/2 is true for all + n = n (n + 1)/2 is true for all nn∈∈NN..
•• End of proof.End of proof.
11/9/2008 13
Outline of an Inductive Proof
•• Let us say we want to prove Let us say we want to prove ∀∀nn PP((nn))……–– Do the Do the base casebase case (or (or basis stepbasis step): Prove ): Prove PP(0)(0)..–– Do the Do the inductive stepinductive step: Prove : Prove ∀∀nn PP((nn))→→PP((nn+1)+1)..
•• E.g.E.g. you could use a direct proof, as follows:you could use a direct proof, as follows:•• Let Let nn∈∈NN, assume , assume PP((nn)). (. (inductive hypothesisinductive hypothesis))•• Now, under this assumption, prove Now, under this assumption, prove PP((nn+1)+1)..
–– The inductive inference rule then gives usThe inductive inference rule then gives us∀∀nn PP((nn))..
11/9/2008 14
Induction Example 3
•• Prove that the sum of the first Prove that the sum of the first nn odd odd positive integers is positive integers is nn22. That is, prove:. That is, prove:
•• Proof by induction.Proof by induction.–– Base case: Let Base case: Let nn=1. The sum of the first 1 odd =1. The sum of the first 1 odd
positive integer is 1 which equals 1positive integer is 1 which equals 122..(Cont(Cont……))
2
1)12(:1 nin
n
i=−≥∀ ∑
=
P(n)
11/9/2008 15
Example 3 cont.
•• Inductive step: Prove Inductive step: Prove ∀∀nn≥≥1: 1: PP((nn))→→PP((nn+1)+1)..–– Let Let nn≥≥1, assume 1, assume PP((nn)), and prove , and prove PP((nn+1)+1)..
2
2
1
1
1
)1(12
)1)1(2()12()12(
+=
++=
−++⎟⎠
⎞⎜⎝
⎛−=− ∑∑
=
+
=
nnn
niin
i
n
iBy inductive
hypothesis P(n)
11/9/2008 16
Induction Example 4
Prove that Prove that 11⋅⋅1! + 21! + 2⋅⋅2! + 2! + …… + + nn⋅⋅nn! = (n+1)! ! = (n+1)! -- 1, 1, ∀∀nnBase case (n= 1): Base case (n= 1): 11⋅⋅1! = (1+1)! 1! = (1+1)! -- 1?1?
11⋅⋅1! = 1, 2! 1! = 1, 2! -- 1 = 11 = 1Assume Assume P(kP(k): ): 11⋅⋅1! + 21! + 2⋅⋅2! + 2! + …… + + kk⋅⋅kk! = (k+1)! ! = (k+1)! -- 11Prove that Prove that 11⋅⋅1! + 1! + …… + + kk⋅⋅kk! + (k+1)(k+1)! = (k+2)! ! + (k+1)(k+1)! = (k+2)! -- 1111⋅⋅1! + 1! + …… + + kk⋅⋅kk! + (k+1)(k+1)! = (k+1)! ! + (k+1)(k+1)! = (k+1)! -- 1 + (k+1)(k+1)!1 + (k+1)(k+1)!
= (1 + (k+1))(k+1)! = (1 + (k+1))(k+1)! -- 11= (k+2)(k+1)! = (k+2)(k+1)! -- 11= (k+2)! = (k+2)! -- 11
11/9/2008 17
Second Principle of InductionA.k.a. “Strong Induction”
•• Characterized by another inference rule:Characterized by another inference rule:PP(0)(0)∀∀nn≥≥0: (0: (∀∀00≤≤kk≤≤nn PP((kk)) )) →→ PP((nn+1)+1)∴∴∀∀nn≥≥0: 0: PP((nn))
•• The only difference between this and the The only difference between this and the 1st principle is that:1st principle is that:–– the inductive step here makes use of the the inductive step here makes use of the
stronger hypothesis that stronger hypothesis that PP((kk)) is true for is true for allallsmaller numbers smaller numbers k<nk<n+1+1,, not just for not just for kk==nn..
11/9/2008 18
Second Principle of Induction
•• Show that P(0) is true.Show that P(0) is true.(basis step)(basis step)
•• Show that if P(0) and P(1) and Show that if P(0) and P(1) and …… andand P(nP(n),),then then P(nP(n + 1) for any + 1) for any nn∈∈NN..(inductive step)(inductive step)
•• Then Then P(nP(n) must be true for any ) must be true for any nn∈∈NN. . (conclusion)(conclusion)
11/9/2008 19
Second Principle of InductionExample
•• Example: Show that every integer greater Example: Show that every integer greater than 1 can be written as the product of than 1 can be written as the product of primes.primes.
•• Show that P(2) is true.Show that P(2) is true.(basis step)(basis step)
•• 2 is the product of one prime: itself.2 is the product of one prime: itself.
11/9/2008 20
Second Principle of InductionExample cont.
•• Show that if P(2) and P(3) and Show that if P(2) and P(3) and …… andand P(nP(n),),then then P(nP(n + 1) for any + 1) for any nn∈∈NN. . (inductive step)(inductive step)
•• Two possible cases:Two possible cases:•• If (n + 1) is If (n + 1) is primeprime, then obviously , then obviously P(nP(n + 1) is true.+ 1) is true.•• If (n + 1) is If (n + 1) is compositecomposite, it can be written as the product of , it can be written as the product of
two integers a and b such thattwo integers a and b such that2 2 ≤≤ a a ≤≤ b < n + 1.b < n + 1.
•• By the By the induction hypothesisinduction hypothesis, both a and b can be , both a and b can be written as the product of primes.written as the product of primes.
•• Therefore, n + 1 = Therefore, n + 1 = aa⋅⋅bb can be written as the product of can be written as the product of primes.primes.
11/9/2008 21
Second Principle of InductionExample cont.
•• Then Then P(nP(n) must be true for any ) must be true for any nn∈∈NN. . (conclusion)(conclusion)
•• End of proof.End of proof.
•• We have shown that We have shown that every integer greater every integer greater than 1than 1 can be written as the product of can be written as the product of primes.primes.