Question: q1) Assuming we are using the below function to calculate Fibonacci numbers: function f = fibnum(n) % FIBNUM Fibonacci number. % FIBNUM(n) generates the nth

q1)

Assuming we are using the below function to calculate Fibonacci numbers:

function f = fibnum(n) % FIBNUM Fibonacci number. % FIBNUM(n) generates the nth Fibonacci number. if n

How many arithmetic, logical, and assignment operations do we need to calculate the nth Fibonacci number, i.e. fibnum(n)? (assume each

function f = fibnum(n)

Note fibnum(0) == 1 here.

Simplify your answer (so it takes as few characters as possible) and use matlab notation with no whitespace and no assignment to enter your answer. The answer may contain fibnum(n) and/or fibnum(n-), such as

100*fibnum(n-1)^(2*fibnum(n))-300

Co-efficients like 100 and 2 should come in front of fibnum() where necessary.

(hints : https://www.ics.uci.edu/~eppstein/161/960109.html

and there should be other strategies to get the answer as well)

q2)

Following the previous question, calculate how many operations you need for calculating fibnum(51). Make sure that your answer is precise. You can use uint64(x) to display x without scientific notation if it fits in a 64-bit unsigned integer. Do not use scientific notation unless your number does not fit in a 64-bit unsigned integer.

q3)

In question 2.10 in the Moler portion of your textbook, Fibonacci power series are introduced. Three different methods to calculate the value of the power series are shown. Evaluate using these three methods in MATLAB. What is the value of F(0.6) for each method? Use "format long" in MATLAB. Copy your answers from MATLAB and past it in the blank. Method one gives____ , method two gives____ and method three gives______

What is the value of F((1/q1) Assuming we are using the below function to calculate Fibonacci numbers:) - 2e-9) for each method? Use "format long" in MATLAB. (function f = fibnum(n) % FIBNUM Fibonacci number. % FIBNUM(n) generates the represents the Golden Ratio)

Method one gives_____ , method two gives_____ and method three gives______

q4)

Following the previous question, when calculating results in MATLAB, which method should be the most accurate?

1) Third method
2) Second method
3) First method

q5)

What is the percentage calculation error for each method for F(0.6) with respect to the exact value? Use "format short" in MATLAB. Copy your answers from MATLAB and past it in the blank.

The error for method one is ____%, for method two is _____ % and for method three is _____ %.

q6)What is the percentage calculation error for each method for F((1/phi) - 2e-9) with respect to the most-accurate calculation method? Use "format short" in MATLAB.

The error for method one is ____%, for method two is____ % and for method three is______ %.

q7) Write a few paragraphs and compare these three implementations with each other.

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!