D22. Fill the Jar


Figure 2: Cookies with radius one inch perfectly cut from an 11-by-11 inch square of dough.

You are making sugar cookies from a batch of dough in the following way: You take your dough and roll it into a perfect square of just the right thickness (you are a very precise baker). Then you cut out 1-inch radius, perfectly circular, cookies arranged in a square grid so that the cookies are tangent to each other and to at least two of the edges of the grid, as shown schematically in Figure 2. You bake those cookies, and then gather up all of the unused dough and repeat the process with what remains. You continue as long as the square formed from the scraps of the last iteration has enough room for at least one more cookie.

Suppose you start with the exact amount of dough needed to fit a 4-by-4 grid of cookies the first time you roll out the dough. How many cookies do you end up with in all? What about if you start with dough that just fits an n × n square of cookies to begin with?

This problem originally appeared in the Prisoner’s Dilemma in the 2024 Fall issue of the PMP Newsletter. Solutions are no longer being accepted for this Dilemma.

Show solution?  
Solution.

Consider the case n = 1 in which you precisely fit one cookie in a 2×2 square, leaving 4 π square units of cookie dough, which are “wasted” in that you cannot make any further cookies. This case shows two things:

(a) you must always waste at least 4 π square units of dough, and

(b) you can never waste 4 or more square units of dough.

Therefore, the process described is equivalent to making unit-circle cookies (each with area π) one at a time until the area of dough left lies in the interval [ 4 π , 4 ) (it just takes fewer steps when there is at least 16 square units of dough). If you start with an area A of dough, that process produces A + π 4 π cookies. So the general answer for Fill the Jar with an n × n grid is

4 n 2 + π 4 π ,

which comes out to 20 cookies in the case of starting with a 4-by-4 grid.