S. Tay MAT 344 Sprig 999 Recurrece Relatios Tower of Haoi Let T be the miimum umber of moves required. T 0 = 0, T = 7 Iitial Coditios * T = T + $ T is a sequece (f. o itegers). Solve for T? * is a recurrece, differece equatio (liear, ohomogeeous, costat coefficiet) Set U 0 = T 0 +, U = T + $ The U = T + = T + + = (T + ) so U = U = U = ÿ = U = ˆ T = Suppose a + = a +, a 0 = Let U = a +, U 0 = The U + = a + + ( + ) = a + + ( + ) = (a + ) + = U + Thus, U is like the T i the precedig example, except U 0 = while T 0 = 0. I fact, sice T =, the {U } is just {T } advaced oe step, i.e. U = T + = + ˆ a = + = + ( + ) Notice how the solutio of oe recurrece ofte ca be reduced to the solutio of a simpler oe. 7
S. Tay MAT 344 Sprig 999 Suppose the recursio were L = L +, L 0 = The we ca expad out as follows: L = L + ( ) + = L 3 + ( ) + ( ) + = = L 0 + + + þ + = + (%) This describes the umber of regios formed by itersectig lies i the plae, o parallel ad o 3 itersect i a poit (PIZZA CUTTING PROBLEM). Geeral Problem (*) F(Y + k,y + k, þ, Y ) = 0 Differece equatio of order k(dfe) Assume F liear, costat coefficiets (**) Y + k + a Y + k + þ + a k Y () = 0 If () = 0, Homogeeous; otherwise ohomo. Note the strog aalogy with D.E.! Suppose that Y = S () is a solutio. The S ( + k) + a S ( + k ) + þ + a k S () ()=0 If S () is ay other solutio, the [S ( + k) S ( + k)] + a [S ( + k ) S (+ k )] + ÿ + a k [S () S ()] = 0 It follows that S () S () is a solutio of the Homogeeous equatio related to (**) (obtaied by (igorig ()). What is the Geeral Solutio of a DFE? It s a family of fuctios, usually characterized by a parameter(s) which ca take o differet values. 73
S. Tay MAT 344 Sprig 999 From the above, the geeral solutio for (**) is just the geeral solutio to the related HOMO equatio plus ay particular solutio to the NONHOMO equatio (**), i.e. S NH () = S H () + S p () where S p () is ay solutio of (**), S H () is geeral solutio of related HOMO ad S NH () is geeral solutio of (**) Solvig HOMO (i) First Order DFE Suppose Y + + a Y = 0 (k = ) The Y + = a Y = () a Y = ÿ = () a Y = (a ) + Y 0 where Y 0 is a arbitrary umber (iitial value of sequece). CHECK: (a ) + Y 0 + a (a ) Y 0 = a (a ) Y 0 + a (a ) Y 0 = 0 (ii) Higher Order DFE Notice that if U () ad U () are both solutios of the homo equatio (H) Y +k + a Y + k + ÿ + a k Y = 0 the so is C U () + C U () where C, C 0 ú. Two solutios of (H) are differet iff ò C such that U () = CU () 74
S. Tay MAT 344 Sprig 999 It ca be show that if U (), U (), ÿ, U k () are k differet solutios of (H), the the geeral solutio is Fidig Differet Solutios k S H () = j C i U i () where C i 0 ú. i' Y + + a Y + + a Y = 0 Characteristic polyomial p(8) = 8 + a 8 + a Let p(8) have roots 8 8 (Real 8,8 ). The U () = 8 U () = 8 are differet solutios, sice 8 + + a 8 + + a 8 = 8 (8 + a 8 +a ) = 0 ad the same holds for 8 ad clearly U () CU () for ay C 0 ú. Thus, the geeral solutio is C 8 + C 8 Exercise: F + = F + + F F 0 = F = Geeral Solutio: F + F + F = 0. P(8) = 8 8, roots ± % S H () = C + C & F 0 = S H (0) = Y C + C = % & F = S H () = Y C + C = % ˆ C = C = & 7
S. Tay MAT 344 Sprig 999 % % ˆ F = & % % & Sice > ad <, for large /0 /0 % % F I fact you ca verify that for all, /0 & so that F = iteger earest (Also otice that < 0 so that % % % % < 0. /0 % is alterately above or below F.) F Also, % % P = J Golde Mea F AB AC ' AC CB Suppose the two roots were the same p(8) = (8 8 ) The U () = 8 is oe solutio, we eed a secod. Suppose the secod looks like 8 V() for some V(), the we have V( + ) 8 + 8 V( + ) 8 + + 8 V()8 = 0 Divide by 8 + to get V( + ) V( + ) + V() = 0 76
S. Tay MAT 344 Sprig 999 By ispectio we otice that possible solutios are V() = (!!) ad V() =. This latter solutio for V() gives a secod (differet) solutio to the origial equatio. Thus, the geeral solutio is S H () =C 8 C 8 Exercise: Y + 4Y + + 4Y = 0 = 8 (C + C ) P(8) = 8 48 + 4 = (8 ) Y = (C + C ) The fial possibility is that the roots are distict but ot real. The they must be complex cojugates (sice the coefficiets are real), say " ± i$. The earlier aalysis gives S H () = C (" + i$) + C (" i$) (sice we ever used the fact that the roots were real explicitly!). What s wrog? NOTHING, except the solutio S H (), may ot be real. We wat real solutio for practical problems. What to do? Recall: " + i$ = r[cos + i si] where r = " %$ " cos = si = r De Moivre: (" + i$) = r [cos + i si ] $ r Thus. {(" + i$) + (" i$) } = r cos (" i$) = r [cos i si ] {(" + i$) (" i$) } = r si i Thus, r cos ad r si are diff. real solutios. Geeral Solutio S H () = c r cos + c r si 77
S. Tay MAT 344 Sprig 999 Example: Y + = (Y + + Y ) r ' 4 % 3 4 p(8) = 8 + 8 +, roots & ± i 3 ', cos ' &, si ' 3 B so = ˆ Y = c cos B 3 3 % c si B 3 Next Step: Geeral for ay k. This is relatively easy: ) if all the k roots are real ad distict, say, 8,8, ÿ, 8 k the geeral solutio is S H () = j k i' ) if 8 i occurs with multiplicity m i, the distict solutios associated with it are Do this for all k roots c i 8 i 8 i,8 i, 8 i,ÿ,m& 8 i i 3) wheever a root is complex, its cojugate must also be a root (coeff of polyomial are real!) [Recall that ay polyomial p(8) ca be writte as a product of liear ad quadratic factors.] Use the approach described above for this pair of complex cojugate roots. Exercise Y + 3 Y + + Y + Y = 0 p(8) = 8 3 8 + 8 = (8 )(8 + ) roots are, ± i, r =, = B Y = c + c cos B % c si B 3 Exercise H + 3 H + H = 0, H 0 = H = H = Fid a eat formula for H. What about for the recursio: G + 3 G + + G = 0, G 0 = G = G = 78
S. Tay MAT 344 Sprig 999 Try to geeralize these results for : H + k + = H + k + H, H 0 = H = ÿ = H k = G + k + = G + k G, G 0 = G = ÿ = G k = NoHomogeeous Equatios C o geeral solutio, eve i case of costat coefficiets C some special cases ca be solved, whe the fuctio o the RHS is of a certai type, amely, () = polyomial i, e.g. + () = expoomial i, e.g. 3 () = (poly.) (exp.), e.g. @ C may other special cases ca also be solved, but we do t wat to get ito this (for those iterested, see Kelley ad Peterse, Differece Equatios, Academic Press (99)) Exercise Y + Y = Let s first fid oe particular solutio. Clearly Y is ot a costat fuctio (sice the Y + Y = 0 œ). Let s try Y = b + b 0, a liear polyomial Y + Y = [b ( + ) + b 0 ] [b + b 0 ] = b Thus, b =, while b 0 is arbitrary. But recall that the solutio (geeral) to the homogeeous related equatio is just a costat K. Thus, the geeral solutio to () is CHECK: Y + Y = K + ( + ) (K + ) = Y = K + Exercise Y + Y = 3 + The solutio to the related homogeeous equatio Y + Y = 0 is K, where K is determied by the iitial value of this sequece. We eed a particular solutio for the ohomogeeous equatio. Let s try 79
S. Tay MAT 344 Sprig 999 The ˆ 3 + = b + (b b 0 ) ˆ b = 3 b 0 = Y = b 0 + b Y = b 0 + b ( + ) (b 0 + b ) Ȳ = (b0 + b) + (b) CHECK: [3( + ) ] [3 ] = 3 8 + 6 + 0 = 3 +. Exercise 3 Y + + Y = 4 Solutio to the related homo equatio is K(). A particular solutio : try Y = b.4 The Y + + Y = b@4 + + b@4 = b@4 [4 + ] = b4 ˆ 4 = b@4 Y b = CHECK: 4 + + 4 = 4 [4 + ] = 4 Geeral Solutio: Y = 4 + K () Exercise 4 Y + 3Y = ( + 3)@7 solutio to related homo equatio K @ 3 For a particular solutio try: Y = (b 0 + b ) 7 Y + 3Y = [(b 0 + b ( + )]7 + 3[b 0 + b ]7 ˆ ( + 3)7 = (4b 0 + 7b )7 + @4b @7 ˆ 4b = 4b 0 + 7b = 3. ˆ b = b 0 = 4 6 80
S. Tay MAT 344 Sprig 999 CHECK: 6 % 4 ( % ) 7% & 3 6 % 4 7 = 3 6 & 6 % 7 4 7 % 7 4 & 3 4 7 = 3@7 + @7 = ( + 3)7 ˆ Y = K@3 + I geeral, for 6 % 4 7 Y + + ay = P m () s where P m () is a pol. of degree m, a ohomo solutio is give by Y = Q m ()s s a Y = Q m ()s s = a ad the coefficiets of the pol. Q m () (of deg m) ca be determied by subst. Ȳ ito above equatio (method of udetermied coeff.) For Y + + a Y + + a Y = P m () s we ca show that a particular solutio is Y = Q m ()s, s 8,8 Y = Q m ()s, s = 8, 8 Y = Q m ()s, s = 8 =8 where 8,8 are the roots of the characteristic pol. of the related HOMO equatio. Exercise Y + + Y + +Y = ( + 3) 8
S. Tay MAT 344 Sprig 999 Here P m () = + 3, s = ad the ch. pol. is 8 + 8 +, with roots 8 = 8 =. Thus, a particular solutio has form Y = (" 0 + " ) Solve for " 0, " by substitutio. [" 0 + " ( + )] + + [" 0 + " ( + )] + + (" 0 + " ) =( + 3) Y4(" 0 + " + " ) + 4(" 0 + " + " ) + " 0 + " = + 3 Y9" 0 + " = 3, 9" = ˆ" =, " 0 = 9 Exercise 7 Y + + Y + + Y = " Here P m () =, s = ", roots of characteristic polyomial 8 + 8 + are. A particular & ± i 3 solutio has form c". Substitutio yields c" + + c" + + c" = " Assume " 0. The c" + c" + c = or c(" + " + ) =. If " ot a root of the ch. Pol. the c = " % " %. Sice the roots of the ch. pol. are complex, if " 0 ú we kow that " is ot a root so we re doe. Exercise 3. Like Exercise above. Try Y + + Y + + Y = () Y = c () () + c ( + ) + () + c( + ) + () c = () c[ + 4 + 4 4 + ] = () c ˆ c = Y c = 8