0
$\begingroup$

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

$$ T(e^n) = 2\cdot T(e^{n-1}) + e^n, \text{ where $e$ is the natural logarithm} $$

To solve this and find a Θ bound, i tried the following: I put k=en, and the equation transforms into: $$ T(k)=2\cdot T(k/e)+k $$ Then, i try to use the master theorem. According to master theorem, $a=2, b=e>2 $ and $f(k)=k$. So, we have the case where $f(k)=\Omega(n^{log_a b + \epsilon})$ for some $\epsilon$>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?Thanks

$\endgroup$
1
$\begingroup$

Looks fine to me. Even better, you can plug $T(k)=2T(k/e)+k$ directly in Wolfram Alpha to get an exact answer.

$\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.