Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
2.1 Counting Trains I want to construct a train of total length n units using cars which are either 1 unit long or 2 units long. The question is, how many different trains are there? For example, for trains of length 12, here is one possibility, using 6 cars of length 1 and 3 cars of length 2. 1 1 1 2 2 1 2 1 1 Other possibilities are obtained by rearranging the cars, or using different numbers of short and long cars. Note that a train has a front and a back, so that the mirror image of the train diagrammed above 1 1 2 1 2 2 1 1 1 is counted as a different train. There is an important combinatorial approach to such problems, looking at the different possibilities for the number of 2-cars, and counting the number of arrangements of each (see Problem 10). But our objective here is to use this problem to develop a sophisticated approach to the analysis of recursive sequences. We start by collecting some data––actually counting the different trains for small values of n by listing the possibilities. We get the table below. Many students will recognize the appearance of the Fibonacci numbers. The "law" of these numbers is that each term is the sum of the two preceding terms. For many students, once they see this pattern, they figure that the problem is solved, because we can continue this pattern and get the number of trains of any length. For example, the number of length 7 will be 8+13=21, etc. But can we be sure the pattern continues? To have some notation, let's use tn to denote the number of trains of length n. Then the pattern we have found is the recursive relation: t n = t n −1 + t n −2 . This is the equation we want to establish. For example, here are the 8 trains of length 5 1-1-1-1-1 1-1-1-2 1-1-2-1 1-2-1-1 2-1-1-1 1-2-2 2-1-2 2-2-1 Length of train n 1 2 3 4 5 6 Number of trains tn 1 2 3 5 8 13 A question of elegance. Let me point out that there's more here than a simple question of certainty. If this really does hold, one would think there ought to be a simple elegant argument for it (after all there's nothing very complex going on here) and we are curious to discover what this might be. Trains 11/13/2007 1 Establishing the recursion. Our task is to convince ourselves that the simple sum rule should hold for the train sequence. As a specific example, take the equation: t7 = t6 + t5 . Find an argument that the number of 7-trains has to be the sum of the number of 6-trains and the number of 5-trains. When I give this task to the class, the following argument is often produced. You can make a 7-train by starting with any 6-train and adding a car of length 1, or by starting with any 5-train and adding a car of length 2, and there will be t 6 trains of the first type and t 5 trains of the second type, so t 7 must be the sum of those two numbers. This argument seems okay, but it requires just a bit more care. What they’ve given me is two procedures for constructing a 7-train, one that starts with a 6train, and the other that starts with a 5-train. But for this to actually give an exact count of the 7-trains we really have to check first that we get all of the 7trains in one of these two ways, and secondly, that we haven’t counted any 7train twice, that is, that we can’t get the same 7-train coming out of both routes. Neither of these are hard to do, but the point is that such a check needs to be made to be sure that the argument works. A better approach is to start with the set of all 7-trains. Look at the above equation: it declares that the number of 7-trains is the sum of two other numbers. That strongly suggests there's a natural way to partition the set of all 7-trains into two subsets, one of which is easily seen to be of size t 6 and the other of size t 5 . Here’s the argument. Classify the 7-trains into two classes: those that begin with a 1-car and those that begin with a 2-car. It's clear that every train is in exactly one of those two sets. Now how large is each set? Clearly there are t 6 trains in the first (the rest of the train has length 6) and t 5 in the second (the rest of the train has length 5). So t 7 must be the sum of those two numbers. 1 2 6 t6 5 t5 t7 It’s clear that this argument is quite general, and could be used to show that the number of 8-trains is equal to the sum of the number of 7-trains and the number of 6-trains etc. So the additive rule always holds. t n = t n −1 + t n −2 . We can deduce from this that the train numbers are given by the famous Fibonacci numbers. Indeed the two sets of numbers start out the same, and have the same generating law, so they have to remain the same. Actually it's not strictly true that they start the same. The Fibonacci numbers (traditionally written un) are indexed as shown at the right, so that the train numbers tn are shifted by one. For example, the 4th train number is the 5th Fibonacci number. Trains 11/13/2007 n 0 1 2 3 4 5 6 7 8 9 10 11 12 tn 1 1 2 3 5 8 13 21 34 55 89 144 233 un 0 1 1 2 3 5 8 13 21 34 55 89 144 It is often mathematically convenient to start the count at n=0. Can we make "train" sense of this? Perhaps: there's only one train of length 0 and that's the empty train. 2 Train-theoretic proofs of Fibonacci identities. Before we move on, there's something really neat that we can do with these train numbers. The Fibonacci numbers possess many wonderful arithmetic properties, but many of these are not so easy to prove. [For example, take three successive numbers, say, 3, 5, 8, and note that: 3×5 + 5×8 = 55 which is a Fibonacci number. Try the same thing with another triple. Now try to prove that this always holds. [Problem 8]. Here's an idea that's nothing short of spectacular. What we have constructed above is a physical "model" of the Fibonacci numbers. Let's try to use that to obtain a "train-theoretic" proof of arithmetic relationships among these numbers. n 0 1 2 3 4 5 6 7 8 9 10 11 12 13 tn 1 1 2 3 5 8 13 21 34 55 89 144 233 377 un 0 1 1 2 3 5 8 13 21 34 55 89 144 233 Example. Take two consecutive Fibonacci numbers and add their squares. For example: 52 + 82 = 89. Writing this in u-notation we have u 5 2 + u 6 2 = u11 . Note the nice pattern in the indices (11 is the sum of 5 and 6). Try some others. The next one in sequence is 82 + 132 = 233. One way to show that this pattern continues is to use induction, but the argument is surprisingly tricky. Here’s our new idea—think about trains! First we formulate the identity in “train language”. That involves a shift of the subscripts: t 4 2 + t 5 2 = t10 . Now we ask––can we find a "train-theoretic" argument for this identity? This time, we want to partition the 10-trains into two disjoint classes so that there are t 52 trains of the first kind and t 42 trains of the second kind. A clue comes from noting that the subscripts 5 and 4 have the status of being roughly half of 10––this suggests that the classification ought to be based on something like "cutting the 10-trains in half." Can you take it from there? Well, here it is. There are two kinds of 10-trains, depending on whether or not they can be “cut in half." Those that can must have a join in the middle, and those that cannot must have a 2-car in the middle. 5 4 2 5 t52 4 t 42 t10 Those with a join are constructed of two trains of length 5, and there are t5 possibilities for the front part and another t5 possibilities for the back, for a total of t 52 trains with a join in the middle. Those with a 2car in the middle are completed by adding two trains of length 4, and there are t 42 possibilities for that. Adding these up, we get t10 = t 5 2 + t 4 2 . Now that's an argument of great beauty! As you’ll see from the exercises, it’s powerful too. Trains 11/13/2007 3 Problems 1. For the sequence that’s begun at the right, each term is equal to the previous term plus twice the term before that. If the first and second terms are both 1, find the 8th term x8. 2. Use the same rule as 1) but take x1 = 1 and x2 = 2. What now is the 8th term? 3. I want to construct a train using cars which are either length 1 or of length 3. Let xn be the number of different trains of length n. For example, x6 = 6 and the six trains are listed at the right. Find a recursive formula that would allow you to generate the sequence xn from a few starting values. Use this to tabulate the values from x0 to x10. 4. In this section we established the “sum of squares” formula t 5 2 + t 4 2 = t10 . Find an analogue for the sequence xn of #3 and make a n 1 2 3 4 xn 1 1 3 =1+2×1 5 =3+2×1 The 6 trains of length 6 1-1-1-1-1-1 1-1-1-3 1-1-3-1 1-3-1-1 3-1-1-1 3-3 careful argument to show that it holds. Check that it hold for the table you generated in #3. 5. Suppose you take the rule of #4 but start with a different pair of numbers. Experiment a bit and see what kind of patterns you get. Can you formulate a general hypothesis and even perhaps see why it might hold? 6. Let sn be the number of different symmetric trains of length n which are built out of cars which are either 1 unit long or 2 units long–– where, a symmetric train is one that is the same running backwards and forwards. Thus 212 is a symmetric 5-train but 122 is not. For example, s5 = 2 (table at the right). Find a formula for sn in terms of the Fibonacci numbers. Can you find a general argument for your formula? 7. Let rn be the number of different reversible trains of length n which are built out of cars which are either 1 unit long or 2 units long. This is the same as the standard train problem, except the 5-trains 122 and 221 are no longer considered different, because one is the same as the other in reverse order. But the train 212 is different from these. For example, r5 = 5 (table at the right). Find a formula for rn in terms of the Fibonacci numbers. Can you find a general argument for your formula? The 5 reversible trains of length 5 1-1-1-1-1 1-1-1-2 1-1-2-1 1-2-2 2-1-2 8. The relationship 3×5 + 5×8 = 55 is an instance of a Fibonacci formula. Formulate it in general and find a "train-theoretic" proof. 9. Give a "train-theoretic" proof of each of the following Fibonacci identities. The identities are quite general, but I give particular versions. In (b) there is a different form for odd and even n. u13 = u11 + u10 + u9 + ... + u1 + 1 . (a) u12 = u11 + u9 + u7 + ... + u1 . (b) u13 = u12 + u10 + u8 + ... + u2 + 1 . Trains 11/13/2007 4 10. At the right is displayed a left-justified copy of Pascal's triangle. Observe that the Fibonacci numbers are the sums of the diagonals (these are in 1-1 correspondance with the lefthand 1's). For example, starting at the 1 in bottom left corner, we get: 1 + 7 + 15 + 10 + 1 = 34 . [Put a ruler through the diagonal line of numbers and see that it passes through 34.] Using combinatorial notation, this can be written: ⎛ 8 ⎞ ⎛ 7 ⎞ ⎛ 6 ⎞ ⎛ 5⎞ ⎛ 4⎞ ⎜⎜ ⎟⎟ + ⎜⎜ ⎟⎟ + ⎜⎜ ⎟⎟ + ⎜⎜ ⎟⎟ + ⎜⎜ ⎟⎟ = u 9 ⎝ 0 ⎠ ⎝ 1 ⎠ ⎝ 2 ⎠ ⎝ 3⎠ ⎝ 4 ⎠ 1 1 2 3 5 8 13 21 34 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 1 3 6 10 15 21 28 1 4 10 20 35 56 1 5 15 35 70 1 6 1 21 7 1 56 28 8 1 Formulate this in general and find a "train-theoretic" proof. 11. At the right is displayed another left-justified copy of Pascal's triangle. In this case the Fibonacci numbers are ranged along the top and (every second number) down the right. Consider the row that starts 1, 5. Take each of these numbers and multiply by the Fibonacci number in the top row, and then add all these products. We get the Fibonacci number at the right. The formula is: 1×1 + 1×5 + 2×10 + 3×10 + 5×5 + 8×1 = 89. Using combinatorial notation, this can be written: ⎛ 5⎞ ⎛ 5⎞ ⎛ 5⎞ ⎛ 5⎞ ⎛ 5⎞ ⎛ 5⎞ 1⎜⎜ ⎟⎟ + 1⎜⎜ ⎟⎟ + 2⎜⎜ ⎟⎟ + 3⎜⎜ ⎟⎟ + 5⎜⎜ ⎟⎟ + 8⎜⎜ ⎟⎟ = 89 . ⎝ 0 ⎠ ⎝ 1⎠ ⎝ 2 ⎠ ⎝ 3⎠ ⎝ 4 ⎠ ⎝ 5⎠ 1 1 2 3 5 8 13 21 34 1 1 1 1 1 1 1 1 1 1 2 3 4 5 6 7 8 1 3 6 10 15 21 28 1 4 10 20 35 56 1 5 15 35 70 1 6 1 21 7 1 56 28 8 1 1 2 5 13 34 89 233 610 1597 Formulate this in general and find a "train-theoretic" proof. 12. Give a "train-theoretic" proof of each of the following Fibonacci identities. The identities are quite general, but I give particular versions. In (b) there is a different form for odd and even n. 2 2 u12 u11 = u11 + u10 + u 92 +...+ u12 (a) (b) 2 u13 = u13u12 + u12u11 + u11u10 + ... + u2u1 + 1 2 u12 = u12u11 + u11u10 + u101u9 + ... + u2u1 Hint for 12: These involve working with two trains together. For example in (a) we want an 11-train and a 10-train. Park the two trains parallel to one another with the fronts lined up. Now start at the back and walk towards the front between the two trains. Stop when you come to the first 1-car, on either train, and classify the situation according to the position of this car. 13. (a) Let sn be the number of sequences of 0's and 1's of length n which have no consecutive 1’s. For example, there are a total of 8 sequences of 0’s and 1’s of length 3 (why?), but only 5 of these have no consecutive 1’s. Thus s3 = 5. Find the sequence sn. (b) A fair coin is tossed until two consecutive heads appear. This might take 2 tosses, or three, or four, etc. Let pn be the probability that it will take exactly n tosses. Thus p3 = 1/8 because only 1 of the 8 possible sequences of H and T gets two consecutive heads for the first time exactly on the 3rd toss (that’s THH). Find the sequence pn. (c) If you've solved (b) you have a sequence pn of interesting numbers. Now sooner or later you expect to get two heads in a row, so the sum of all the pn (2≤n≤∞) must equal 1. That gives an interesting summation formula, and a proof of it at the same time. What is it? Can you find an alternative (direct) proof? Trains 11/13/2007 5