Proving recurrence equation $T(n)=T(\frac{n}{4})+T(\frac{n}{2})+n^2$ is $\theta(n^2)$

90 Views Asked by At

$T(n)=T(\frac{n}{4})+T(\frac{n}{2})+n^2$

I tried to solve this problem by recurrence equation.


By recursion tree, I can know the rule of cost, $\frac{5^0}{4^0}n^2, \frac{5^1}{4^1}n^2, \frac{5^2}{4^4}n^2....$

But There is no height, so I used upper bound and lower bound.

1. upper bound : height is $\infty$

\begin{align} \sum_{i=0}^\infty\frac{5^i}{4^{2i}} &= n^2\sum_{i=0}^\infty\frac{5^i}{16^{i}}\\ &=n^2\sum_{i=0}^\infty(\frac{5}{16})^i\\ &=n^2\frac{1}{1-\frac{5}{16}}\\ &=\frac{16}{11}n^2 \end{align}

upper bound is $\frac{16}{11}n^2$, $T(n)=O(n^2)$ is correct.

2. lower bound : I can remove $T(n/2)$ from above equation.

$T(n)=T(n/4)+n^2$

By master theorem, case 3

$n^2=\Omega(n^{\log_3 6+\epsilon})$ is correct when $\epsilon\ge15$ and $1(\frac{n}{4})^2\ge cf(n)$ when $c\ge \frac{1}{16}$.

Therefore, lower bound of T(n) became $T(n)=\theta(n^2)$ (when there is no $T(n/2)$)

upper bound is $O(n^2)$ and lower bound is $\theta(n^2)$, so I can conclude answer of above recurrence equation is $T(n)=\theta(n^2)$


Am I right?

1

There are 1 best solutions below

0
On

Use Leighton's version of Akra-Bazzi theorem. It gives the result directly for such "unbalanced" divide and conquer recurrences, and even allows for some wiggle room (you can't divide into quarters and halves unless $n$ is a power of $4$, for instance).