Iterative Methods for π

MATH 242 practice problems

Learning Goals: Gain proficiency with programming in Mathematica. Develop and implement an algorithm to solve a mathematical problem, and interpret your results.

Your task: Implement two algorithms for approximating π, as described below, and assess the accuracy of each.

Due: Wednesday, September 17, at 5pm. Try to complete this before class, but you can ask last-minute questions on Wednesday before turning it in. Upload your solution as a Mathematica notebook to the Iterative Methods for Pi assignment on Moodle.

Grading: If you successfully implement each algorithm and assess how the number of correct digits of π depends on the number of terms/iterations, you will earn a Satisfactory grade.

Need help? Review the notes from class (which are posed on the course web site), talk with your classmates, email Prof. Wright, or visit the help session.

Name:

What assistance did you receive and what resources did you use (if any) while working on this assignment?

(your response here)

Problem 1: Chudnovsky Sum

Implement a module that computes partial sums of the Chudnovsky formula (Equation (1.13) on page 35 in the text). Make a table showing how the number of correct digits of π increases with the number of terms that you add up. Use your computations to answer the question: What is the relationship between the number of terms you add and the number of correct digits of π  you compute?

Problem 2: Borwein Algorithm

Implement a module that computes approximations of π using the Borwein algorithm, Algorithm 1.24 on page 37 in the text. Your module should accept one input parameter: an integer that specifies how many iterations of the algorithm to compute. Make a table showing how the number of correct digits of π increases with the number of terms that you add up. Answer the question: What is the relationship between the number of iterations and the number of correct digits of π?