Math Puzzle: Steal the Piggy Bank

You and I are sitting at a table with a pile of 50 quarters and an empty piggy bank. We will take turns placing anywhere from one to 10 quarters in the bank at a time. Whoever places the last quarter in the piggy bank gets to keep it. You go first: What’s your starting move to guarantee a win?

You can guarantee that you win by following a specific strategy. Try thinking backward. How many quarters do you want there to be on the table at the start of my final turn?

The only way to guarantee a win is to place exactly six quarters on your first move.

This is easiest to see by working backward. You want to corner me into a situation in which no matter what move I make, you can place the last quarter. You get your wish if at any point it becomes my turn when 11 quarters remain on the table. In that situation, no matter what move I make, you will be left with somewhere between one and 10 quarters on your turn, and you can place them all in the bank for the win. How do you ensure that it’s my turn when 11 quarters remain? By ensuring that it’s my turn when 22 quarters remain! In that situation, I have to place between one and 10 quarters, leaving you with somewhere between 12 and 21 quarters. If you’re left with 12, you should place one; if you’re left with 13, you should place two, and so on, leaving me with 11 no matter what. You ensure that it’s my turn when 22 quarters remain by ensuring it’s my turn when 33 quarters remain, and you ensure the latter by ensuring it’s my turn when 44 quarters remain. So by placing six quarters on your first turn, you can force it to be my turn when 44, 33, 22 and 11 quarters remain.

A sample game could play out as follows. The key numbers are bolded.

You place six quarters to leave me with 44.

I place one quarter, leaving you with 43.

So you place 10 quarters to leave me with 33.

I place 10 quarters, leaving you with 23.

So you place one quarter to leave me with 22.

I place four quarters, leaving you with 18.

So you place seven quarters to leave me with 11.

I place seven quarters, leaving you with four.

You place the last four quarters and win the piggy bank.

We’d love to hear from you! E-mail us at games@sciam.com to share your experience.