Calculate the complexity of $T\left( n\right) =T\left( \dfrac{n}{3}\right) +T\left( \dfrac{2n}{3}\right) +\theta \left( 1 \right)$
Without using the master theorem.
My take on this:
I found that the answer should be $\theta \left( n \right)$ but I have issues proving the upper bound (big O), even when using induction (the lower bound is quite easy to show using induction).
As I understand it, the total amount of work is the amount of nodes in the recursion tree, since the work on each node is $\theta \left( 1 \right)$.
But how many nodes are there? I tried using the fact that the height of the tree is $\log _{1.5}{n}$ and to bound it from above with the amount of nodes in a complete, perfectly balanced binary tree of height $\log _{1.5}{n}$, which is $2^{\log _{1.5}\left( n\right) +1}-1$, but I can't get $O\left( n\right)$ no matter what do I do, and I can’t think of a better bound.
Edit: I also saw this: How to solve the recurrence $T(n) = T(n/3) + T(2n/3)$? but didn't quite understand the answer, might not be something that we have covered
Assume that $T(n) = an^b$, and let $c$ be the constant term behind $\theta(1)$. Then the recurrence relation becomes
$$an^b = a\left(\frac{n}{3}\right)^b + a\left(\frac{2n}{3}\right)^b + c$$ $$3^b = 1 + 2^b + \frac{3^bc}{an^b}$$
As $n \to \infty$, that last term goes to 0, so we get $3^b = 1 + 2^b$, which has the solution $b = 1$. So $T$ is (asymptotically equal to) a first-degree polynomial.
– Dan Mar 31 '23 at 22:58