Education Zone

Dots and Boxes

We had a Dots and Boxes tournament at our Golden Evening fundraising event last week.  It's a simple pen-and-paper game that many of us learned as children, but there's actually some deep mathematical theory behind it!

How to Play Dots and Boxes

Draw dots in an array. (A nice starting game is 16 dots in a 4×4 array.)

Players decide who will play first. They then take turns connecting pairs of neighboring dots in a row or column, like with Player A and Player B below.

Players decide who will play first. They then take turns connecting pairs of neighboring dots in a row or column.

When a player finishes a 1x1 box, they claim it with their initial and then must take another move.

This can lead to cascades of claimed boxes, but a turn must end on a move that does not finish a box, if possible.

The game ends when all boxes have been claimed. The player who has claimed the most boxes wins.

Player A wins!

If you play enough games against skilled opponents, you’ll notice that (except for possibly a handful of captured boxes) the endgame tends to look like some number of winding corridors.

Each corridor in the board above is a potential cascade, in which a single player can claim every box. The trick is not to be the player to make the first move in a corridor, since the opposing player will be the one to capture boxes in the resulting cascade!

In the board above, it is still Player A’s turn, so they will have to tee up another cascade, with the boxes this time going to Player B. If they play this way, it seems like entire corridors will be captured by alternating players. However, Player A could have instead responded to Player B’s move as follows:

Since Player A’s last move didn’t capture a box, it is now Player B’s turn to either tee up another cascade for Player A or to capture two boxes and then tee up a cascade for Player A. By sacrificing two boxes in that cascade, Player A can remain in control of how the game will unfold! You might see the strategy for Player A if Player B tees up one of the other two path-like corridors, but how should Player A handle the cyclic corridor in the middle? (Hint: Player A would need to sacrifice more than two boxes to remain in control!)

Each player would like to steer the game so that by the time only corridors are left, the opposing player must make the first move. In his book The Dots-and-Boxes Game: Sophisticated Child’s Play, Elwyn Berlekamp gives a rule of thumb for making this happen in simple games. He calls path-like corridors chains and cyclic corridors loops. A chain is long if it consists of 3 or more boxes while a loop is long if it consists of 4 or more boxes.

Berlekamp’s Long Chain Rule

Try to make

# of dots + # of long chains + # of long loops

  • even if you move first (Player A)

  • odd if you move second (Player B)

While this rule of thumb gives you something to aim for, steering the game there can be quite challenging! To see Elwyn explain how to always win on a 9-box board (4×4 array of dots), check out this Numberphile video. For a deeper dive into the strategy, check out Elwyn’s books The Dots-and-Boxes Game: Sophisticated Child’s Play and Winning Ways for Your Mathematical Plays: Volume 3 (coauthored with John Conway and Richard Guy).