GATE / CS ARCHIVE

GATE CSE 2002 / QUESTION 1.3

Recurrence on powers of two

Algorithms · Asymptotic Analysis & Recurrences · Full GATE CSE 2002 paper

GATE 2002, Q1.3 1 mark · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 1.3, GATE 2002: Solve T(2^k) = 3T(2^(k−1)) + 1, with T(1) = 1.
(A) 2^k; (B) (3^(k+1)−1)/2; (C) 3^(log₂ k); (D) 2^(log₃ k).
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step 1: Remove the powers of two from the argument.

Step 2: Writing out S(1)=4, S(2)=13, S(3)=40 reveals the repeated multiply-by-three pattern. In general the homogeneous contribution is 3kS(0), while the added ones contribute 1+3+…+3k−1. Evaluating that geometric sum gives the stated formula; at k=0 it correctly returns1.

Conclusion: Put S(k)=T(2k). Then S(k)=3S(k−1)+1 with S(0)=1. Iteration gives 3k+sum_(j=0)k−13j=(3k+1−1)/2, B.

Original paper, page 1