PuzzleReels
Sections

Coins on a Round Table

The maths · Episode 5 · 2:55 · gives the answer

The puzzle

Two players take turns putting identical coins flat on a round table. A coin may not overlap another or hang off the edge, and the first player who cannot place one loses.

Would you rather go first, or second?

The maths, properly

Call the middle of the table O, the table's radius R and a coin's radius r. A coin is legal when its centre is within R−r of O and at least 2r from every other coin's centre, so coins may touch but not overlap.

There is nothing to count

The obvious first idea is parity: if the table always held the same number of coins, odd would mean the first player wins. But the count is not fixed. It depends on where the coins went, and the same table ends full with 9 coins in one game and 14 in another:

123456789
9 coins, and nobody can move
1234567891011121314
14 coins, on the same table
first player   second

The film's 400 random games ended with every count from 9 to 14 coins. 2,000 more here, on the same table, ended with anything from 8 to 15, and the first player won 52% of them. Searching the tree is no better: a coin can go anywhere in the free space, so every move has infinitely many choices. Neither the count nor the search gets started, which is why the answer has to be a strategy.

Proof one: the mirror

This is the film's route. Suppose the position is symmetric (every coin's mirror image through O is also a coin) and the centre coin is down. Your opponent puts a coin at p. You reply at −p. Three things make that legal:

  1. It is on the table. The table is symmetric about O, so −p is as far inside the edge as p is.
  2. No older coin is in the way. If some coin C overlapped the reply, then C's mirror image, which is also down, would overlap p. But p was legal.
  3. It does not hit the coin it mirrors. Coins at p and −p have centres 2|p| apart, so they overlap only if |p|<r. A coin that close to O covers the centre, and the centre is taken.

After your reply the position is symmetric again, so the argument repeats. You always have a move. Each coin uses up area, so the game ends, and it can only end with your opponent stuck.

Taking the centre on its own is not the trick: in the film's third game the first player opens in the middle, takes the biggest gap each time, and loses with 12 coins down. The centre is there for step three, and only for step three.

Proof two: the positions you want to hand over

The film proves the mirror always has a reply. There is a more general way to say the same thing, which explains the hole in the claim.

In a game like this, where both players have the same moves and the one who cannot move loses, a position is lost for the player to move if every move from it leads to a position that is won for the player to move, and won if some move leads to a lost one. You win by always handing your opponent a lost position.

Let S be the positions that are symmetric through O and in which no legal coin can cover O. Then:

  • Every move out of a position in S leaves S, since it breaks the symmetry.
  • Every move out of a position in S can be answered by its mirror image, back into S. That is steps one to three above; step three now needs only "nothing can cover O", which is part of being in S.

So the player who must move from S can never get out for good, and since the game is finite, he is the one who gets stuck. Every position in S is lost for the player to move.

Now the cases fall out. On an ordinary table the empty position is not in S, because a coin can cover O; but one move puts it there: the coin on the centre. So the first player wins. On a table with a hole in the middle, no coin can ever cover O, since it would hang over the hole; the empty table is already in S, and the first player is the one handed a lost position. The second player wins by mirroring from the first move.

Proof three: search the tree, on squared paper

On a real table the tree has infinitely many branches. Put the game on squared paper and it does not: the table is a board of w×h unit squares, a coin is a 2×2 square on the grid lines, and two coins may touch but not overlap. Now every position has finitely many moves, and the whole tree can be searched by computer. scripts/coins.mjs searches every board up to 7×7, with and without the middle cut out, 31 boards in all.

Square coins on squared paper, every game searched
BoardThe mirror saysThe search saysPositions searched
4 × 4firstfirst11
4 × 5nothingsecond26
5 × 5nothingsecond42
5 × 5, centre cut outsecondsecond31
5 × 6nothingsecond201
6 × 6firstfirst690
6 × 6, centre cut outsecondsecond335
6 × 7nothingfirst2,317
7 × 7nothingfirst4,206
7 × 7, centre cut outsecondsecond2,148

The mirror's prediction agrees with the search on all 16 boards where it makes one. And the boards where it makes none are the interesting ones. A 5×5 board has a centre, but the centre is the middle of a square, and a 2×2 coin can never be centred on it. Worse, the four coins that would cover it each overlap their own mirror image. So neither proof applies. The search says the second player wins there; on 7×7, where the same is true, it says the first. Of the boards the mirror is silent about, the first player wins 9 and the second 6.

So "the table has a centre" is not quite enough. A coin has to be able to sit exactly on it, or be unable to cover it at all.

A worked case: the film's game

The film plays it properly once. The first player takes the centre and then mirrors 6 times; after 13 coins the opponent has no room left. The dashed lines join each move to its reply, through the centre:

12345678910111213
The film's mirror game: centre, then 6 pairs
first player   second

Beat the mirror

Play against it. Tap the table to put a coin down, or focus the table and use the arrow keys and Enter. Then let yourself go first, put your coin on the centre, and watch the mirror run out of answers. On the table with a hole, the mirror wins from second place.

The film's mirror game, move by move
MoveWhoWhereMirror of
1mirror(0.000, 0.000)the centre
2opponent(0.534, 0.529)—
3mirror(-0.534, -0.529)move 2
4opponent(-0.603, 0.194)—
5mirror(0.603, -0.194)move 4
6opponent(-0.114, 0.400)—
7mirror(0.114, -0.400)move 6
8opponent(-0.106, -0.749)—
9mirror(0.106, 0.749)move 8
10opponent(0.486, -0.609)—
11mirror(-0.486, 0.609)move 10
12opponent(-0.769, -0.191)—
13mirror(0.769, 0.191)move 12

Generalising

Any shape with a centre. The proof never used roundness. Square, hexagonal, a six-pointed star: any table that a half-turn about its centre leaves unchanged will do, convex or not, provided a coin fits on the centre. If the table is also convex, that last condition is automatic: if a coin fits with its centre at c, by symmetry one fits at −c, and on a convex table one then fits at every point between, including O.

A table with a hole. As in proof two, if no legal coin can cover the centre, the empty table is already symmetric and safe to hand over, so the second player wins by mirroring from the start.

Other pieces. Steps one and two work for any pieces, as long as a piece may be turned round. Step three needs this: a piece that overlaps its own mirror image must cover the centre. That is true for every convex piece, because if a point x of the piece has its mirror −x in the piece too, then so is the midpoint O. So square tiles, dominoes, ellipses and triangles all mirror safely. For the first player's opening move, the piece also has to be symmetric itself, so that the position is symmetric after it: squares and ellipses yes, triangles no. On a table with a hole, where the second player mirrors and nobody opens in the centre, even triangles are fine.

Three dimensions. Balls in a box, a ball in the middle first, then the reflection through the centre. Nothing in the proof cared about the dimension.

When the trick fails

No centre. The film's last table is an L. A half-turn does not map it to itself, so there is no mirror and no proof. That does not mean the first player loses; it means this argument says nothing, and this page has no other.

A mirror line instead of a centre. If a table is symmetric only about a line, the obvious copy is the reflection in that line. It fails at step three: a coin lying across the line overlaps its own reflection, and one coin cannot block a whole line the way it blocks a point.

A piece that wraps round. A horseshoe that curls more than halfway round the centre coin, without touching it, overlaps its own mirror image. Step three needs convex pieces, and the horseshoe is the reason.

A centre no coin can sit on. The squared-paper boards above, where the centre is the middle of a square.

How many coins fit?

The game is finite because coins take area: every coin lies entirely on the table and no two overlap, so n coins need nπr2≤πR2, which on the film's table is n≤(R/r)2=23.80. No game can last more than 23 coins. In the other direction, 19 coins fit: one in the middle, six round it, and twelve touching each other round the outside, which needs a table 1+2+6≈4.864 coin-radii across and the film's is 4.88. Where between 19 and 23 the true maximum lies is a circle-packing question, and the game does not need it: the mirror wins without knowing how many coins the table will hold.

Checking it

scripts/coins.mjs checks all of this and writes every number on this page. Whether a coin still fits is decided exactly, by walking the edge of every region a new centre must avoid, not by trying points on a grid.

The film's games. Every coin in games.json, which is what the film draws, is re-checked for legality, and every final position is checked to have no room left anywhere. The film's own script judged "full" on a grid of points, and the exact check agrees.

The film's games, re-checked
GameCoinsWho could not moveRoom left anywhere
He plays at random10first playernone
He hugs the rim12first playernone
He takes the biggest gap12first playernone
Nine coins9second playernone
Fourteen coins14first playernone
The mirror13second playernone

Random games. The count is not fixed:

2,000 random games on the film's table
Coins when it endedGamesWho won
82second
943first
10358second
11842first
12601second
13145first
148second
151first

The mirror. It plays 750 games against three kinds of opponent: one playing at random, one always getting as close to the centre as it can, and one hugging the edges of the free space. Every reply is checked legal before it goes down, the position is checked symmetric after it, and the mirror never loses. The step-three fact itself, that a coin overlaps its mirror image exactly when it is within r of the centre, is checked at 20,000 random points.

The mirror against three kinds of opponent. It lost none of them.
TableMirror playsGamesCoins at the end
Roundfirst1509 to 17
Squarefirst15011 to 21
Hexagonfirst1509 to 19
Round, with a holesecond1508 to 12
Square, with a holesecond1508 to 16

Squared paper. Each board is searched to the end, every position remembered so it is solved once: 11,668 positions across the 31 boards. On the 18 smallest boards a second, slower search, with nothing remembered, gives the same winners.

The lab. It runs site/lib/coins-core.mjs, the same text the script imports. The script pastes that text in the way the page does and plays 180 games with it, against the module, on all three of the lab's tables, checking that every move agrees.

Where this shows up

  • Copying in other games. In Nim with two equal heaps, the second player wins by always making the heaps equal again. Winning Ways, the standard book on games like these, calls copying strategies Tweedledum and Tweedledee.
  • Hex. John Nash showed the first player can always win at Hex, by arguing that a winning strategy for the second player would let the first steal it. That proves a winning strategy exists without saying what it is. The coin table is the opposite case: the winning strategy is written out in two sentences.

Try it yourself

1. The table has a round hole in the middle. Do you go first or second?

Second. No coin can cover the centre, so the empty table is already symmetric and safe. Mirror every move through the centre and you always have a reply.

2. On a 6 × 6 board of squares, with 2 × 2 coins on the grid lines, who wins?

The first player. The middle 2×2 square is centred exactly on the board's centre: take it, then mirror. The search agrees.

3. Why can neither player mirror on a 5 × 5 board, and what changes if the middle square is cut out?

The centre is the middle of a square, and coins sit on the grid lines, so none can be centred on it; and the four coins that cover it each overlap their own mirror image. Cut the middle square out and nothing can cover the centre any more, so the second player wins by mirroring.

4. Show that no game on the film's table can last more than 23 coins.

The coins lie inside the table without overlapping, so nπr2≤πR2 and n≤(R/r)2=23.80.