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

Problem 3 (20 pts) Looking closely at the infinite series it would be reasonable

ID: 3676515 • Letter: P

Question

Problem 3 (20 pts) Looking closely at the infinite series it would be reasonable (and corect) to conclude that it diverges. However, it may be surprising that the similar infinite series does not diverge, instead converging to a number (albeit irrational): 1645. In similar fashion, when reciprocals of the factorials are added together, they also produce a series that converges to an important (and irrational) number with which you are probably familiar: e (Euler's number). =stst.. +-+-+-..=e n!1 1 26 24 2.718 Another convergent series is that of the reciprocals of the Fibonacci numbers, which sum to produce another irrational number called the reciprocal Fibonacci constant, or . (As an aside, note that the Fibonacci series-and thus v-are intimately related to the golden rutio, ~ 1.61803.) (a) Write a MATLAB script named PP1 P3a that calls your function get fac to estimatee (b) Write a MATI AR script named PPI P3bthat calls your function get fib to estimate . Your estimates must be to at least 10 decimal places. (Hint: You'll need to set a tolerance in each script to determine when to finish refining its estimate and exit the loop.)

Explanation / Answer

% get_fac.m file
a=0;
k=1;
out=0.0;
while 1/get_fib(k) > 1e-10
out = out+1/get_fib(k);
k=k+1;
end
format long;
out

% get_fib.m file
function [ output ] = get_fib( n )

if n==1
output=1;
elseif n==0
output=0;
  
else
a1=0;
a2=1;
i=1;
while i<n
a3 = a1+a2;
a1=a2;
a2=a3;
i=i+1;
end
output =a3;
end

end

% PP1_P3a.m file
a=0;
k=0;
out=0.0;
while 1/get_fac(k) > 1e-10
out = out+1/get_fac(k);
k=k+1;
end
format long;
out

% PP1_P3b.m file
a=0;
k=1;
out=0.0;
while 1/get_fib(k) > 1e-10
out = out+1/get_fib(k);
k=k+1;
end
format long;
out

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