The master theorem didn't work here. I tried to do the substitution method but I ended up with an additional term: $2Σ(i \cdot 3^i)$. Also I should find the solution $g(n)$ such as $f=\Theta(g)$.
Asked
Active
Viewed 251 times
0
-
3This is the very first case of the master theorem. Can you tell why you cannot make it work? – John L. Nov 29 '18 at 23:40
2 Answers
0
The given recurrence is: $T(n) = 3T(n/4) + \log n$
Using the substitution method, we get:
\begin{align} T(n) &= 3^2T \left(n/4^2\right) + \log n + 3\log (n/4) \\ &= 3^3T \left(n/4^3\right) + \log n + 3\log(n/4) + 9 \log(n/4^2)\\ \end{align} and so on.
Can you see a pattern now?

Gokul
- 520
- 5
- 17
-
I already found that T(n) = $log(n)Σ3^i - 2Σi*3^i$, the first sum is geometrical but I don't know how to calculate the second one? – Ely Toy Nov 29 '18 at 17:48
-
The second term is an AGP - arithmetico geometric series. You can Google that and you'll find methods to calculate the summation. The trick is to multiply the summation with a term (usually the common difference) and then do some algebraic manipulations. – Gokul Nov 29 '18 at 17:50
-
0
I use a simpler master theorem for scholar recurrences. Consider the general form $T(n) = aT(n/b) + f(n)$. Call $c=log_ba$. Now you have 3 cases:
- $\theta(n^c) = f(n)$ then $T(n) = \theta(f(n)log^k(n)) \text{ where }k\geq1$
- $\theta(n^c) \gt f(n)$ then $T(n) = \theta(n^c)$
- $\theta(n^c) \lt f(n)$ then $T(n) = \theta(f(n))$
In your exercise you have the 2nd case, so $T(n) = \theta(n^{log_43})$.
However this method works only with simple recurrences.

Emanuele
- 58
- 7