0% found this document useful (0 votes)
14 views

HW Recursion

1) The document solves two recurrence relations: tn = n if n=0, 1 5tn-1-6tn-2 and T(n) = 2T(n/2) + lg n. 2) For the first relation, the roots of the characteristic polynomial are 3 and 2. The general solution is tn = c13n + c22n. 3) For the second relation, the homogeneous solution is T(n) = O(2lg n) and the particular solution is k, so the overall solution is T(n) = O(n).

Uploaded by

John Tran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

HW Recursion

1) The document solves two recurrence relations: tn = n if n=0, 1 5tn-1-6tn-2 and T(n) = 2T(n/2) + lg n. 2) For the first relation, the roots of the characteristic polynomial are 3 and 2. The general solution is tn = c13n + c22n. 3) For the second relation, the homogeneous solution is T(n) = O(2lg n) and the particular solution is k, so the overall solution is T(n) = O(n).

Uploaded by

John Tran
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Solve Problem 4.

29 exactly
tn = n if n=0, 1 5tn-1-6tn-2

The characteristic polynomial: x2-5x+6 = 0 (x-3)(x-2)=0 (x-3)(xRoots: 3,2 General solution: tn = c13n + c22n Since t0 is 0 and t1 is 1 c1+ c2 = 0; 3c1 + 2c2 = 1; Solve the system of linear equations, c1 = 1 and c2 = 1 So,

tn = 3n - 2n

Solve Problem 4.37


T(n) = 2T(n/2) + lg n Define t(k) = T(2k) = 2T(2k/2) + lg 2k = 2T(2k-1) + k = 2t(k-1) + k 2t(kHomogeneous part t(k)-2t(k-1)=0 t(k)-2t(k The characteristic polynomial: x-2 = 0 x Root: 2 The inhomogeneous part: k  b is 1, p(k) is k.  Extra roots: 1, 1 T(n) = t(lg n) t(lg General solution: = O(2lg n) t(k) = c11k + c2k1k + c32k = O(n) k) = O(2

You might also like