Introduction to Mathematica

Math 242 practice problems

Name: _________________

Learning Goals: Gain proficiency with basic Mathematica constructs, including variables, arithmetic operations, loops, and accumulators.

Your task: Complete the following exercises before class on Friday, February 9. You can do the work in this notebook, below each numbered item.

Grading: Upload your solutions as a Mathematica notebook to the Intro Mathematica assignment on the Moodle site for Math 242. Each problem will be graded on a Satisfactory/Unsatisfactory scale. If you use a loop with an accumulator to produce a result close to the stated answer, 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, or email Prof. Wright.

Problem 1

Use a loop with an accumulator to compute partial sums of the following:

s=1+(1/4)+(1/9)+(1/16)+(1/25)+…

Start with just a few terms. Once your code works, try several thousand terms. Using decimal numbers, you should find that your results converge to ((π^2)/6)≈1.64493.

Problem 2

Use a loop with an accumulator to compute partial products of the following:

r=2((4/3))((16/15))((36/35))((64/63))…

Again, start with just a few factors, but work up to a thousand or more factors in the product. You should find that your results converge to π.