Mathematical Induction MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 1 / 21
Outline 1 Mathematical Induction 2 Strong Mathematical Induction MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 2 / 21
Motivation How many multiplications will carried out by the following code fragment? c = 0 for i in range (10): for j in range (5): c = c + a[ i] * b[ j] MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation How many multiplications will carried out by the following code fragment? c = 0 for i in range (10): for j in range (5): c = c + a[ i] * b[ j] outer-loop body executed 10 times inner-loop body executed 5 times for each outer-loop execution one multiplication per each inner-loop body execution MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation How many multiplications will carried out by the following code fragment? c = 0 for i in range (10): for j in range (5): c = c + a[ i] * b[ j] outer-loop body executed 10 times inner-loop body executed 5 times for each outer-loop execution one multiplication per each inner-loop body execution The number of multiplications can be computed as 10 5 = 50 multiplications. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 3 / 21
Motivation Now consider this slightly different code fragment. How many multiplications are done? c = 0 for i in range (10): for j in range (i): c = c + a[ i] * b[ j] MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation Now consider this slightly different code fragment. How many multiplications are done? c = 0 for i in range (10): for j in range (i): c = c + a[ i] * b[ j] outer-loop body executed 10 times inner-loop body executed a different number of times for each outer-loop execution one multiplication per each inner-loop body execution MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation Now consider this slightly different code fragment. How many multiplications are done? c = 0 for i in range (10): for j in range (i): c = c + a[ i] * b[ j] outer-loop body executed 10 times inner-loop body executed a different number of times for each outer-loop execution one multiplication per each inner-loop body execution This time the number of multiplications can be computed with a sum: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 multiplications MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 4 / 21
Motivation Finally, suppose we wanted to generalize this. Assuming n is provided through some user input, our code fragment might be c = 0 for i in range (n): for j in range (i): c = c + a[ i] * b[ j] Some experimentation might lead us to suspect that we can count the multiplications with 1 + 2 + 3 + + n = n(n + 1) 2 This works for all the cases we try, but how can we know it works for all n > 0? MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 5 / 21
Mathematical Induction This sort of problem is solved using mathematical induction. Some key points: Mathematical induction is used to prove that each of list of statements is true. Often this list is countably infinite (i.e. indexed by the natural numbers). It consists of two parts: (1) a basis step and (2) an inductive step. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 6 / 21
Mathematical Induction Here is a list of statements corresponding to the sum we are interested in. S 1 : 1 = (1)(1 + 1)/2 S 2 : 1 + 2 = (2)(2 + 1)/2 S 3 : 1 + 2 + 3 = (3)(3 + 1)/2.. S n 1 : 1 + 2 + 3 + + (n 1) = (n 1)((n 1) + 1)/2 S n : 1 + 2 + 3 + + (n 1) + n = (n)(n + 1)/2 Notice that the list is finite as it contains n statements. However, proving all these are true for any positive integer n means that we have proved an infinite number of statements. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 7 / 21
Mathematical Induction As suggested in our text, using mathematical induction is a bit like setting up cascading dominos: We begin by proving S 1 is true. This is the basis step. We next show that S k S k+1 for k 1. This is the inductive step. We now know that S 1 S 2. But as soon as S 2 is known to be true we can say S 2 S 3. But then S 3 S 4, S 4 S 5, S 5 S 6,... MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 8 / 21
Mathematical Induction Proof Proposition 1 + 2 + + n = n(n + 1) 2 for any n N. Proof. We prove this by mathematical induction. (Basis Step) When n = 1 we find 1 = 1(1 + 1) 2 so the statement is true when n = 1. = 2 2 = 1 MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 9 / 21
Mathematical Induction Proof Proof. (Continued) (Inductive Step) We now want to show that if 1 + 2 + + k = k(k + 1) 2 for some k N then 1 + 2 + + k + (k + 1) = (k + 1)((k + 1) + 1) 2 = (k + 1)(k + 2). 2 (Note: Stating this does not prove anything, but is very helpful. It forces us to explicitly write what we are going to prove, so both we (as prover) and the reader know what to look for in the remainder of the inductive step.) MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 10 / 21
Mathematical Induction Proof Proof. (Continued) Suppose 1 + 2 + + k = k(k + 1) 2 for some k N. Then k(k + 1) 1 + 2 + + k = 2 k(k + 1) 1 + 2 + + k + (k + 1) = + (k + 1) 2 k(k + 1) 2(k + 1) 1 + 2 + + k + (k + 1) = + 2 2 k(k + 1) + 2(k + 1) 1 + 2 + + k + (k + 1) = 2 (k + 1)(k + 2) 1 + 2 + + k + (k + 1) = 2 It follows by induction that 1 + 2 + + n = n(n + 1) 2 for all n N. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 11 / 21
Mathematical Induction Logic Notice that mathematical induction is an application of Modus Ponens: (S 1 ) ( k N, (S k S k+1 )) ( n N, S n ) Some notes: The actual indexing scheme used is unimportant. For example, we could start with S 0, S 2, or even S 1 rather than S 1. The key is that we start with a specific statement, and then prove that any one statements implies the next. To prove something about statements indexed by the integers, the inductive step would include two parts S k S k+1 and S k S k 1. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 12 / 21
Example 2 Proposition Show that 3 (n 3 n) whenever n is a positive integer. Proof. We use mathematical induction. When n = 1 we find n 3 n = 1 1 = 0 and 3 0 so the statement is proved for n = 1. Now we need to show that if 3 (k 3 k) for some integer k > 0 then 3 ((k + 1) 3 (k + 1)). MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 13 / 21
Example 2 Proof. (Continued) Suppose that 3 (k 3 k). Then (k 3 k) = 3a for some integer a. Then, starting with (k + 1) 3 (k + 1), we find (k + 1) 3 (k + 1) = k 3 + 3k 2 + 3k + 1 k 1 = (k 3 k) + 3k 2 + 3k = 3a + 3k 2 + 3k = 3(a + k 2 + k). By the closure properties of integers we know that a + k 2 + k is an integer so we see that (k + 1) 3 (k + 1) is a multiple of 3. Then, by definition, 3 ((k + 1) 3 (k + 1)). It follows by induction that 3 (n 3 n) for all integers n > 0. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 14 / 21
Strong Mathematical Induction Sometimes it is helpful to use a slightly different inductive step. In particular, it may be difficult or impossible to show S k S k+1 but easier (or possible) to show that (S 1 S 2 S k ) S k+1. In other words, assume that all statements from S 1 to S k have been proved and use some combination of them to prove S k+1. This is called strong mathematical induction. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 15 / 21
Strong Mathematical Induction Example Proposition Any integer n > 11 can be written in the form n = 4a + 5b for a, b Z. Proof. We use mathematical induction. We note that S 12 : 12 = 4(3) + 5(0) S 13 : 13 = 4(2) + 5(1) S 14 : 14 = 4(1) + 5(2) S 15 : 15 = 4(0) + 5(3) which shows that 12, 13, 14, and 15 can all be written in the form 4a + 5b. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 16 / 21
Strong Mathematical Induction Example Proof. (Continued) Now, suppose that S k 3, S k 2, S k 1, and S k have all been proved. This means that S k 3 is true, so we know that k 3 = 4a + 5b for some integers a and b. Adding 4 to both sides we have k 3 + 4 = 4a + 5b + 4 k + 1 = 4(a + 1) + 5b so S k+1 must be true. This means that S 12 S 16, S 13 S 17, S 14 S 18, S 15 S 19, S 16 S 20,..., completing the induction. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 17 / 21
Another Mathematical Induction Example Proposition 9 (10 n 1) for all integers n 0. Proof. (By induction on n.) When n = 0 we find 10 n 1 = 10 0 1 = 0 and since 9 0 we see the statement holds for n = 0. Now suppose the statement holds for all values of n up to some integer k; we need to show it holds for k + 1. Since 9 (10 k 1) we know that 10 k 1 = 9x for some x Z. Multiplying both sides by 10 gives 10 (10 k 1) = 10 9x 10 k+1 10 = 9 10x 10 k+1 1 = 9 10x + 9 = 9 (10x + 1) which clearly shows that 9 (10 k+1 1). This completes the induction. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 18 / 21
Proof by Smallest Counterexample As already noted, mathematical induction is well suited for statements of the form n N, P(n). 1 Our text introduces an approach called proof by smallest counterexample and illustrates it with a problem similar to the one we just completed. 2 Basic idea is to assume the inductive hypothesis holds for all values of n up to some particular value k but that it fails for k + 1 and then show that this leads to a contradiction. 3 While that does work for the proof we just completed, a direct proof of the inductive hypothesis like the one shown is more straightforward. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 19 / 21
Fibonacci Numbers The Fibonacci sequence is defined as the sequence starting with F 1 = 1 and F 2 = 1, and then recursively as F n = F n 1 + F n 2. The Fibonacci sequence starts off with 1, 1, 2, 3, 5, 8, 13, 21, 34,.... MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 20 / 21
Fibonacci Numbers Proposition Prove that F 1 + F 2 + F 3 + + F n = F n+2 1 for n 2. Proof. We use induction. As our basis step, notice that F 1 + F 2 = F 4 1 since F 1 + F 2 = 1 + 1 = 2, and F 4 1 = 3 1 = 2. Suppose that F 1 + F 2 + + F k = F k+2 1. Adding F k+1 on both sides gives F 1 + F 2 + + F k + F k+1 = F k+2 1 + F k+1 = F k+1 + F k+2 1 which completes the induction. = F k+3 1. MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 21 / 21