#PiDay Activity: Using chocolate chips to calculate the value of pi

Chartier_MathTry this fun Pi Day activity this year. Mathematician Tim Chartier has a recipe that is equal parts delicious and educational. Using chocolate chips and the handy print-outs below, mathematicians of all ages can calculate the value of pi. Start with the Simple as Pi recipe, then graduate to the Death by Chocolate Pi recipe. Take it to the next level by making larger grids at home. If you try this experiment, take a picture and send it in and we’ll post it here.

Download: Simple as Pi [Word document]
Download: Death by Chocolate Pi [Word document]

For details on the math behind this experiment please read the article below which is cross-posted from Tim’s personal blog. And if you like stuff like this, please check out his new book Math Bytes: Google Bombs, Chocolate-Covered Pi, and Other Cool Bits in Computing.

For more Pi Day features from Princeton University Press, please click here.


 

Chocolate Chip Pi

How can a kiss help us learn Calculus? If you sit and reflect on answers to this question, you are likely to journey down a mental road different than the one we will traverse. We will indeed use a kiss to motivate a central idea of Calculus, but it will be a Hershey kiss! In fact, we will have a small kiss, more like a peck on the cheek, as we will use white and milk chocolate chips. The math lies in how we choose which type of chip to use in our computation.

Let’s start with a simple chocolatey problem that will open a door to ideas of Calculus. A Hershey’s chocolate bar, as seen below, is 2.25 by 5.5 inches. We’ll ignore the depth of the bar and consider only a 2D projection. So, the area of the bar equals the product of 2.25 and 5.5 which is 12.375 square inches.

Note that twelve smaller rectangles comprise a Hershey bar. Suppose I eat 3 of them. How much area remains? We could find the area of each small rectangle. The total height of the bar is 2.25 inches. So, one smaller rectangle has a height of 2.25/3 = 0.75 inches. Similarly, a smaller rectangle has a width of 5.5/4 = 1.375. Thus, a rectangular piece of the bar has an area of 1.03125, which enables us to calculate the remaining uneaten bar to have an area of 9(1.03125) = 9.28125 square inches.

Let’s try another approach. Remember that the total area of the bar is 12.375. Nine of the twelve rectangular pieces remain. Therefore, 9/12ths of the bar remains. I can find the remaining area simply be computing 9/12*(12.375) = 9.28125. Notice how much easier this is than the first method. We’ll use this idea to estimate the value of π with chocolate, but this time we’ll use chocolate chips!

Let’s compute the area of a quarter circle of unit radius, which equals π/4 since the full circle has an area of π. Rather than find the exact area, let’s estimate. We’ll break our region into squares as seen below.

This is where the math enters. We will color the squares red or white. Let’s choose to color a square red if the upper right-hand corner of the square is in the shaded region and leave it white otherwise, which produces:

Notice, we could have made other choices. We could color a square red if the upper left-hand corner or even middle of the square is under the curve. Some choices will lead to more accurate estimates than others for a given curve. What choice would you make?

Again, the quarter circle had unit radius so our outer square is 1 by 1. Since eight of the 16 squares are filled, the total shaded area is 8/16.

How can such a grid of red and white squares yield an estimate of π? In the grid above, notice that 8/16 or 1/2 of the area is shaded red. This is also an approximation to the area of the quarter circle. So, 1/2 is our current approximation to π/4. So, π/4 ≈ 1/2. Solving for π we see that π ≈ 4*(1/2) = 2. Goodness, not a great estimate! Using more squares will lead to less error and a better estimate. For example, imagine using the grid below:

Where’s the chocolate? Rather than shading a square, we will place a milk chocolate chip on a square we would have colored red and a white chocolate chip on a region that would have been white. To begin, the six by six grid on the left becomes the chocolate chip mosaic we see on the right, which uses 14 white chocolate of the total 36 chips. So, our estimate of π is 2.4444. We are off by about 0.697.

Next, we move to an 11 by 11 grid of chocolate chips. If you count carefully, we use 83 milk chocolate chips of the 121 total. This gives us an estimate of 2.7438 for π, which correlates to an error of about 0.378.

Finally, with the help of public school teachers in my seminar Math through Popular Culture for the Charlotte Teachers Institute, we placed chocolate chips on a 54 by 54 grid. In the end, we used 2232 milk chocolate chips giving an estimate of 3.0617 having an error of 0.0799.

What do you notice is happening to the error as we reduce the size of the squares? Indeed, our estimates are converging to the exact area. Here lies a fundamental concept of Calculus. If we were able to construct such chocolate chip mosaics with grids of ever increasing size, then we would converge to the exact area. Said another way, as the area of the squares approaches zero, the limit of our estimates will converge to π. Keep in mind, we would need an infinite number of chocolate chips to estimate π exactly, which is a very irrational thing to do!

And finally, here is our group from the CTI seminar along with Austin Totty, a senior math major at Davidson College who helped present these ideas and lead the activity, with our chocolatey estimate for π.