This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Solutions to the Practice Final Exam December 2, 2009 1. Solution: (a) a (0) = 1 ,a (1) = 2 ,a (2) = 7 ,a (3) = 26 ,a (4) = 97, and a (5) = 362. (b) Notice that the characteristic polynomial of the recurrence relation is x 2 4 x +1, which has roots 2 ± √ 3, yielding template solution a ( n ) = α (2 + √ 3) n + β (2 √ 3) n . From the initial values, we have α + β = 1 α (2 + √ 3) + β (2 √ 3) = 2 which has solution α = 1 / 2 and β = 1 / 2. Thus, we have a ( n ) = (2 + √ 3) n 2 + (2 √ 3) n 2 . (c) Proof by induction. Step 1. (Base case) It is easy to verify that a (0) = (2+ √ 3) 2 + (2 √ 3) 2 = 1 and (2+ √ 3) 1 2 + (2 √ 3) 1 2 = 2. Step 2. (Induction) Suppose a ( n ) = (2+ √ 3) n 2 + (2 √ 3) n 2 for some n ≥ 1. We then compute a ( n + 1) = 4 a ( n ) a ( n 1) = 4( (2 + √ 3) n 2 + (2 √ 3) n 2 ) ( (2 + √ 3) n 1 2 + (2 √ 3) n 1 2 ) = (2 + √ 3) n 1 2 (4(2 + √ 3) 1) + (2 √ 3) n 1 2 (4(2 √ 3) 1) = (2 + √ 3) n 1 2 (2 + √ 3) 2 + (2 √ 3) n 1 2 (2 √ 3) 2 = (2 + √ 3) n +1 2 + (2 √ 3) n +1 2 and the induction step is complete. 2. Solution: Notice that x ( n + 1) + n + 1 = 2( x ( n ) + n ) + 1. Letting y ( n ) = x ( n ) + n , we have y ( n + 1) = 2 y ( n ) + 1 , n ≥ 1 . Since x (1) = 1, then y (1) = 2. Guessing now that the general solution has the form y ( n ) = α 2 n + β , if we plug into the recurrence we get α 2 n +1 + β = 2 · α 2 n + 2 β + 1 which implies β = 1. Now substituting into the recurrence for1....
View
Full
Document
This note was uploaded on 02/02/2012 for the course CSE 21 taught by Professor Graham during the Fall '07 term at UCSD.
 Fall '07
 Graham

Click to edit the document details