EXERCISE 1 Suppose that nValues and dValues are functions of one argument (the termindex)that return the ni and di of the terms of the continued fraction. Deﬁne the function cont-frac such that evaluating cont-frac(k) computes the value of the k-term ﬁnite continued fraction. Check your procedures by approximating 1/φ using constant functions nValues and dValues that return the value 1 for any input value.
EXERCISE 2 One of the ﬁrst formulas for π was given around 1658 by the English mathematician Lord Brouncker:
4/π−1=1/(2+9/(2+25/(2+49/(2+81/(2+··· Deﬁne a function estimate-pi(k) that uses cont-frac and appropriately deﬁned nValues and dValues functions to estimate the value of π