Math Problem Statement

Solve T(n) = 9T(n/6) + n log2 n, by master method. (10 marks) try case 2

Solution

To solve the recurrence relation T(n)=9T(n6)+nlog2nT(n) = 9T\left(\frac{n}{6}\right) + n \log_2 n using the Master Method, we follow these steps:

Step 1: Identify Parameters for Master Method

The recurrence is in the form:

T(n)=aT(nb)+f(n)T(n) = aT\left(\frac{n}{b}\right) + f(n)

  • Here, a=9a = 9 (number of subproblems),
  • b=6b = 6 (factor by which the problem size is reduced),
  • f(n)=nlog2nf(n) = n \log_2 n (the non-recursive part).

Step 2: Calculate nlogban^{\log_b a}

We need to find nlogban^{\log_b a} where:

logba=log69=log9log6\log_b a = \log_6 9 = \frac{\log 9}{\log 6}

Using the change of base formula with log69\log_6 9:

log69=log9log6=log(32)log(2×3)=2log3log2+log3\log_6 9 = \frac{\log 9}{\log 6} = \frac{\log (3^2)}{\log (2 \times 3)} = \frac{2 \log 3}{\log 2 + \log 3}

Approximating log30.4771\log 3 \approx 0.4771 and log20.3010\log 2 \approx 0.3010:

log692×0.47710.3010+0.4771=0.95420.77811.226\log_6 9 \approx \frac{2 \times 0.4771}{0.3010 + 0.4771} = \frac{0.9542}{0.7781} \approx 1.226

Thus, nlog69=n1.226n^{\log_6 9} = n^{1.226}.

Step 3: Compare f(n)f(n) with nlogban^{\log_b a}

  • f(n)=nlog2nf(n) = n \log_2 n
  • nlogba=n1.226n^{\log_b a} = n^{1.226}

To apply the Master Theorem, we compare f(n)f(n) with nlogban^{\log_b a}:

  • f(n)=O(n1.226ϵ)f(n) = O(n^{1.226 - \epsilon}) for some ϵ>0\epsilon > 0 — Case 1
  • f(n)=Θ(n1.226)f(n) = \Theta(n^{1.226}) — Case 2
  • f(n)=Ω(n1.226+ϵ)f(n) = \Omega(n^{1.226 + \epsilon}) and af(nb)cf(n)af\left(\frac{n}{b}\right) \leq cf(n) for some c<1c < 1 and sufficiently large nn — Case 3

Applying Case 2

  • f(n)=nlog2nf(n) = n \log_2 n grows slower than n1.226n^{1.226}, but they are not polynomially related because the log2n\log_2 n factor grows slower than any polynomial in nn.
  • However, for Case 2, f(n)=Θ(nlogbalogkn)f(n) = \Theta(n^{\log_b a} \log^k n) is often a form considered when k=0k = 0, and here k=1k = 1. So, we need to re-check our basis, comparing against n1.226n^{1.226}.

Reassessing Case 2 with Specific Functions

Since nlog2n=Θ(n1.226)n \log_2 n = \Theta(n^{1.226}), f(n)f(n) is not precisely Θ(n1.226)\Theta(n^{1.226}), suggesting we use a comparison:

  • f(n)=nlog2nf(n) = n \log_2 n is indeed Ω(n1.226ϵ)\Omega(n^{1.226 - \epsilon}) for small ϵ\epsilon, indicating it is not quite a Case

Ask a new question for Free

By Image

Drop file here or Click Here to upload

Math Problem Analysis

Mathematical Concepts

Recurrence Relations
Master Theorem
Logarithmic Functions

Formulas

Master Theorem for Divide and Conquer Recurrences

Theorems

Master Theorem

Suitable Grade Level

Advanced Undergraduate