Skip to content
Related Articles

Related Articles

Improve Article
GATE | GATE-CS-2002 | Question 3
  • Difficulty Level : Basic
  • Last Updated : 29 Nov, 2014

The solution to the recurrence equation T(2k) = 3 T(2k-1) + 1, T (1) = 1, is:
(A) 2k
(B) (3k + 1 – 1)/2
(C) 3log2k
(D) 2log3k


Answer: (B)

Explanation: We have

T (2k) = 3  T (2k-1) + 1

= 32  T (2k-2) + 1 + 3
= 33  T (2k-3) + 1 + 3 + 9
. . . (k steps of recursion (recursion depth))
= 3k  T (2k-k) + (1 + 3 + 9 + 27 + … + 3k-1)
= 3k + ( ( 3k – 1 ) / 2 )
= ( (2 * 3k) + 3k – 1 )/2
= ( (3 * 3k) – 1 ) / 2
= (3k+1 – 1) / 2

Hence, B is the correct choice.

 

Please comment below if you find anything wrong in the above post.

Quiz of this Question

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :