All Exams Test series for 1 year @ ₹349 only
Question

Which of the following is correct solution of the given recurrence relation? $T(n) = 3T(n/4) + n \log n$

The correct answer is
$\theta (n \log n)$

To find the solution to the given recurrence relation, we use the Master Theorem. The recurrence is:

\(T(n) = 3T(n/4) + n \log n\)

The Master Theorem provides a way to determine the asymptotic behavior of recursive programs. It states:

For a recurrence of the form \(T(n) = aT(n/b) + f(n)\) where:

  • \(a \geq 1\) is the number of recursive calls
  • \(b > 1\) is the factor by which the subproblem size is divided
  • \(f(n)\) is an asymptotically positive function

The asymptotic behavior of \(T(n)\) is determined by comparing \(f(n)\) with \(n^{\log_b a}\):

  1. If \(f(n) = \Theta(n^{\log_b a-\epsilon})\) for some \(\epsilon > 0\), then \(T(n) = \Theta(n^{\log_b a})\).
  2. If \(f(n) = \Theta(n^{\log_b a} \log^k n)\) where \(k \geq 0\), then \(T(n) = \Theta(n^{\log_b a} \log^{k+1} n)\).
  3. If \(f(n) = \Theta(n^{\log_b a+\epsilon})\) for some \(\epsilon > 0\), then \(T(n) = \Theta(f(n))\).

Now, applying these to the recurrence relation:

  • \(a = 3\), \(b = 4\), \(f(n) = n \log n\)
  • Calculate \(n^{\log_b a} = n^{\log_4 3}\)

We need to compare \(f(n) = n \log n\) with \(n^{\log_4 3}\).

Since \(\log_4 3 \approx 0.792\), we compare:

\(n \log n\) versus \(n^{0.792}\)

Clearly, \(n \log n\) grows faster than \(n^{0.792}\). Thus, we are in the third case of the Master Theorem. Therefore, the solution is:

\(T(n) = \Theta(n \log n)\)

This matches with the option:

\(\theta (n \log n)\)

 

Was this answer helpful?

Important Questions from Recurrences

  1. The solution of the recurrence relation

    \(T(n) \le \begin{cases} \theta(1) & \text{if } n \le 80 \\ T\left(\frac{n}{s}\right) + T\left(\frac{7n}{10} + 6\right) + O(n) & \text{if } n \gt 80 \end{cases}\)

    is :

  2. The solution of the recurrence relation of \(T(n) = 3T\left(\text{floor}\left(\frac{n}{4}\right)\right) + n\) is

  3. Which of the following is the solution of the following recurrence relation

    T(n) = T(2n/3) + 1?

  4. The asymptotic upper bound solution of the recurrence relation given by

    \(T(n) = 2T\left(\frac{n}{2}\right) + \frac{n}{lg\ n}\) is :

  5. A recursive function h, is defined as follows :

    h(m) = k, if m = 0

    = 1, if m = 1

    = 2 h(m – 1) + 4h(m – 2), if m ≥ 2

    If the value of h(4) is 88 then the value of k is :

Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App