Pick 2 or 3

Players A and B are playing a game:

  • There are 29 pieces on a game board.
  • Players alternate turns, with player A starting.
  • Each turn, the player can pick 2 or 3 pieces.
  • The player who picks up the last piece on the board wins.
  • If only 1 piece is left, then no one can pick it up, and the game is tied.

Assuming that the players will play optimally, which player can confirm their victory?

Player A Player B Neither

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Tarmo Taipale
Oct 24, 2016

Relevant wiki: Invariant Principle - Problem Solving

Lemma: If there are 5 n 5n pieces left for some positive integer n n , then the second person to move will win.

Proof: Let's suppose there are 5 n 5n pieces left with some positive integer n n . This means that the second player is able to force 5 ( n 1 ) 5(n-1) pieces to be left after their next turn. That is, if the first player picks 3, the second player will pick 2, and if the first player picks 2, the second player will pick 3. Finally, there will be 5 pieces left, and no matter what the first player now picks, the second player will win. _ \square

In this game, there are 29 pieces, that is 5 n + 4 5n+4 with n = 5 n=5 , so player A can't become "the second player" described above with their first turn. If player A now picked 2 pieces, there would be 27 pieces left, giving player B the opportunity to force 25 pieces on the board which is 5 n 5n with n = 5 n=5 which would mean player B would become "the second player" and B's victory would be confirmed. For this reason, A picks 3, leaving 26 pieces.

Now, if B picked 3, player A would have the opportunity to confirm his victory by picking 3 and leaving 20 which is 5 n 5n with n = 4 n=4 . Instead, player B picks 2 and leaves 24 pieces on the board.

Now the situation is similar to the starting situation: There are 5 n + 4 5n+4 pieces on the board with a positive integer n n and it's player A's turn. The actions described above will repeat themselves until there are 4 pieces and it's A's turn again. As picking 2 now would let player B win by picking 2, player A picks 3, leaving only 1 piece and forcing the game to be tied.

This means, n e i t h e r \boxed{neither} player can confirm their victory.


Corollary: If there are 5 n + 4 5n + 4 pieces left for some positive integer n n , then the game will tie.

Can you figure out what happens for 5 n + 1 , 5 n + 2 , 5 n + 3 5n + 1, 5n+2, 5n+3 pieces?

Oh wow! I didn't expect this! I was so sure that B could force a win.

I've made some edits to make the problem and solution cleaner to read.

Calvin Lin Staff - 4 years, 7 months ago

Great problem, Tarmo! Its unusual to see that neither player can force a win in these sorts of games! (+1) :0)

Geoff Pilling - 4 years, 7 months ago

The cases for 5 n , 5 n + 4 5n , 5n+4 are said by Tarmo.

Now for 5 n + 2 , 5 n + 3 5n+2,5n+3 each cases if player A starts as a first player then player will pick 2 2 or 3 3 pieces leaving 5 n 5n pieces that will lead to loss of player B and A wins.

For 5 n + 1 5n+1 player A will pick 2 2 pieces again and pieces remaines 5 n + 1 2 = 5 n 1 5 n + 4 5n+1-2=5n-1 \equiv 5n'+4 that will lead to tie as said by Tarmo.

Kushal Bose - 4 years, 7 months ago

Thanks!

The game is affected by the fact that it isn't possible to only pick one piece. Also, the starting situation matters. For example, if there were 30 pieces instead, player B would have the advantage.

Tarmo Taipale - 4 years, 7 months ago

Nicely explained, Kushal Bose!

And thanks for feedback Calvin Lin. The edits were also useful.

Tarmo Taipale - 4 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...