1

We have this recurrence: $$T(n)=10T(\frac{n}{3})+n\sqrt{n}.$$

We can solve it using Master Theorem and say it is $\Theta(n^{\log_3{10}})$. I want to prove it using induction but I don't know the correct and perfect procedure for proving these kinds of problems using induction.

I know that

  • $f(n) = \mathcal{O}(g(n))$ if there exist positive constants $c$ and $n_0$ such that $f(n)\le cg(n)$ for all $n\ge n_0$.
  • $f(n) = \Omega(g(n))$ if there exist positive constants $c$ and $n_0$ such that $f(n) \geq cg(n)$ for all $n \ge n_0$

And I know if $f(n)=\mathcal{O}(g(n))$ and $f(n)=\Omega(g(n))$, then $f(n)=\Theta(g(n))$. So I first tried to show $T(n)=\mathcal{O}(n^{\log_3{10}})$. I assumed we know $T(n)\le cn^{\log_3{10}}$ for some positive constant $c$.

Then we have:

$\begin{align} T(n) = & 10T(\frac{n}{3})+n\sqrt{n}\\ \leq & 10(c(\frac{n}{3})^{\log_3{10}})+n\sqrt{n}\\ = & 10c(10)^{\log_3{\frac{n}{3}}}+n\sqrt{n}\\ = & 10c(10)^{(\log_3{n})-1}+n\sqrt{n}\\ = & c(10)^{\log_3{n}}+n\sqrt{n}\\ = & cn^{\log_3{10}}+n\sqrt{n} \end{align}$

At this point I don't know how can I prove that this expression is lower than or equal to $c_1n^{\log_3{10}}$. I don't even know that $c_1$ is equal to the $c$ above necessarily or no? How can I complete this?

And we know this is the "step" part of the induction (if its correct), how can we prove the base cases and find $n_0$ and $c$.

Ainsley H.
  • 17,823
  • 3
  • 43
  • 68

2 Answers2

1

I'll solve a simpler recurrence, $$T(n) = 4T(n/2) + n,$$ but the point is the same, namely that your induction hypothesis is too weak.

We show something stronger: $T(n) \leq c \cdot n^2 - dn$ for some $d$. (!!)

So, by induction, we want to show that $T(n) \leq cn^2 - dn$, and we'll set $d$ at the end.

Induction hypothesis. For all $m < n$, $T(m) \leq cm^2 - dm$.

Induction step. $T(n) = 4T(n/2) + n \leq 4(c \frac{n}{2}^2 - d\frac{n}{2}) + n = 4(c\frac{n^2}{4} - d\frac{n}{2}) + n $.

Simplify to get $cn^2 - 2dn + n = cn^2 -dn -dn +n = cn^2 -dn + (1-d)n$.

Now we've got it: $cn^2 -dn + (1-d)n \leq cn^2 -dn$ as long as $d \geq 1$.

Let $d = 1$, and we have that $T(n) \leq cn^2 -dn$, which is what we set out to prove. It follows that $T(n) = O(n^2)$.


For your problem, first try to solve the above, then solve $T(n) = 4T(n/2) + n \sqrt n$. For the latter, you will probably need to show that $T(n) \leq cn^2 - dn \sqrt n$, and it should probably work if you just set $d = \sqrt 2 + 1$.

Ainsley H.
  • 17,823
  • 3
  • 43
  • 68
0

Let $n = 3^m$ and Q(m) = T($3^m$), and rewrite the recursion in terms of m and it’s easy.

gnasher729
  • 32,238
  • 36
  • 56