next up previous
Next: Up: Previous:

Solution Techniques



Guess: T(n) = O(2n), which means T(n) $\leq$ c2n




\begin{displaymath}T(n) \;\;=\;\; T(n-1) \;+\; T(n-2) \;+\; \Theta(1)\end{displaymath}


\begin{displaymath}<= \;\; c 2^{n-1} \;+\; c2^{n-2} \;+\; \Theta(1)\end{displaymath}


\begin{displaymath}=\;\; 1/2c2^n + 1/4c2^n + \Theta(1)\end{displaymath}


\begin{displaymath}=\;\; 3/4c2^n + \Theta(1)\end{displaymath}


\begin{displaymath}<=\;\; c2^n\end{displaymath}

If $1/4c2^n \geq \Theta(1)$ or $c \geq 4\Theta(1)/2^n$.
True for sufficiently large n.

Boundary: T(0) = 1 $\leq$ c20 = c, c$\geq$1

Actually, T(n) = \(\Theta((\frac{1+\sqrt{5}}{2})^n)\).


next up previous
Next: Up: Previous: