Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I have ran the program in Python and the results is: time = 0.000021s, fib ( 1) = 1 time = 0.000008s, fib ( 2)

I have ran the program in Python and the results is:

time = 0.000021s, fib ( 1) = 1

time = 0.000008s, fib ( 2) = 1

time = 0.000010s, fib ( 3) = 2

time = 0.000009s, fib ( 4) = 3

time = 0.000010s, fib ( 5) = 5

time = 0.000012s, fib ( 6) = 8

time = 0.000013s, fib ( 7) = 13

time = 0.000016s, fib ( 8) = 21

time = 0.000026s, fib ( 9) = 34

time = 0.000038s, fib (10) = 55

time = 0.000041s, fib (11) = 89

time = 0.000061s, fib (12) = 144

time = 0.000134s, fib (13) = 233

time = 0.000234s, fib (14) = 377

time = 0.000257s, fib (15) = 610

time = 0.000447s, fib (16) = 987

time = 0.000883s, fib (17) = 1597

time = 0.000990s, fib (18) = 2584

time = 0.001549s, fib (19) = 4181

time = 0.003623s, fib (20) = 6765

time = 0.005461s, fib (21) = 10946

time = 0.007457s, fib (22) = 17711

time = 0.012765s, fib (23) = 28657

time = 0.018480s, fib (24) = 46368

time = 0.029364s, fib (25) = 75025

time = 0.047008s, fib (26) = 121393

time = 0.074532s, fib (27) = 196418

time = 0.119904s, fib (28) = 317811

time = 0.197828s, fib (29) = 514229

time = 0.319705s, fib (30) = 832040

time = 0.521673s, fib (31) = 1346269

time = 0.838743s, fib (32) = 2178309

time = 1.370793s, fib (33) = 3524578

time = 2.255055s, fib (34) = 5702887

time = 3.586283s, fib (35) = 9227465

time = 6.058530s, fib (36) = 14930352

time = 9.493363s, fib (37) = 24157817

time = 15.155847s, fib (38) = 39088169

time = 24.375846s, fib (39) = 63245986

time = 38.599397s, fib (40) = 102334155

time = 64.031710s, fib (41) = 165580141

time = 106.664884s, fib (42) = 267914296

time = 153.008759s, fib (43) = 433494437

time = 246.208761s, fib (44) = 701408733

time = 398.400057s, fib (45) = 1134903170

time = 642.709271s, fib (46) = 1836311903

time = 1040.975008s, fib (47) = 2971215073

time = 1643.471291s, fib (48) = 4807526976

time = 2659.710512s, fib (49) = 7778742049

time = 4303.312800s, fib (50) = 1258626902

image text in transcribed

image text in transcribed

Above is the question, I'm trying to create the graph based on the results and getting the equation but I do not know how. Please provide me with a good instruction how to create the graph and get the right equation because every equation I'm getting are wrong. Thank you

5. Download the file "csc220a1.py" from Canvas and run the program. This program will run with either Python 2.x or 3.x. It contains a naive implementation to calculate the Fibonacci numbers and gives timing information. When you run the program, it should produce lines similar to the followings: time - time- time 0.000006s, fib (3)- 0.000035s, fib 1) 0.000022s, fib 2) - Be patient, the program will take anywhere between 2 to 5 hours to complete. When the program is running, you should minimize any other activities on the computer so the running time data will not be disturbed. Once the program execution is finished, you can use the data to plot the times versus the values of n in a graph. If you use logarithm scale for the times, you will get a curve very close to a straight line (especially towards the timing data at the end). Now visually inspect your curve and discard some beginning data that is not so straight. Your curve should now look like the following 1000 100 s 1O 30 36 38 40 50 The followings are what you need to do: a. (1 point) Copy and paste your graph below: Second 10000 1000 100 10 10 20 40 50 60 0.1 0.01 0.001 0.0001 0.00001 0.000001 b. (2 points) Based on the data collected, find an expression T(n) to estimate the time (in seconds) it takes to calculate fib(n): T(n) - 7E-07e0.4403n Hint: Microsoft Excel has a "trend line" feature that may be useful. (2 points) Use the expression you got in part (b) to estimate the number of years it takes c. to calculate fib(100) and fib(150): T(75)- T(100)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions