Give asymptotic upper and lower bound for \(𝑇(𝑛)\) given below. Assume…

2019

Give asymptotic upper and lower bound for \(𝑇(𝑛)\) given below. Assume \(𝑇(𝑛)\) is constant for \(𝑛≤2\). Assume \(𝑇(𝑛)\) is constant for \(𝑛≤2\).  \(T(n) = 4T( \sqrt{n} ) + \lg^2n\)

  1. A.

    \(T(n) = \theta (\lg ( \lg ^2 n) \lg n )\)

  2. B.

    \(T(n) = \theta ( \lg ^2 n \lg n )\)

  3. C.

    \(T(n) = \theta (\lg ^2 n \lg \lg n )\)

  4. D.

    \(T(n) = \theta (\lg ( \lg n) \lg n )\)

Attempted by 116 students.

Show answer & explanation

Correct answer: C

Key idea: change variables to transform the recurrence into a standard form.

  1. Let m = lg n and define S(m) = T(2^m) (so S(lg n) = T(n)).

  2. Rewrite the recurrence in terms of m: since √n = 2^{m/2}, we have T(√n) = S(m/2). Also lg^2 n = m^2. Hence

    S(m) = 4S(m/2) + m^2

  3. Apply the Master theorem to S(m) = aS(m/b) + f(m) with a = 4, b = 2, f(m) = m^2. We have m^{log_b a} = m^{log_2 4} = m^2, so f(m) = Theta(m^{log_b a}).

    By the Master theorem (case 2), S(m) = Theta(m^2 · lg m).

  4. Translate back to n using m = lg n:

    T(n) = S(lg n) = Theta((lg n)^2 · lg lg n).

Answer: T(n) = Theta((lg n)^2 · lg lg n).

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Coding For Placement