* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Chapter 2
Survey
Document related concepts
Georg Cantor's first set theory article wikipedia , lookup
Functional decomposition wikipedia , lookup
Abuse of notation wikipedia , lookup
Mathematical proof wikipedia , lookup
Big O notation wikipedia , lookup
Non-standard analysis wikipedia , lookup
Elementary mathematics wikipedia , lookup
Non-standard calculus wikipedia , lookup
Large numbers wikipedia , lookup
Hyperreal number wikipedia , lookup
Transcript
Chapter 2 Mathematical Induction 2.1 First Examples Suppose we want to find a simple formula for the sum of the first n odd numbers: 1 + 3 + 5 + . . . + (2n − 1) = n X (2k − 1). k=1 How might we proceed? The most natural approach is to do the calculation for several small values of n. Doing so, we find n=1: 1 X (2k − 1) = 1 k=1 n=2: 2 X (2k − 1) = 1 + 3 = 4 k=1 n=3: 3 X (2k − 1) = 1 + 3 + 5 = 9 k=1 n=4: 4 X (2k − 1) = 1 + 3 + 5 + 7 = 16. k=1 These examples lead us to the conjecture n X (2k − 1) = n2 . (2.1.1) k=1 Is our conjecture correct? It certainly agrees with the results obtained for n = 1, 2, 3, 4 above, but how do we know whether it is true for all n? No amount of computing will answer this question; what we need is a general argument - a proof. 1 2 CHAPTER 2. MATHEMATICAL INDUCTION Here is one elementary argument: Let S[n] = following sum is equal to 2S[n]: 1 + (2n − 1) + 3 + (2n − 3) + ... ... Pn k=1 (2k + (2n − 3) + + 3 + − 1). Then the (2n − 1) . 1 We have n columns with two numbers each, and each column sums o 2n. Thus 2S[n] = n · 2n = 2n2 , and hence S[n] = n2 . This example illustrates a common situation in which we want to establish an infinite number of statements, one for each natural number n. In the above example, a bit of clever grouping established the general result. Not surprisingly, the number of situations in which such an argument is possible is small. The Principle of Mathematical Induction will give us a general approach to obtaining proofs of statements like the above. We will discuss this general principle later in the section, once we have established some of the concepts necessary to formulate and explore a wider range of questions. 2.1.1 Defining sequences through a formula for the n-th term Definition 2.1.1. A sequence a of real numbers is a function from the set N0 of non-negative integers 0, 1, 2, 3, . . . to the set R of real numbers. We write either a[n] or an for the value of the function at n and call this value the n-th term of the sequence. We denote the entire sequence by a or {an }. Note that a[n] and an are two different notations for the n-th term of the sequence a. We will use them interchangeably (though we will be consistent within any example or proposition.) The former notation may help you remember that a is a function, and that each term is really the value of this function at one of the elements of the domain. It is also the notation we’ll use when we write Python programs. The latter notation is the traditional notation for terms in a sequence and will be used when we are not developing a program. Remark 1 (zero indexing). Some books define a sequence a to be a function whose domain is the set N of natural numbers 1, 2, 3, . . .. Perhaps this definition seems more natural, for then the first five terms are a1 , a2 , a3 , a4 and a5 rather than a0 , a1 , a2 , a3 and a4 . Our reason for starting at zero is that we will be programming in Python, and Python (and many other programming languages) use zero-indexed sequences. We want to make the notation in our examples compatible with the syntax we will use in our programs. Were we British, zero indexing might seem more natural; in a multi-story building, the ground floor is the zeroth floor and the first floor is the next one up. 2.1. FIRST EXAMPLES 3 Example 2.1.1. In the previous section, we considered the sequence S, where, for n ≥ 1, S[n] is the sum of the n odd numbers 1, 3, . . . , 2n − 1. It is reasonable to define S[0] to be the empty sum, so that S[0] = 0. We showed above that S[n] = n2 for n ≥ 1. This formula is also valid for n = 0, and thus we have a simple formula for the n-th term of the sequence S. Sometimes, as above, it is rather easy to guess a formula for the n-th term of a sequence by examining the first few terms. What can we try when it is not so obvious? It is sometimes helpful to look at the sequence of ratios or differences of consecutive terms, or the sequence of differences of consecutive terms in the sequences of differences, etc. We illustrate with some examples. Constant differences; arithmetic sequences. Consider the sequence {an } of all natural numbers for which the remainder when divided by 10 is 3. The first few terms of the sequence are a0 = 3, a1 = 13, a2 = 23, a3 = 33, . . . . Consider the sequence {dn } of differences of consecutive terms. Thus d0 = a1 − a0 = 13 − 3 = 10, d1 = a2 − a1 = 23 − 13 = 10, d3 = a4 − a3 = 33 − 23 = 10, and in general dn = an+1 − an = 10. The sequence {an } is an example of a sequence for which the sequence of differences is the constant sequence whose n-th term is dn = 10. One can show (see the next exercise) that the n-th term formula for a sequence {an } is linear in n if and only if the sequence of differences is constant. In this case, a0 = 3 a1 = 13 = 3 + 10 a2 = 23 = 13 + 10 = 3 + 10 + 10 = 3 + 2 · 10 a3 = .. . 33 = 23 + 10 = 3 + 2 · 10 + 10 = 3 + 3 · 10 an = 3 + n · 10. Exercise 2.1.1. Consider the statement: The n-th term formula for a sequence {an } is linear in n if and only if the sequence {dn } of differences is constant. This fact should be familiar to you even if the phrasing in terms of sequences is not. Reconcile the above statement with what you know about linear functions from algebra. Constant ratios; geometric sequences. Consider the sequence whose terms are the successive powers of 2, beginning with 20 = 1. The first few terms of 4 CHAPTER 2. MATHEMATICAL INDUCTION the sequence are a0 = 20 = 1 a1 = 21 = 2 a2 = 22 = 4 a3 = 23 = 8 an = 2n . Observe that this sequence is not arithmetic; the differences of consecutive terms are d1 = a1 − a0 = 2 − 1 = 1 d2 = a2 − a1 = 4 − 2 = 2. Let’s look at ratios of consecutive terms: a1 2 r1 = = =2 a0 1 a2 4 r2 = = =2 a1 2 a3 8 r3 = = =2 a2 4 an 2n rn = = n−1 = 2. an−1 2 Such a sequence, in which the ratio of consecutive terms is constant, is called a geometric sequence. 2.1.2 Defining sequences recursively For n ∈ N0 , the n-th triangular number Tn is the number associated with a triangular array of dots in which there are n rows, and each row has one more dot than the preceding row. Thus T0 = 0 (for we have no rows of dots) and T1 , T2 , and T3 are represented as follows: • • • • • • • • • . • Thus the first few triangular numbers are T0 = 0, T1 = 1, T2 = 3, T3 = 6, T4 = 10. We can define the sequence for arbitrary n as follows: T0 = 0, and for n ≥ 1, Tn = Tn−1 + n. In such a recursive definition for a sequence, the n-th term is defined to be a function of one or more of the terms that precede it. With a recursive definition, one must also separately specify the first few terms; if the n-th term is a function of the preceding k terms, one must specify the first k terms of the sequences. 2.1. FIRST EXAMPLES 5 Exercise 2.1.2. Write a recursive definition for the arithmetic sequence {3, 13, 23, 33, . . .} considered above. Exercise 2.1.3. Write a recursive definition for the geometric sequence {1, 2, 4, 8, . . .} considered above. Let us return to our exploration of the triangular numbers. Although we have a recursive definition, we would still like an explicit formula for the n-th term; indeed, with a recursive definition, if we want to know, say, T1000 , we must first generate T1 , T2 , . . . , T999 . One can obtain an n-th term formula in a number of ways. One straightforward way involves iterating the recursive formula for Tn : Tn = Tn−1 + n = Tn−2 + (n − 1) + n = Tn−3 + (n − 2) + (n − 1) + n 0 + 1 + 2 + . . . + (n − 2) + (n − 1) + n n X = k. = k=0 We can now obtain a simple formula for Tn in the same way we obtained a n(n + 1) . formula for the sum of the first n odd numbers. We find Tn = 2 Exercise 2.1.4. Verify the last assertion. Exercise 2.1.5. Give a “picture proof” of the formula Tn = ering an n by n + 1 rectangular array of dots. n(n+1) 2 by consid- We consider another approach; as we did with the arithmetic sequence in the last subsection, let us look at the sequence {dn } of differences of consecutive terms. dn = Tn+1 − Tn = (Tn + n + 1) − Tn = n + 1. This sequence of differences is not constant. However, we may consider the (2) sequence {dn } of differences for the sequence {dn }. We find d(2) n = dn+1 − dn = (n + 2) − (n + 1) = 1. In other words, the sequence of second differences is now constant. We saw above that when the sequence of first differences of a is constant, then the n-th term formula for a is a linear function of n. Suppose we knew that whenever the second differences are constant, the n-th term is a quadratic function of n. We would then have Tn = An2 + Bn + C 6 CHAPTER 2. MATHEMATICAL INDUCTION for constants A, B, and C to be determined. We can solve for these constants. Because we know the first three triangular numbers, 0 = T0 = C 1 = T1 = A + B + C 3 = T2 = 4A + 2B + C. Solving this system gives A = B = 1 2 Tn = and C = 0, i.e., 1 2 1 n + n. 2 2 We obtained the same formula above. It remains to prove that, when the sequence of second differences is constant, the n-th term of the sequence is a quadratic function of n. We leave the proof of this claim to the reader. (2) Exercise 2.1.6. Show that the sequence {dn } of second differences of {an } is a non-zero constant sequence if and only if an = q(n) for some quadratic function q. In other words, you must prove two things: (i) If there are constants A, B, and C with A non-zero such that an = An2 + Bn + C for all n ≥ 0, then the sequence of second differences is a non-zero constant sequence. (ii) If the sequence of second differences is a non-zero constant sequence, then there exists a quadratic function q such that an = q(n) for all n. 2.2 First Programs So far, our sequences have been simple enough that we could do all our calculations by hand. As our examples become more complicated, calculating by hand may become tedious or impossible. We therefore put our technology to use. Let’s look for a simple formula for S[n] := n X k 2 = 12 + 22 + 32 + . . . + n2 . k=1 We would like our sequence to be zero-indexed (see Remark 1 above), and so we let S[0] = 0. This definition is consistent with our definition of S[n] for n > 0 because, for n = 0, the sum is empty. Inspired by the example of the triangular numbers, we will generate the first terms of the sequence S and then look at the sequence d(1) of first differences, the sequence d(2) of second differences, and so on. Our goal is to figure out whether there is an m so that the sequence d(m) of m-th differences is constant. Our experience suggests that if such an m exists, then the n-th term formula 2.2. FIRST PROGRAMS 7 for S will be S[n] = p(n) where p is a polynomial of degree m. We will still have work to do, for we have only proved this statement for m = 1 and m = 2. But in the next section we will see a powerful technique for proving such conjectures. We use this example to develop our first Python program. If you are new to Python, you should first read the appendix. The first thing the program should do is produce a number of terms in the sequence S. Let’s generate the first 15 terms, S[0], S[1], . . . , S[14]. We can use a simple loop. As above, we will name our list S. Because this sequence is defined recursively, we seed the list with the first term, 0. We now go through a loop 14 times (for 1 ≤ n < 15), each time replacing our existing list with the list obtained by appending S[n − 1] + n2 to the old. MAX_ELEMENTS = 15 S = [0] for n in range(1,MAX_ELEMENTS): S.append(S[n-1]+n**2) Next, we must generate terms in the sequence d(1) of first differences. Recall that d(1) [0] = S[1] − S[0], . . . , d(1) [13] = S[14] − S[13]. Thus because we only generated 15 terms in S, we may only generate the first 14 terms in d(1) . We do not need to seed the list d(1) , so we may initially define it to be an empty list. d1 = [] for n in range(1,len(S)): d1.append(S[n]-S[n-1]) Similar code generates the first 13 second differences and the first 12 third differences. The full program appears below, with the output included in a comment. MAX_ELEMENTS = 15 S = [0] for n in range(1, MAX_ELEMENTS): S.append( S[n-1] + n**2 ) d1 = [] for n in range(1, len(S)): d1.append( S[n] - S[n-1] ) d2 = [] for n in range(1, len(d1)): d2.append( d1[n] - d1[n-1] ) d3 = [] for n in range(1, len(d2)): d3.append( d2[n] - d2[n-1] ) 8 CHAPTER 2. MATHEMATICAL INDUCTION print("Sequence: " + str(S)) print("First Differences: " + str(d1)) print("Second Differences: " + str(d2)) print("Third Differences: " + str(d3)) # example output #Sequence: [0, 1, 5, 14, 30, 55, 91, 140, 650, 819, 1015] #First Differences: [1, 4, 9, 16, 25, 36, 144, 169, 196] #Second Differences: [3, 5, 7, 9, 11, 13, 25, 27] #Third Differences: [2, 2, 2, 2, 2, 2, 2, 204, 285, 385, 506, 49, 64, 81, 100, 121, 15, 17, 19, 21, 23, 2, 2, 2, 2, 2] The output of the program suggests (but does not prove) that the sequence d(3) is constant. Our experience thus far leads us to conjecture that the n-th term of the sequence S is given by S[n] = An3 + Bn2 + Cn + D for appropriate constants A, B, C, and D. Exercise 2.2.1. As above, obtain a linear system for A, B, C, and D and solve it to obtain S[n] = 1 3 1 2 1 n(2n2 + 3n + 1) n(n + 1)(2n + 1) n + n + n= = . 3 2 6 6 6 (2.2.1) Exercise 2.2.2. Modify the code to generate the sequence T of triangular numbers from the previous subsection, together with its sequences of first, second, and third differences. 2.3 First Proofs; The Principle of Mathematical Induction Our work in the previous section leads to the conjecture: Sn := n X j=1 j2 = n(n + 1)(2n + 1) 6 for all n ∈ N. This formula agrees with the output of our program. How can we know that the formula is valid for all n? No amount of computing can settle this question; no matter how long we run our program, we will have only checked our result for finitely many n. What we need is a proof. Although many arguments are possible, we give a proof using the principle of mathematical induction. This principle is quite simple. We have an infinite collection of statements P (1), P (2), . . . , P (n), . . ., one for each natural number n. Suppose we know (i) P (1) is true, and (ii) whenever P (k) is true P (k + 1) is true. It then follows that P (n) is true for all n. 2.3. FIRST PROOFS; THE PRINCIPLE OF MATHEMATICAL INDUCTION9 In our example, the statement P (n) is “Sn , the sum of the first n perfect squares, equals n(n+1)(2n+1) .” Consider the base case, i.e., the statement when 6 n = 1. Clearly S1 = 12 = 1. Because 1(1 + 1)(2(1) + 1) 1·2·3 = = 6, 6 6 . Thus P (1) is true. it is indeed the case that S1 = 1(1+1)(2(1)+1) 6 For the induction step, we suppose that P (k) is true for some k ≥ 1 and we consider P (k + 1). In other words, we consider k+1 k X X Sk+1 = j2 = j 2 + (k + 1)2 . j=1 j=1 By the induction hypothesis, P (k) is true, and so the sum of the first k squares . We find can be replaced by k(k+1)(2k+1) 6 Sk+1 = = = = = k(k + 1)(2k + 1) + (k + 1)2 6 (k + 1) [k(2k + 1) + 6(k + 1)] 6 (k + 1) 2 2k + 7k + 6 6 (k + 1) [(k + 2)(2k + 3)] 6 (k + 1)[(k + 1) + 1][2(k + 1) + 1] . 6 Thus P (k+1) is true if P (k) is true. By the principle of mathematical induction, P (n) is true for all n. You may have noticed that we did not prove that the principle of mathematical induction is indeed a valid proof technique. The full justification requires us to give a more precise definition of the natural numbers than we did in the first chapter. We defer this discussion to Chapter ??. We note, however, that if one accepts the principle of mathematical induction, one can use it to prove a useful generalization: Proposition 2.3.1. Consider a collection of statements P (a), P (a + 1), P (a + 2), . . . for some integer a. Suppose (i) P (a) is true and (ii) whenever P (k) is true for some integer k, P (k + 1) is true. Then P (n) is true for all n ≥ a. We leave the proof to the reader. Exercise 2.3.1. Prove Proposition 2.3.1 The point of the proposition is that we may use the technique of induction even when the base case is some integer other than 1. In the above example of 10 CHAPTER 2. MATHEMATICAL INDUCTION summing the squares, our proof was a bit more verbose than we will tend to be in the future. For example, we will seldom say explicitly what the statement P (n) is because it is usually obvious. We illustrate by proving another proposition by induction. Note also that our base case will be n = 0 and not n = 1. Proposition 2.3.2. (Bernoulli’s inequality) Let x ≥ −1. Then for every integer n ≥ 0, (1 + x)n ≥ 1 + nx. (2.3.1) Proof. The proof is by induction on n with base case n = 0. When n = 0, (1 + x)0 = 1 = 1 + 0x and the result holds. Now suppose the result holds for some k ≥ 0 and consider k + 1. Then (1 + x)k+1 = (1 + x)(1 + x)k . By the induction hypothesis, (1+x)k ≥ 1+kx. Also, because x ≥ −1, 1+x ≥ 0. Thus (1 + x)k+1 = (1 + x)(1 + x)k ≥ (1 + x)(1 + kx) = 1 + kx + x + kx2 ≥ 1 + (k + 1)x + 0, and the result indeed holds for k+1. By the principle of mathematical induction, it holds for all integers n ≥ 0. Exercise 2.3.2. Induction can be used to prove some divisibility results. Consider, for example, an = 11n − 6 for n ≥ 1. By writing down the prime factorizations of the first few, make a conjecture about a factor they all have in common. Prove your claim. 2.4 Strong Induction Some proofs require the strong principle of mathematical induction: Suppose we have a collection of statements P (n), one for each n ∈ N. Suppose (i) P (1) is true and (ii) for k ≥ 1, if P (i) is true for all 1 ≤ i ≤ k, then P (k + 1) is true. Then P (n) is true for all n. Although it seems as if we are assuming more at the induction step, the strong principle of mathematical induction and the usual principle of mathematical induction are, in fact, equivalent. We illustrate with an example why we need this formulation as well. Example 2.4.1. Suppose we have 3-cent and 5-cent stamps. What postage can be made? 2.5. PROBLEMS 11 Clearly we can not make postage of 1, 2, 4, or 7 cents. It appears that we can make all the others. Indeed, postage of 3 and 5 cents is trivial, and 6 = 3+3 8 = 5+3 9 = 3+3+3 10 = 5+5 11 = 5 + 3 + 3, and so on. It thus appears that any postage of 8 cents or more can be made. We prove this conjecture using the strong induction principle. We have just shown explicitly how to make postage of 8, 9, 10, or 11 cents. Suppose now that k ≥ 11 and that, for all 8 ≤ i ≤ k, we can make postage of i cents using 3- and 5-cent stamps. Consider postage of k + 1 cents. Because k ≥ 11, (k +1)−3 = k −2 ≥ 9. By the strong induction hypothesis, we can make postage of k − 2 cents, and by adding an additional 3-cent stamp, we can make postage of k + 1 cents. Thus by the strong principle of mathematical induction, we can make any postage of 8 cents or more with 3- and 5-cent stamps. Exercise 2.4.1. Determine all postage that can be made using 4- and 7-cent stamps. 2.5 Problems Whenever possible, we pose problems in which you need to explore, conjecture, and prove. You may, of course, explore however you like, using trial and error, doing concrete examples via paper-and-pencil calculations, or using your developing programming skills to write a short program to do many examples quickly for you. There is no “right” way to explore. Needless to say, most of the problems posed ask you to discover a known result. Thus were you to open other books or go online, you could find formulas and proofs. The point, of course, is to learn how to discover results for yourself. A final note: Just because the title of the chapter is Mathematical Induction does not mean you must or should use induction to do all of these problems. For many of them, induction will work. But for many, other proofs exist as well, and you should look for them. Each new proof gives new insight. 1. Find and prove a formula for the sum of the first n even natural numbers. 2. Find and prove a formula for the sum of the first n perfect cubes, i.e., for n X k3 . k=1 3. Find and prove a formula for the sum of the first n powers of 2, beginning n−1 X with 20 . That is, find and prove a formula for 2k . See if you can give k=0 more than one proof. 12 CHAPTER 2. MATHEMATICAL INDUCTION 4. Find and prove a formula for n−1 X 3k . k=0 5. A finite geometric series is a series of the form n−1 X ark for non-zero a and k=0 r. Find and prove a formula for this sum. 6. Consider the sequence {an } defined recursively by a0 = 1 and an = an−1 + 4 for n ≥ 1. Find an explicit formula for an and an explicit formula for n−1 X ak . k=0 7. Recall that a sequence {cn } is called arithmetic if it is given recursively by c0 = c and cn = cn−1 + d for n ≥ 1 and for fixed constants c and d. n−1 X Find a formula for cn and for ck . k=0 8. A sequence {an } is bounded above if there exists √ an M such that an ≤ M for all n. Let a0 = 1 and, for n > 0, let an = 2an−1 + 3. (a) Generate enough terms of the sequence to make a conjecture about whether or not this sequence is bounded above. Prove your conjecture. (b) A sequence {an } is non-decreasing if, for all n, an ≤ an+1 . We may similarly define non − increasing sequences. A sequence is said to be monotone if it is either non-decreasing or non-increasing. Determine whether the sequence in this problem is monotone. 9. Explore the way in which the boundedness and monotonicity of the sequence in the previous problem depend on the value a0 . Give proofs of all your claims. 10. Our experience with polynomials and exponential functions suggests to us that each of the following inequalities should be true, at least for n sufficiently large. Find all n for which each inequality holds. (a) 2n ≥ 2n + 1. (b) 2n ≥ n2 . (c) n! ≥ 2n−1 . 11. A game of Poison begins with a row of 10 pennies and two players. On each player’s turn, he or she may remove one penny or two pennies. The last penny is poison, and thus the object is to force one’s opponent to take the last penny. Would you prefer to be the first player or the second player? Generalize to an n-penny game, with proof, of course. 2.5. PROBLEMS 13 12. Suppose we have postage stamps in denominations of a cents and b cents and that a and b have no common factors. What is the largest postage that can not be made? 13. The purpose of this problem is to prove a number of useful inequalities. (a) Suppose x and y are real numbers. Show that 2xy ≤ x2 + y 2 . (b) Suppose a and b are non-negative real numbers. Show that √ ab ≤ a+b . 2 (This inequality is often called the Arithmetic-Geometric Mean (AGM) inequality.) (c) Let n be a natural number, and suppose ak > 0 for 1 ≤ k ≤ 2n . Prove 1 a1 + a2 + . . . + a2n (a1 a2 · · · a2n ) 2n ≤ . 2n Programming Project. In this chapter, we introduced arithmetic sequences (where there is a common difference d between consecutive terms) and geometric sequences (where there is a common ratio r between consecutive terms). We also saw examples of sequences for which we had to look at second and third differences in order to guess a formula for the n-th term. Write a program that takes a list consisting of the first six terms of a sequence and finds the first few terms in the sequence of differences or ratios. Then use it to find n-th term formulas for sequences agreeing with the first six terms of each of the following: 3 1 1 1 1 a = 3, , , , , ,... 2 2 8 40 240 7 7 , 3, 3, , 1, −1, . . . . b= 3 3