Question: On a platform of your choice, implement the three different methods for computing the Fibonacci numbers (recursive, iterative, and matrix) discussed in lecture. Use integer

On a platform of your choice, implement the three different methods for computing the Fibonacci

numbers (recursive, iterative, and matrix) discussed in lecture. Use integer variables. How fast does

each method appear to be? Give precise timings if possible. (This is deliberately open-ended; give

what you feel is a reasonable answer. You will need to figure out how to time processes on the system

you are using, if you do not already know.) Can you determine the first Fibonacci number where you

reach integer overflow? (If your platform does not have integer overflow lucky you! you might

see how far each process gets after five minutes.)

Since you should reach integer overflow with the faster methods quite quickly, modify your programs

so that they return the Fibonacci numbers modulo 65536 = 216. (In other words, make all of your

arithmetic modulo 216 this will avoid overflow! You must do this regardless of whether or not your

system overflows.) For each method, what is the largest Fibonacci number you can compute in one

minute of machine time?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!