StreakPeaked· Practice

ExamsGATEEngineering Mathematics

Consider the following recurrence relation: T(n) = 2T(n − 1) + n2ⁿ for n > 0, T(0) = 1. Which ONE of the following options is CORRECT?

  1. T(n) = Θ(n² 2ⁿ)
  2. T(n) = Θ(n 2ⁿ)
  3. T(n) = Θ((log n)² 2ⁿ)
  4. T(n) = Θ(4ⁿ)

Correct answer: T(n) = Θ(n² 2ⁿ)

Solution

Let S(n)=T(n)/2^n. Dividing T(n)=2T(n-1)+n*2^n by 2^n gives S(n)=S(n-1)+n, so S(n)=Theta(n^2). Therefore T(n)=Theta(n^2 * 2^n), which is the first option, not Theta(4^n).

Related GATE Engineering Mathematics questions

⚔️ Practice GATE Engineering Mathematics free + battle 1v1 →