Induction proofs

of 25 /25
1 Induction proofs To prove that some proposition P (n) is true for all n n 0 by induction on n n 0 . Basis : Check that P (n 0 ) is true. 2. Inductive step . Assume that P (n ) is true for n = k , where k is some integer, k n 0 Prove that P (n) is true for n = k +1 , in inductive step we prove that for any n n 0 P (n) P (n+1) lly this is simpler than prove directly that for an ).

Embed Size (px)

description

Induction proofs. To prove that some proposition P ( n ) is true for all n  n 0 by induction on n  n 0. 1. Basis : Check that P ( n 0 ) is true. 2. Inductive step . Assume that P ( n ) is true for n = k , where k is some integer, k  n 0 - PowerPoint PPT Presentation

Transcript of Induction proofs

  • Induction proofs To prove that some proposition P (n) is true for all n n0 by induction on n n0 1. Basis : Check that P (n0) is true.2. Inductive step. Assume that P (n ) is true for n = k , where k is some integer, k n0 Prove that P (n) is true for n = k +1So, in inductive step we prove that for any n n0 P (n) P (n+1)Usually this is simpler than prove directly that for any n n0 P (n).

  • Example. Let P (n) : n3n is divisible by 6 To prove that P (n) is true for all n 0:1. Basis. P (0): 03 0=0 is divisible by 6. P (0) is true 2. Inductive step P (n =k ) P (n =k +1), k 0. Assume P (n =k ) is true, where k is some integer, k 0. So, we assume that k 3 k is divisible by 6 i.e. k 3 k = 6 s (s is any integer)Goal: to prove that P (n =k +1) is true, i. e. that(k +1)3 (k +1) is divisible by 6.(k +1)3 (k +1) = k 3 +3 k2 + 3 k +1 k 1 = = (k 3 k ) + 3 k2 + 3 k = = 6 s + 3 k (k +1)

  • Suppose we want to prove the formula for the sum of geometric progressionHow can we prove that the formula is correct for any n0 ?

  • Show it for some n0 (prove P (n) for any n directly)

  • 1) Base: n=0 2) Induction Hypothesis: Assume the formula is correct for n=k, where k is some integer, k0 Induction Step: prove the formula for n=k+1, i. e.

  • Induction Principle . If A is a subset of N that satisfies twoproperties:1) n0 A 2) n n0 [n A(n+1)A], then A =N We just can think about A as a set of integers, that satisfy P:A ={nN | P (n)}Then,1) n0 A P (n0 ) 2) n n0 [nA(n+1)A] n n0 (P(n) P (n +1))

  • Although it sounds very obvious, the induction principle hinges on the property of integers, so called Well-Ordering principle (accept it as an axiom). Well-Ordering Principle. Any nonempty subset of N contains a smallest element. Neither rational, no real numbers has this property!Induction principle is equivalent to the Well-ordering principle.

  • Theorem. Well-ordering principle (WOP) implies Induction Principle(IP)Proof. Suppose WOP is true, i.e. any nonempty subset of N contains a smallest element. We want to prove that IP is true, i. e. if any set A satisfies propertiesi) 0Aii) n 0 [nA(n+1)A], then A =N.

  • We are going to prove it by contradiction. 1) Assume that A satisfies both properties, but A N . 2) Then N A = B , i. e. B is nonempty subset of N .3) By WOP B contains the smallest element. Let denote it s, s B, so sA. 4) Since s is the smallest element of B, s1B. 5) Since 0A by i), 0B, so s >0 and s1 0, i. e. s1N.6) s1N and s1B imply s1A .7) By ii) s1A sA , contradiction with sA.

  • n012...i) 0A A = {n N | P(n)} ii) n 0 [nA(n+1)A]Proof by contradiction:Assume that A N. s 1 A, since s is the smallest in contradiction with sB

  • Example. Prove that the number of different binary strings of length n is 2n.Proof by induction on n1.We want to prove: n1 [P (n)], where P (n): the number of binary strings of length n is 2n. 1) Basis. n=1. We have two strings of the length one: 0 and 1.2) Assume P (n) for n=k, where k is some integer, k 1 (IH).So, we assume that for some k 1 there are 2k binary strings.In the IS we need to prove P (n) for n=k+1I. e. we need to show that there are 2(k+1) binary stringsof the length (k +1).

  • Here is the proof that there are 2(k+1) binary strings of length (k+1).Any binary string of length (k+1) can be represented as a binarystring of length k with one extra bit (let it be the last one). There are two choices for the last bit: 0 or 1. By IH there are 2k strings of length k. Then, we have 2k strings of length (k+1) that end with 0 and 2k strings of length (k+1) that end with 1, so the total number is 2k + 2k =2 2k =2(k+1) QED. By IP we conclude, that for any n 1 the number of binary strings is 2n.

  • Lets use the induction to prove the following known fact. Example. Prove that for any set A cardinality of a power set is |Power(A)|=2|A|.To apply induction we need to chose the integer variable.Here we can prove by induction on n = |A|. So, we want to prove that the propositionP : |Power(A)|=2|A| is true for any n=|A| 0.1) Basis: n=|A|=0, A= , There is only one subset of the empty set, so |Power()|=1=202) IH: Assume that for n=k, k is any integer k 0, we have that any set A with |A|=k has 2k subsets. IS: we need to imply that any set B with cardinality |B|=k+1 has the property P, i. e. has 2(k+1) subsets.

  • Here we need to do the jobTake any set B of k+1 elements. Pick any element x. Then all subsets of B can be divided into two parts: i) subsets that do not contain x. How many such subsets exist? We can argue, that subsets of B that do not contain x constitute subsets of the set B {x}, that has cardinality k. | B {x}| = k and by IH there exist 2k subsets.ii) subsets that include x. How many such subsets exist?Again, the number of such subsets equals the number of Subsets of the set B {x}, this number is 2k. Now, the total number of subsets is the sum of two groups, 2k + 2k =2 2k= 2k+1. So, from assumption that the proposition is true for n=k ( k is any integer k 0) we can imply that the proposition is true for n =k+1.By Induction principle we conclude that the proposition is true for all integer n 0, i. e. for sets of any size |A|=n.

  • What is wrong with the following reasoning? All horses are the same color P (n): n horses are the same color Basis. P (1)=true.IS . Assume that for some k 1 P (k) is true. We need to prove that P (k +1) is true.

  • You are given a board divided into mm equal squares, where m is a power of 2. One arbitrary square is distinguished as special. Prove that with exception of one special square that may be arbitrarily located on the board, the board can be always covered with L-shaped tiles.Tiling problem.A special square

  • Proof by induction on k1, where m=2k is the side of the board.

  • Induction Hypothesis. Assume that for a board of 2k2k squares the tiling problem can be solved, i.e. for arbitrary location of a special square the board can be covered by L-shaped tiles. In induction step we need to prove that the tiling can be solved for the board of 2k+12k+1 squares.

  • In accordance with IH, tiling problem can be solved for each of these four boards for arbitrary positions of special squares. In particular, it means that we can choose three of specials around the center, so that to use additional tile for them. The remaining special can be placed anywhere and in this way we proved that tiling problem can be solved for a 2k+12k+1 - board.

  • Induction and Recursion. Explicit definitionRecursive definition Factorial Geometric progression Power of relation on a set

  • The recursive definition of a function makes reference to earlier versions of itself. The main connection between recursion and induction is that objects are defined by means of a natural sequence. Induction is usually the best (possibly the only) way to prove results about recursively defined objects.

  • The sequence named for Fibonacci (1202) is introduced in terms of rabbits. Suppose that every month a breeding pair of rabbits produce a pair of offspring. The offspring in turn start breeding two months later, and so on. Denote Fn the number of pairs in month n. Suppose you buy a pair of rabbits in month 1 (F0=0, F1=1) then you still have one pair in month 2 (F2=1), but in month 3 they start breeding, F3=2. The sequence begins 0, 1, 1, 2, 3, 5, 8, 13, 21, You can observe, that in a month n you have all pairs from the previous month (n1), plus offspring pairs for all pairs from month (n2), i. e. :Fibonacci Numbers

  • Proof by induction on n 0.So, Fibonacci numbers can be defined recursively: These numbers have numerous applications in CS, mathematics, theory of games.