1 / 25

Induction proofs

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

chibale
Download Presentation

Induction proofs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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 +1 So, 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).

  2. Example. Let P (n) : n3n 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 stepP (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)

  3. where , and n is any integer, n0 Notation: Two alternatives: • Show it for arbitrary fixed n0 (prove directly, without induction) • Use induction on n0 Suppose we want to prove the formula for the sum of ‘geometric progression’ How can we prove that the formula is correct for any n0 ?

  4. Show it for some n0 (prove P (n) for any n directly)

  5. Proof by induction on n0 that 1) Base: n=0 2) Induction Hypothesis: Assume the formula is correct for n=k, wherek is some integer, k0 Induction Step: prove the formula for n=k+1, i. e.

  6. ? • P (n0) • (n  n0)[P (n) P (n+1)] (n  n0)P (n) • Induction Principle . If A is a subset of N that satisfies two • properties: • 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 ={nN | P (n)} Then, 1) n0A  P (n0) 2) n  n0 [nA(n+1)A]   n n0 (P(n)  P (n +1))

  7. 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.

  8. 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 properties • i) 0A • ii) n  0 [nA(n+1)A], • then A =N.

  9. 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 sA. 4) Since s is the smallest element of B, s1B. 5) Since 0A by i), 0B, so s >0 and s1 0, i. e. s1N. 6) s1N and s1B imply s1A . 7) By ii) s1A  sA , contradiction with sA.

  10. B  B = N A sB (by WOP) s A by ii) sB, since B = N A Proof by contradiction: Assume that A  N. n A = {n N | P(n)} s 1 A, since s is the smallest . . . ii) n  0 [nA(n+1)A] 2 1 in contradiction with sB 0 i) 0A

  11. Example. Prove that the number of different binary strings of length n is 2n. Proof by induction on n1. We want to prove:  n1 [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+1 I. e. we need to show that there are 2(k+1) binary strings of the length (k +1).

  12. 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 binary string 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.

  13. Let’s 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 proposition P : |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=20 2) 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.

  14. Here we need to do the job…Take 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.

  15. k … k 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.

  16. Tiling problem. You are given a board divided into mm 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. A special square

  17. Basis: k=1, m=2. • It is clear, that for any position of a special square, the 22 board • can be covered by one tile: Proof by induction on k1, where m=2k is the side of the board.

  18. Such a board consists of 4 boards of 2k2k squares. 2k 22k=2k+1 2k 2k 2k Induction Hypothesis. Assume that for a board of 2k2k 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+12k+1 squares.  

  19. 2k 22k=2k+1 2k 2k 2k 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+12k+1 - board.

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

  21. 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.

  22. Example. Prove that for all positive integers m and n, Proof. Let m be arbitrary positive integer and then prove by induction on n 1. 1) Basis. n=1: (by recursive definition of Rm+1) 2) IH: Assume that for some k 1 we have IS: We need to prove that ……..definition of composition ….association of composition …..by IH ……..definition of composition

  23. , n  2 Fibonacci Numbers 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 (n1), plus offspring pairs for all pairs from month (n2), i. e. :

  24. Let’s prove the closed formula for the sum for all integers n  0 ? 1) Basis. Take n=0 and check that By the recurrent formula for n =2 we have , so F21=0 and F0=0. So, Fibonacci numbers can be defined recursively: These numbers have numerous applications in CS, mathematics, theory of games. Proof by induction on n  0.

  25. 2) IH: Assume that the summation formula is correct for n=k, where k is some integer k  0, i. e. IS: We need to prove that …………by IH ..by recurrence formula for (k+3) >1

More Related