Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SCHEME (R5RS) 2. Abstracting the product of a series (a) The above function sum is an abstraction of the sigma notation for summation n=a Write

SCHEME (R5RS)

image text in transcribed

2. Abstracting the product of a series (a) The above function sum is an abstraction of the sigma notation for summation n=a Write a function (product term a next b) that abstracts the pi notation for the product of a series. You should name your function (product-i term a next b) if you choose to write an iterative version of the function. I f(n)=f(a) f(b) n=a (b) If your product function is in a recursive form, write a second one that is in the iterative form named (product-i term a next b), and vice-versa (that is, you should write 2 versions of product, one recursive and one iterative while following the naming convention (c) Use your product functions to define an function (pi-approx n) that returns an approximation of using the first n terms of the following: T 2 x 4 x 4 x6 x 6 x8 43x3x5x57x7 = You will need to define appropriate functions for term and next. (d) Show that your pi-approx function works for 1, 100, and 1000. What do these tests demonstrate to you? 2. Abstracting the product of a series (a) The above function sum is an abstraction of the sigma notation for summation n=a Write a function (product term a next b) that abstracts the pi notation for the product of a series. You should name your function (product-i term a next b) if you choose to write an iterative version of the function. I f(n)=f(a) f(b) n=a (b) If your product function is in a recursive form, write a second one that is in the iterative form named (product-i term a next b), and vice-versa (that is, you should write 2 versions of product, one recursive and one iterative while following the naming convention (c) Use your product functions to define an function (pi-approx n) that returns an approximation of using the first n terms of the following: T 2 x 4 x 4 x6 x 6 x8 43x3x5x57x7 = You will need to define appropriate functions for term and next. (d) Show that your pi-approx function works for 1, 100, and 1000. What do these tests demonstrate to you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Guide To Client Server Databases

Authors: Joe Salemi

2nd Edition

1562763105, 978-1562763107

More Books

Students also viewed these Databases questions