Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The reciprocal Fibonacci constant is defined by the infinite sum: psi sigma^infi

ID: 2080617 • Letter: T

Question

The reciprocal Fibonacci constant is defined by the infinite sum: psi sigma^infinity_n = 1 1/F_n Where F_n are the Fibonacci numbers 1, 1, 2, 3, 5, 8, 13, ... Each element in this sequence of numbers is the sum of the previous two. Write a MATLAB program in a script file that calculates the first hundred Fibonacci numbers F_n. Start by setting the first two elements in F_n series equal to 1, then determine the series F_n up to n = 100. Then find the value of the constant psi for n = 10 to 100 with an increment of 10. The program must display the result using fprintf as: The Fibonacci constant for n = XXX is XXXXX The Fibonacci constant for n = XXX is XXXXX where XX is the value of n used and XXXXX is the value of the constant psi displayed in f format with 15 decimal digits. What do you conclude from your results?

Explanation / Answer

N=100;
fib=zeros(1,N);
fib(1)=1;
fib(2)=1;
sum=fib(1)+fib(2);
for(k=3;k<=N;K++)

    fib(k)=fib(k-2)+fib(k-1);
   sum=sum+fib(k);

end

fprintf('%g ',sum);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote