How to solve recurrence $T(n) = T(\lceil{\frac{2n}{3}}\rceil)$?

73 Views Asked by At

I found a problem that gives recurrence relations as $$T(n) = 0 \qquad \text{for }n = 1$$$$T(n) = 1 \qquad \text{for }n = 2$$ $$T(n) = T(\lceil{\frac{2n}{3}}\rceil) \qquad \text{for n > 2}$$

Since we know $$\frac{2n}{3} \leqslant \lceil{\frac{2n}{3}}\rceil < \frac{2n}{3} + 1$$

I have tried to use two recursive tree to solve the recurrence. One tree divide $n$ to $\frac{2n}{3}$, while another tree divide $n$ to $\frac{2n}{3} + 1$. The first tree gives me the lower bound for $T(n)$, as the second tree gives me the upper bound for $T(n)$.

However, I don't know how to count the second tree. The size of the node in the second tree follows the pattern that $$(\frac{2}{3})^{l}n + (\frac{2}{3})^{l-1} + (\frac{2}{3})^{l-2} + \dots + (\frac{2}{3})^{0}$$

To find the height of that tree, I used geometric series as following:

$$\begin{align} (\frac{2}{3})^{l}n + (\frac{2}{3})^{l-1} + (\frac{2}{3})^{l-2} + \dots + (\frac{2}{3})^{0} &= 2 \\ (\frac{2}{3})^{l}n + \frac{1 - (\frac{2}{3})^{l-1+1}}{1 - \frac{2}{3}} &= 2\\ (\frac{2}{3})^{l}n +3 - 3(\frac{2}{3})^{l}&= 2 \\ (\frac{2}{3})^{l}(n-3)&= -1 \\ l &= \log_{\frac{2}{3}}^{\frac{1}{3-n}}\end{align}$$

It turns out that if $n > 3$, my tree height is undefined, which is what I don't want.

Can anyone point out what I did wrong, or give me some ideas of other solutions?

Any replies and answers are appreciated.