Solving a recurrence with 2 recurrences

204 Views Asked by At

I am trying to solve the following recurrence: $$T(n) = T\Big(\frac{n}{3}\Big) + T\Big(\frac{2n}{3}\Big) + O(n)$$

I do not want to use the Akra-Bazzi method nor draw out a recurrence tree. I do know that the solution should be $n\log n$ but what is a way in which I could prove this? Intuitively to me it seems that it should be $O(n)$ Is there any other way to which I could solve this?

EDIT: I want to solve this recurrence in order to compare it to $T(n) = T\big(\frac{n}{5}\big) + T\big(\frac{7n}{10}\big) + O(n) = O(n)$ and why these two recurrence relations have different runtimes

1

There are 1 best solutions below

3
On

Suppose $T(n) =T(an)+T((1-a)n)+O(n) $ where $0 < a < 1$.

If $T(m) =O(m \log(m)) $ for $m < n$ then $T(m) < cm \log(m) $.

Therefore

$\begin{array}\\ T(n) &< can\log(an)+c(1-a)n\log((1-a)n)+O(n)\\ &= can(\log(a)+\log(n))+c(1-a)n(\log(1-a)+\log(n))+O(n)\\ &= can\log(a)+can\log(n)+c(1-a)n\log(1-a)+c(1-a)n\log(n)+O(n)\\ &= cn(a\log(a)+(1-a)\log(1-a))+cn\log(n)(a+(1-a))+O(n)\\ &= cn\log(n)+cn(a\log(a)+(1-a)\log(1-a))+O(n)\\ &= cn\log(n)+O(n) \qquad\text{since } |a\log(a)+(1-a)\log(1-a)| \le \ln(2)\\ \end{array} $