Solve the Recurrence Relation T(n) = 2T(n/3) + 2, T(1) = 1
Given, T(n) = 2*T(n/3) + 2 and T(1) = 1
Now, T(3) = 2*T(3/3) + 2 = 2*T(1) + 2 = 2*1 + 2 = 22
T(32) = T(9) = 2*T(9/3) + 2 = 2*T(3) + 2 = 2*[2*2] + 2 = 23 + 2
T(33) = T(27) = 2*T(27/3) + 2 = 2*(23 + 2) + 2 = 24 + 22 + 2
T(34) = T(81) = 2*T(81/3) + 2 = 2*(24 + 22 + 2) + 2 = 25 + 23 + 22 + 2
T(35) = T(243) = 2*T(243/3) + 2 = 2*(25 + 23 + 22 + 2) + 2 = 26 + 24 + 23 + 22 + 2
Proceeding in this way we get, T(3n) = 2n+1 + 2n-1 + 2n-2 + 2n-3 + ......... + 23 + 22 + 2.
Therefore, the required solution is, T(3n) = 2n+1 + 2n-1 + 2n-2 + 2n-3 + ......... + 23 + 22 + 2.
Get Answers For Free
Most questions answered within 1 hours.