2
$\begingroup$

I have a recurrence relation, it is like the following:

$T(e^n) = 2(T(e^{n-1})) + e^n$, where $e$ is the base of the natural logarithm.

To solve this and find a $\Theta$ bound, I tried the following: I put $k=e^n$, and the equation transforms into:

$$T(k)=2T(k/e)+k$$

Then, I try to use the Master Theorem. According to Master Theorem, $a=2$, $b=e\gt 2$ and $f(k)=k$. So, we have the case where $f(k)=\Omega(n^{\log_b a+ε})$ for some $ε\gt 0$, thus we have $T(k)=\Theta(f(k))=\Theta(k)$. Then put $k=n$, we have $T(n)=\Theta(n)$. Does my solution have any mistakes?

$\endgroup$
1
$\begingroup$

$c=1\gt \ln 2\approx0.7$. That's case 3 of the master theorem. It follows that:

$$T(n)=\Theta(n)$$

Your solution is fine.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.