# (Solved): (2) A finite continued fraction is: a0+a1+a2++an1111 and may be denoted ...

(2) A finite continued fraction is: and may be denoted by . (a) Write a program that takes as inputs and gives the floating point value of the finite continued fraction using the above definition. (b) An infinite continued fraction for the golden ratio is: A convergent is obtained by terminating a continued fraction at a finite number of operations. The convergents for the continued fraction above are: Write a program that computes successive convergents until is found accurate to five significant digits. Include a copy of your code and a table with successive convergents. (c) A continued fraction for is: Assuming that you can work with infinite continued fractions the same way that you work with finite fractions, can you give a quick argument why this is true? Modify your program for the golden ratio above to compute to five significant digits. (d) For a given finite continued fraction , define and by: and . Then the continued fraction equals . Write a program that uses this recurrence relation to compute the continued fraction expansion for any , and compare the values you get for and with those you arrived at in parts (b), (c) above.

We have an Answer from Expert