15
$\begingroup$

Two players take turns breaking a piece of chocolate consisting of 50 small squares arranged in a 5x10 rectangular grid. At each turn, they may break along the division lines of the squares. The player who first obtains a single square of chocolate wins.

Which player has a winning strategy and how can they force a win?

Clarification:

During the game, no part of the chocolate bar is discarded or eaten.

Sample game:

Suppose Player 1 breaks the chocolate bar at the division line indicated by a left arrow:

5x10 chocolate bar about to be split

This results in two pieces:

Chocolate bar split into a 4x10 and a 1x10 piece

Suppose Player 2 breaks the smaller piece at the division line indicated by an up arrow:

1x10 piece about to be split

Now there are three pieces, the unaffected 4x10 piece and two new pieces:

1x10 piece split into a 1x1 and a 1x9 piece

Player 2 wins in this sample game because now there is a piece of chocolate that consists of a single square.


Attribution: Mathematical Circles (Russian Experience)

$\endgroup$
2
  • 1
    $\begingroup$ Related: en.m.wikipedia.org/wiki/Chomp $\endgroup$
    – RobPratt
    Commented Oct 9 at 12:20
  • $\begingroup$ It looks like Chomp but besides being a poset game it is a different one. (But the "not eating any of it" part probably refers to that.) $\endgroup$
    – Florian F
    Commented Oct 11 at 13:28

3 Answers 3

26
$\begingroup$

Player one can always force a win!

enter image description here First they split the bar in half like so.

Then

They mirror the same dissection made in the moves subsequently made by player 2 on any one of those halves until player 2 is forced to create a single row of chocolate which is inevitable and then once player 2 does so they just need to break off a square on that row to win!

Just to add

There are maximum 3 moves which player 2 can make before they generate such a row because… firstly, to prevent a single row they need to break the half in any one of these ways highlighted in blue. enter image description here Doing will always only leave two more ways to break it (highlighted in green in both diagrams):… after this a single row has to be made enter image description here enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Simplest and most elegant explanation of how P1 wins :) $\endgroup$ Commented Oct 9 at 17:15
12
$\begingroup$

Fascinatingly,

every possible move that doesn't create a width-1 strip is winning!

This is a byproduct of a general claim:

every 5×n bar with n greater than 1 has nim-value 1.
Proof: By induction.
2×2, 2×3, and 3×3 bars are our "zero games": any player who has to move in a position consisting of only these bars loses, because they are forced to create a width-1 strip. The only moves in 5×2 or 5×3 bars that don't lose immediately break them into two zero games, so these bars have nim-value 1.
For larger 5×n bars, there are two types of moves: Either split them widthwise into two smaller 5×k bars, whose nim-values of 1 cancel to yield 0, or split them lengthwise to yield a 2×n bar and 3×n bar. Player 2 loses immediately upon making any further lengthwise splits, so their only moves are widthwise splits on one of the bars, which Player 1 can match on the other bar. Since this game also has nim-value 0, 1 is the least unreachable nim-value, and thus the value of the 5×n bar.

In fact, I can prove something even stronger:

Claim: For any chocolate bar, define its row (resp. column) game to be the bar with the same number of rows (columns) and two columns (rows), and its row (column) value as the game value of the row (column) game. If both the row and column value are nonzero, the bar's value is 1; otherwise, the bar's value is the greater of the row and column values.

Proof: The claim is true for bars with two rows and/or columns, by definition and the fact that the game value of a 2-by-2 bar is 0. Assume the claim holds for all bars that can be broken off from a given bar.

There are three cases:
1. Both the row and column values are nonzero numbers, say, R and C.
Any reduction in rows creates two positions with values either 1 or C. No such move can create a position with value 1; either a move creates two positions with value C, with sum 0, or a position with value 1 and another position with nonzero value, whose sum cannot be 1. There must be at least one reduction in rows that creates two equal-value positions, because otherwise no such move would exist in the row game, and its value would be 0, a contradiction. By an analogous argument on columns, we can conclude that the bar's value is 1.
2: Both the row and column values are 0.
The values reachable by reducing rows are precisely those reachable in the row game, by assumption, and likewise for reducing columns. Since neither game can produce a position with zero value (else its value would be nonzero, a contradiction), neither can the full bar, and so its value is 0.
3: Exactly one value is zero. W.L.O.G. the column and row values are 0 and R, respectively.
Any value reachable in the row game can be reached in the full bar by reducing rows, so the value of the bar cannot be less than R. The only values reachable by reducing columns are sums of two values that are either 1 or R; since none of these can equal R, the value of the bar cannot be greater than R either, and must be equal to it.

$\endgroup$
8
  • $\begingroup$ Am I right that this answer assumes the first cut is vertical (hence the 5×n)? That is, an initial (2×10,3×10) cut does not seem to be covered by this answer. $\endgroup$ Commented Oct 9 at 17:23
  • 1
    $\begingroup$ @DewiMorgan The case of an initial lengthwise split is explicitly mentioned - "For larger 5×n bars, there are two types of moves: Either split them widthwise... or split them lengthwise to yield a 2×n bar and 3×n bar" $\endgroup$ Commented Oct 9 at 18:09
  • $\begingroup$ Ah, good call :) $\endgroup$ Commented Oct 9 at 23:14
  • $\begingroup$ Very nice! What about the general m-by-n grid? $\endgroup$ Commented Oct 9 at 23:45
  • 1
    $\begingroup$ @AxiomaticSystem So, OEIS A274161, then? $\endgroup$
    – Rosie F
    Commented Oct 10 at 19:22
4
$\begingroup$

The player ending up with an $n \times 1$ rectangle after their move loses, because their opponent can simply break apart a single piece.

In turn, the player ending up with only a $2 \times 2$ square wins, meaning one who ended up with a $3 \times 2$ rectangle also wins.

The player to end up with only a $3 \times 3$ square also wins.

The player to end up with only a $4 \times 3$ rectangle loses. The only way for the opponent to not immediately lose is to create $2$ $2 \times 3$ rectangles.

If a player ends up with multiple pieces with some "winning" and some "losing" rectangles, they shouldn't end up with "immediately losing" ($n \times 1$) ones if they are to win. If all the rectangles left to them are $2 \times 2$ squares, they'll lose no matter what they do. If there's a winning combination for that player, adding $2 \times 2$ squares to that doesn't change anything.

If a player leaves only winning (for themself when they leave them to the opponent, making themselves Player 2) rectangles to their opponent, the former must stick to the rectangle the opponent has played until the latter switches to another, then follow them there.

If leaving a single $n \times m$ rectangle wins A the game, then A loses if they leave a $2n \times m$ or $n \times 2m$ one, because then B can break it in half. Similarly, if $n \times m$ and $n \times k$ both win, then $n \times (k+m)$ loses. That means $2,3 \times 4,5,6$ lose. For leaving an $n \times m$ rectangle to be winning for A, no matter how B dissects it, both parts can't be winning.

If A leaves a $4 \times 4$ square, B needs to cut it in half to not immediately lose. Then A cuts one of the $2 \times 4$ rectangles into two squares, and B does the same. A has no choice but to create a thin rectangle, and loses. Creating two equally large losing rectangles from a bigger one means going to a different rectange from your opponent. No matter what they do, you can win. So if leaving an $n \times m$ rectangle loses A the game, $2n \times m$ and $n \times 2m$ are also losing rectangles.

If A leaves a $5 \times 5$ square, B needs to cut it into $2 \times 5$ and $3 \times 5$ parts to not immediately lose. No matter what A does, they end up cutting a thin rectangle and lose. So $10 \times 5$ is also a losing square for Player 2. Player 1 can win by starting from cutting the entire chocolate bar in half.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.