Iterative Methods for π

Math 242 practice problems

Name: _________________

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: Friday, February 17 at classtime. Upload your solution as a Mathematica notebook to the Iterative Methods for Pi assignment (Moodle link).

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.

Problem 1: Chudnovsky Sum

Implement a module that computes partial sums of the Chudnovsky formula (equation (1.11) 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.21. 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 π?