Question: Show that, if we use naive recursion, it takes exponential time ( Omega ( an ) for some a > 1 . ) time
Show that, if we use naive recursion, it takes exponential time Omega an for some a time tocompute the nth Fibonacci number Fn For simplicity, assume that adding any two numbers, regardlessof the their size, takes one unit of time. Hint: write out the recurrence for Tn the cost ofcomputing the nth Fibonacci number, and use induction. What happens if you try to prove a Omega nbound Try a value smaller than instead. Describe an algorithm that reuses Fibonacci numbers that you have already calculated in order tooutput the first n Fibonacci numbers much faster eg in polynomial time rather than the naiveexponential time algorithm How long does your algorithm take? State a Theta expression for the asymptotic run time of your algorithm.Again assume that adding any two numbers only takes one unit of time.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
