Question: P4. Finish the python script pi.e.py, which contains several subproblems: (a) (15 points) Write a function to compute the following (truncated) continued fractions defined as
P4. Finish the python script pi.e.py, which contains several subproblems: (a) (15 points) Write a function to compute the following (truncated) continued fractions defined as (1) for any two input vectors a- ao, an] and b-[bo,. b+l] ao + a1 + b2 b3 + ant (b) (15 bonus points) One amazing formula of Ramanujan is (2). Find the smallest in- teger n that can make the sum in the left hand side to be equal to up to fifteen decimal digits. (For the double factorial part, you should import the code you wrote in double fact.py, use tol 10-16 and treat this part as accurate enough.) 1 + 1 + n+ 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
