Time Complexity through recurrence relation

142 Views Asked by At

Suppose I have a code whose runtime complexity is described as a second degree linear homogeneous recursion formula as fn = fn−1 + fn−2, n>=3 where f1 = 1 and f2 = 2. I want to find constant c such that the runtime complexity of the algorithm can be described as Θ(c^n). I solved the recurrence relation but I don't understand how to compute it as Θ(c^n). Let me know if you need more clarification.

1

There are 1 best solutions below

4
On

$$f_n=\frac{\text{Fibonacci}(n)+\text{Lucas}(n)}{2}$$ As $$\underset{n\to \infty }{\text{lim}}\;\frac{f_n}{\phi ^n}=\frac{\sqrt{5}+5}{10} $$ We can say that the $c$ you are looking for is the golden ratio $$\phi=\frac{\sqrt{5}+1}{2}$$