module #15 – inductive proofs 12/6/2015(c)2001-2003, michael p. frank1 inductive proofs: a brief...

27
dule #15 – Inductive Proofs 06/27/22 (c)2001-2003, Michael P. Frank 1 Inductive Proofs: a brief introduction Rosen 5 Rosen 5 th th ed., §3.3 ed., §3.3 ~35 slides, ~1.5 lecture ~35 slides, ~1.5 lecture

Upload: kimberly-morgan

Post on 20-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 1

Inductive Proofs: a brief introduction

Rosen 5Rosen 5thth ed., §3.3 ed., §3.3~35 slides, ~1.5 lecture~35 slides, ~1.5 lecture

Page 2: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 2

§3.3: 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 everyevery natural natural number number nn, no matter how large., no matter how large.

• Essentially a “domino effect” principle.Essentially a “domino effect” principle.

• Based on this inference rule: Based on this inference rule: PP(0)(0)nn00 ((PP((nn))PP((nn+1))+1))nn00 P P((nn))

“The First Principleof Mathematical

Induction”

Page 3: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 3

The “Domino Effect”

01

2

34

56

• Premise #1:Premise #1: Domino #0 falls.Domino #0 falls.

• Premise #2:Premise #2: For every For every nnNN,,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!

Page 4: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 4

The “Domino Effect”

01

2

34

56…

• Premise #1:Premise #1: Domino #0 falls.Domino #0 falls.

• Premise #2:Premise #2: For every For every nnNN,,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!

Page 5: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 5

• First premiss: the First premiss: the basis stepbasis step (also: base case) (also: base case)

• Second premiss: the Second premiss: the induction stepinduction step

• Why is mathematical induction Why is mathematical induction validvalid??

Page 6: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 6

Validity of Induction

ProofProof that that k>k>0 0 PP((kk)) is a valid conclusion: is a valid conclusion:Consider any Consider any k>k>0. The 20. The 2ndnd premiss premiss nn00 ((PP((nn))PP((nn+1))+1)) implies that implies that ((PP(0)(0)PP(1)) (1)) ( (PP(1)(1)PP(2)) (2)) … … ( (PP((kk1)1)PP((kk)))). .

Premiss #1 says that P(0). One application of Premiss #1 says that P(0). One application of MModus Ponens odus Ponens (in combination with (in combination with ((PP(0)(0)PP(1))(1))) ) gives us gives us P(1);P(1); another gives us another gives us P(2)P(2) , and so on , and so on to to PP((kk) (using k steps of ) (using k steps of Modus PonensModus Ponens in total)). in total)). Thus Thus k>k>0 0 PP((kk)). . ■■

Page 7: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 7

The Well-Ordering Property

• A more general way to prove the validity of the A more general way to prove the validity of the inductive inference rule is by using the fact inductive inference rule is by using the fact that (N,that (N,) is a ) is a well-orderingwell-ordering::– Every non-empty set of natural numbers Every non-empty set of natural numbers

has a least (“smallest”) element.has a least (“smallest”) element. SSNN : : mmSS : : nnSS : : mmnn

• This implies that {This implies that {nn||PP((nn)} (if non-empty!) has )} (if non-empty!) has a min. element a min. element mm, but then the assumption that , but then the assumption that PP((mm−−11))PP((((mm−−11)+1))+1) would be contradicted. would be contradicted.

Page 8: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 8

Inductive Proofs have a fixed structure:

• Suppose we want to prove Suppose we want to prove nn PP((nn))……– BBasis stepasis step: Prove : Prove PP(0)(0)..– IInductive stepnductive 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:

• Assume Assume PP((nn)). (. (inductive hypothesis = IHinductive hypothesis = IH))

• Now, under this assumption, prove Now, under this assumption, prove PP((nn+1)+1)..

– If you manage to do all this, then the inductive If you manage to do all this, then the inductive inference rule gives us inference rule gives us nn PP((nn))..

Page 9: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 9

• Induction is like heridity:Induction is like heridity:

• ““If Adam had big feet, and big feet are If Adam had big feet, and big feet are heriditary then every person (except heriditary then every person (except possibly Eve) has/had big feet”possibly Eve) has/had big feet”

• (Note: what if a person’s feet can be just (Note: what if a person’s feet can be just slightly smaller than that of both of his slightly smaller than that of both of his parents?)parents?)

Page 10: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 10

Generalizing Induction slightly

• Rule can also be used to prove Rule can also be used to prove nncc PP((nn)) for a given constant for a given constant ccZZ, where maybe , where maybe cc0.0.– In this circumstance, the base case is to prove In this circumstance, the base case is to prove

PP((cc) rather than ) rather than PP(0), and the inductive step is to (0), and the inductive step is to prove prove nnc c ((PP((nn))PP((nn+1))+1))..

Page 11: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 11

Proof by induction (1st princ): a very simple example

• Theorem:Theorem: xxN N (x (x 0). 0). Proof:Proof:• Basis stepBasis step: : • Inductive stepInductive step::

Page 12: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 12

Proof by induction (1st princ): a very simple example

• Theorem:Theorem: xxN N (x (x 0). 0). Proof:Proof:• Basis stepBasis step: we show that : we show that 0000..

This is obvious, since This is obvious, since is reflexive. is reflexive.• Inductive stepInductive step: we show that: we show that

x (xx (x0 0 x+1 x+1 0).0).Induction Hypothesis (IH): Suppose Induction Hypothesis (IH): Suppose aa00. . Clearly, a+1 Clearly, a+1 a. a.Transitivity allows us to infer from these two Transitivity allows us to infer from these two propositions that propositions that a+1 a+1 0 0. . QEDQED

Page 13: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 13

Find the error

• ““Theorem”: All sets of horses are Theorem”: All sets of horses are ‘uniform’, in the sense that all their ‘uniform’, in the sense that all their elements have the same colour.elements have the same colour.

• Method: induction over the cardinality of Method: induction over the cardinality of the setthe set

• P(x): all sets of cardinality x are uniformP(x): all sets of cardinality x are uniform““Proof”:Proof”:• Basis stepBasis step: P(1) (This is trivial): P(1) (This is trivial)

Page 14: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 14

Find the error

• ““Theorem”: All sets of horses are Theorem”: All sets of horses are uniform uniform • Induction Hypothesis: Induction Hypothesis: P(n).P(n).

To prove: To prove: P(n+1). P(n+1). ProofProof::Consider a set S= {hConsider a set S= {h11,h,h22,…,h,…,hn+1n+1} of n+1 horses. } of n+1 horses.

Split S into its subsets A and B: Split S into its subsets A and B: A= {h A= {h11,h,h22,…h,…hnn}}

B= {h B= {h22,h,h33,…,h,…,hn+1n+1}}

Induction HypInduction Hyp implies that A is uniform and B is implies that A is uniform and B is uniform. Auniform. AB B , so A, so AB is uniform. B is uniform. QEDQED

Page 15: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 15

Second Example (1st princ.)

• Prove that Prove that the sum of the first 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 ninn

i

P(n)

Page 16: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 16

Example cont.

– Inductive stepInductive step: Prove : Prove nn1: 1: PP((nn))PP((nn+1)+1)..

Let Let nn1, assume 1, assume PP((nn) ) (IH)(IH) , and prove , and prove PP((nn+1)+1)..

2

2

1

1

1

)1(

12

)1)1(2()12()12(

n

nn

niin

i

n

i

By inductivehypothesis P(n)

Page 17: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 17

Proving the induction step of the first principle of m.i.

To prove the universally quantified To prove the universally quantified

statement statement nn1: 1: PP((nn))PP((nn+1) +1) , you do this:, you do this:

– Taking an arbitrary Taking an arbitrary n n , , you hypothesise you hypothesise P(n)P(n)– If this allows you to prove If this allows you to prove P(n+1)P(n+1) then you then you

have proved have proved nn1: 1: PP((nn))PP((nn+1)+1)

Page 18: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 18

Second Principle of Induction

• Characterized by another inference rule:Characterized by another inference rule:PP(0)(0)nn0: (0: (00kknn PP((kk)) )) PP((nn+1)+1)nn0: 0: PP((nn))

• The only difference between this and the 1st The only difference between this and the 1st principle is that: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 allall smaller numbers smaller numbers k<nk<n+1+1,, not just for not just for kk==nn..

P is true in all previous cases

A.k.a. “Strong Induction”

Page 19: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 19

Proving the induction step of the second principle of m.i.

To prove the universally quantified To prove the universally quantified

statement statement nn0: ((0: ((00kknn PP((kk)) )) PP((nn+1))+1))

you do this:you do this:

– Taking an arbitrary Taking an arbitrary nn0 0 , , you hypothesiseyou hypothesise 00kknn PP((kk))

– If this allows you to prove If this allows you to prove P(n+1)P(n+1) then you have then you have proved proved nn0: ((0: ((00kknn PP((kk)) )) PP((nn+1))+1))

Page 20: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 20

Example of Second Principle

TheoremTheorem: Show that every : Show that every nn>1 >1 can be written as a can be written as a product product ppii = = pp11pp22……ppss of prime numbers. of prime numbers. – Let Let PP((nn)=“)=“nn has has that propertythat property””

• Definition: Definition: xx is a is a prime numberprime number xx is only dividable by 1 and by is only dividable by 1 and by xx

• Base case:Base case: nn=2, let =2, let ss=1,=1, p p11=2.=2.• Inductive step:Inductive step: Let Let nn22. IH: assume . IH: assume 22kknn: : PP((kk))..

Consider Consider nn+1+1. If it’s prime, then let . If it’s prime, then let ss=1, =1, pp11==nn+1+1..Else …..Else …..

Page 21: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 21

Example of Second Principle

Theorem:Theorem: Show that every Show that every nn>1 can be written as a >1 can be written as a product product ppii = = pp11pp22……ppss of some series of of some series of ss prime prime numbers. numbers. – Let Let PP((nn)=“)=“nn has that property” has that property”

• Base case:Base case: nn=2, let =2, let ss=1,=1, p p11=2.=2.• Inductive step:Inductive step: Let Let nn22. IH: assume . IH: assume 22kknn: : PP((kk))..

Consider Consider nn+1+1. If it’s prime, then let . If it’s prime, then let ss=1, =1, pp11==nn+1+1..Else Else nn+1=+1=abab, where , where 11aann and and 11bbnn. Then (by IH) . Then (by IH) aa==pp11pp22……pptt and and bb==qq11qq22……qquu. Consequently, . Consequently, nn+1 = +1 = pp11pp22……ppt t qq11qq22……qquu, a product of , a product of ss==tt++uu primes. primes.

Page 22: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 22

Application to the cardinality of sets

• TheoremTheorem: for all finite sets A, : for all finite sets A, if |A|=n then P(A) = 2if |A|=n then P(A) = 2nn . . Proof:Proof:

• Base stepBase step: if |A|=0 then P(A) = 2: if |A|=0 then P(A) = 200=1.=1.Why?Why?

Page 23: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 23

Application to the cardinality of sets

• TheoremTheorem: for all finite sets A, : for all finite sets A, if |A|=n then P(A) = 2if |A|=n then P(A) = 2nn . . Proof:Proof:

• Base stepBase step: if |A|=0 then P(A) = 2: if |A|=0 then P(A) = 200=1.=1.Why? Why? P(P()={)={} and |{} and |{}|=1.}|=1.

Page 24: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 24

Application to the cardinality of sets

• TheoremTheorem: for all finite sets A, : for all finite sets A, if |A|=n then P(A) = 2if |A|=n then P(A) = 2nn . . Proof:Proof:

• Base stepBase step: if |A|=0 then P(A) = 2: if |A|=0 then P(A) = 200=1.=1.Why? Why? P(P()={)={} and |{} and |{}|=1.}|=1.

• I.H.:I.H.: suppose for every set A such that |A|=n, it suppose for every set A such that |A|=n, it holds that P(A) = 2nholds that P(A) = 2nThen consider any set B such that |B|=n+1. Then consider any set B such that |B|=n+1. To prove: |P(B)|=2To prove: |P(B)|=2n+1n+1

Page 25: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 25

Application to the cardinality of sets

• I.H.:I.H.: suppose for every set A such that |A|=n, it suppose for every set A such that |A|=n, it holds that P(A) = 2n . holds that P(A) = 2n . Then consider any set B such that |B|=n+1. Then consider any set B such that |B|=n+1. To prove:To prove: |P(B)|= |P(B)|=22n+1n+1

• ProofProof: B has twice as many subsets as A.: B has twice as many subsets as A.(Think of B as consisting of a set B’ such that |B’|(Think of B as consisting of a set B’ such that |B’|=|A|=n, plus one other element b. Every subset of =|A|=n, plus one other element b. Every subset of B’ comes in two flavours: one with and one B’ comes in two flavours: one with and one without b.)without b.) Thus, Thus, |P(B)| |P(B)| == 2.|P(A)| = 2.22.|P(A)| = 2.2nn

(because of IH) (because of IH) = 2= 2n+1n+1

Page 26: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 26

• Mathematical Induction is valid on all well-Mathematical Induction is valid on all well-ordered structures (as we have proven).ordered structures (as we have proven).

• We have seen examples where it is applied We have seen examples where it is applied to the structure to the structure (N,(N,). ). More generally, More generally, ({x({xZZ|x>n}, |x>n}, ).).

• Integers are everywhere, and this makes Integers are everywhere, and this makes Mathematical Induction very powerfulMathematical Induction very powerful

Page 27: Module #15 – Inductive Proofs 12/6/2015(c)2001-2003, Michael P. Frank1 Inductive Proofs: a brief introduction Rosen 5 th ed., §3.3 ~35 slides, ~1.5 lecture

Module #15 – Inductive Proofs

04/21/23 (c)2001-2003, Michael P. Frank 27

Something else: `Nonmathematical` induction

• We have talked about We have talked about mathematical mathematical induction.induction.• In physical sciences (and in ordinary life), In physical sciences (and in ordinary life),

people use a much less precise kind of people use a much less precise kind of inductive hypothesis to make inferences.inductive hypothesis to make inferences.

• E.g.: E.g.: “If the sun has come up every day up to a “If the sun has come up every day up to a given day, then it will come up the next day”given day, then it will come up the next day”. .

• You can’t prove that! Non-mathematical induction You can’t prove that! Non-mathematical induction may be highly plausible, but its induction step is may be highly plausible, but its induction step is never logically valid.never logically valid.