Recurrence Relations

Recurrence Relations

Recurrence Relations 1 In¯nite Sequences An in¯nite sequence is a function from the set of positive integers to the set of real numbers or to the set of complex numbers. Example 1.1. The game of Hanoi Tower is to play with a set of disks of graduated size with holes in their centers and a playing board having three spokes for holding the disks. AB C The object of the game is to transfer all the disks from spoke A to spoke C by moving one disk at a time without placing a larger disk on top of a smaller one. What is the minimal number of moves required when there are n disks? Solution. Let an be the minimum number of moves to transfer n disks from one spoke to another. In order to move n disks from spoke A to spoke C, one must move the ¯rst n ¡ 1 disks from spoke A to spoke B by an¡1 moves, then move the last (also the largest) disk from spoke A to spoke C by one move, and then remove the n ¡ 1 disks again from spoke B to spoke C by an¡1 moves. Thus the total number of moves should be an = an¡1 + 1 + an¡1 = 2an¡1 + 1: This means that the sequence fan j n ¸ 1g satis¯es the recurrence relation ½ a = 2a + 1; n ¸ 1 n n¡1 (1) a1 = 1: 1 Applying the recurrence relation again and again, we have a1 = 2a0 + 1 a2 = 2a1 + 1 = 2(2a0 + 1) + 1 2 = 2 a0 + 2 + 1 2 a3 = 2a2 + 1 = 2(2 a0 + 2 + 1) + 1 3 2 = 2 a0 + 2 + 2 + 1 3 2 a4 = 2a3 + 1 = 2(2 a0 + 2 + 2 + 1) + 1 4 3 2 = 2 a0 + 2 + 2 + 2 + 1 . n n¡1 n¡2 an = 2 a0 + 2 + 2 + ¢ ¢ ¢ + 2 + 1 n n = 2 a0 + 2 ¡ 1: Let a0 = 0. The general term is given by n an = 2 ¡ 1; n ¸ 1: Given a recurrence relation for a sequence with initial conditions. Solving the recurrence relation means to ¯nd a formula to express the general term an of the sequence. 2 Homogeneous Recurrence Relations Any recurrence relation of the form xn = axn¡1 + bxn¡2 (2) is called a second order homogeneous linear recurrence relation. Let xn = sn and xn = tn be two solutions, i.e., sn = asn¡1 + bsn¡2 and tn = atn¡1 + btn¡2: Then for constants c1 and c2 c1sn + c2tn = c1(asn¡1 + bsn¡2) + c2(atn¡1 + btn¡2) = a(c1sn¡1 + c2tn¡1) + b(c1sn¡2 + c2tn¡2): This means that xn = c1sn + c2tn is a solution of (2). 2 Theorem 2.1. Any linear combination of solutions of a homogeneous re- currence linear relation is also a solution. In solving the ¯rst order homogeneous recurrence linear relation xn = axn¡1; it is clear that the general solution is n xn = a x0: n This means that xn = a is a solution. This suggests that, for the second order homogeneous recurrence linear relation (2), we may have the solutions of the form n xn = r : n Indeed, put xn = r into (2). We have rn = arn¡1 + brn¡2 or rn¡2(r2 ¡ ar ¡ b) = 0: Thus either r = 0 or r2 ¡ ar ¡ b = 0: (3) The equation (3) is called the characteristic equation of (2). Theorem 2.2. If the characteristic equation (3) has two distinct roots r1 and r2, then the general solution for (2) is given by n n xn = c1r1 + c2r2 : If the characteristic equation (3) has only one root r, then the general so- lution for (2) is given by n n xn = c1r + c2nr : Proof. When the characteristic equation (3) has two distinct roots r1 and r2 it is clear that both n n xn = r1 and xn = r2 are solutions of (2), sop are their linear combinations. a§ a2+4b Recall that r = 2 . Now assume that (2) has only one root r. Then a2 + 4b = 0 and r = a=2: 3 Thus a2 a b = ¡ and r = : 4 2 n We verify that xn = nr is a solution of (2). In fact, µ ¶ ³a´n¡1 a2 ³a´n¡2 ax + bx = a(n ¡ 1) + ¡ (n ¡ 2) n¡1 n¡2 2 4 2 ³a´n ³a´n = [2(n ¡ 1) ¡ (n ¡ 2)] = n = x : 2 2 n n Remark. There is heuristic method to explain why xn = nr is a solution when the two roots are the same. If two roots r1 and r2 are distinct but very n n n n close to each other, then r1 ¡ r2 is a solution. So is (r1 ¡ r2 )=(r1 ¡ r2). It follows that the limit n n r1 ¡ r2 n¡1 lim = nr1 r2!r1 r1 ¡ r2 n¡1 n would be a solution. Thus its multiple xn = r1(nr1 ) = nr1 by the constant r1 is also a solution. Please note that this is not a mathematical proof, but a mathematical idea. Example 2.1. Find a general formula for the Fibonacci sequence 8 < fn = fn¡1 + fn¡2 f = 0 : 0 f1 = 1 Solution. The characteristic equation r2 = r + 1 has two distinct roots p p 1 + 5 1 ¡ 5 r = and r = : 1 2 2 2 The general solution is given by à p !n à p !n 1 + 5 1 ¡ 5 f = c + c : n 1 2 2 2 4 Set ( 0 = c1 + c2 ³ p ´ ³ p ´ 1+ 5 1¡ 5 1 = c1 2 + c2 2 : We have c = ¡c = p1 . Thus 1 2 5 à p !n à p !n 1 1 + 5 1 1 ¡ 5 fn = p ¡ p ; n ¸ 0: 5 2 5 2 Remark. The Fibonacci sequence fn is an integer sequence, but it \looks like" a sequence of irrational numbers from its general formula above. Example 2.2. Find the solution for the recurrence relation 8 < xn = 6xn¡1 ¡ 9xn¡2 x = 2 : 0 x1 = 3 Solution. The characteristic equation r2 ¡ 6r + 9 = 0 () (r ¡ 3)2 = 0 has only one root r = 3. Then the general solution is n n xn = c13 + c2n3 : The initial conditions x0 = 2 and x1 = 3 imply that c1 = 2 and c2 = ¡1. Thus the solution is n n n xn = 2 ¢ 3 ¡ n ¢ 3 = (2 ¡ n)3 ; n ¸ 0: Example 2.3. Find the solution for the recurrence relation 8 < xn = 2xn¡1 ¡ 5xn¡2; n ¸ 2 x = 1 : 0 x1 = 5 Solution. The characteristic equation r2 ¡ 2r + 5 = 0 () (x ¡ 1 ¡ 2i)(x ¡ 1 + 2i) = 0 5 has two distinct complex roots r1 = 1+2i and r2 = 1¡2i. The initial conditions imply that c1 + c2 = 1 c1(1 + 2i) + c2(1 ¡ 2i) = 5: 1¡2i 1+2i So c1 = 2 and c2 = 2 . Thus the solutions is 1 ¡ 2i 1 + 2i x = ¢ (1 + 2i)n + ¢ (1 ¡ 2i)n n 2 2 5 5 = (1 + 2i)n+1 + (1 ¡ 2i)n+1; n ¸ 0: 2 2 Remark. The sequence is obviously a real sequence. However, its general formula involves complex numbers. Example 2.4. Two persons A and B gamble dollars on the toss of a fair coin. A has $70 and B has $30. In each play either A wins $1 from B or loss $1 to B. The game is played without stop until one wins all the money of the other or goes forever. Find the probabilities of the following three possibilities: (a) A wins all the money of B. (b) A loss all his money to B. (c) The game continues forever. Solution. Either A or B can keep track of the game simply by counting their own money. Their position n (number of dollars) can be one of the numbers 0; 1; 2;:::; 100. Let pn = probability that A reaches 100 at position n. After one toss, A enters into either position n + 1 or position n ¡ 1. The new probability that A reaches 100 is either pn+1 or pn¡1. Since the probability of A 1 moving to position n + 1 or n ¡ 1 from n is 2. We obtain the recurrence relation 8 1 1 < pn = 2pn+1 + 2pn¡1 p = 0 : 0 p100 = 1 First Method: The characteristic equation r2 ¡ 2r + 1 = 0: 6 has only one root r = 1. The general solutions is pn = c1 + c2n: Applying the boundary conditions p0 = 0 and p100 = 1, we have 1 c = 0 and c = : 1 2 100 Thus n p = ; 0 · n · 100: n 100 n Of course, pn = 100 for n > 100 is nonsense to the original problem. The probabilities for (a), (b), and (c) are 70%, 30%, and 0, respectively. 1 1 Second Method: The recurrence relation pn = 2pn+1 + 2pn¡1 can be written as pn+1 ¡ pn = pn ¡ pn¡1: Then pn+1 ¡ pn = pn ¡ pn¡1 = ¢ ¢ ¢ = p1 ¡ p0: Since p0 = 0, we have pn = pn¡1 + p1. Applying the recurrence relation again and again, we obtain pn = p0 + np1: n Applying the conditions p0 = 0 and p100 = 1, we have pn = 100. 3 Higher Order Homogeneous Recurrence Relations For a higher order homogeneous recurrence relation xn+k = a1xn+k¡1 + a2xn+k¡2 + ¢ ¢ ¢ + an¡kxn; n ¸ 0 (4) we also have the characteristic equation k k¡1 k¡1 t = a1t + a2t + ¢ ¢ ¢ + an¡k+1t + an¡k (5) or k k¡1 k¡1 t ¡ a1t ¡ a2t ¡ ¢ ¢ ¢ ¡ an¡k+1t ¡ an¡k = 0: 7 Theorem 3.1. For the recurrence relation (4), if its characteristic equation (5) has distinct roots r1; r2; : : : ; rk, then the general solution for (4) is n n n xn = c1r1 + c2r2 + ¢ ¢ ¢ + ckrk where c1; c2; : : : ; ck are arbitrary constants.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    24 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us