Winning strategy for matchstick problem

861 Views Asked by At

Given a pile of matchsticks of finite size, 2 players take turns to remove either 1, 5 or 6 matchsticks. The loser is the person who cannot make a move. I have tried to solve this problem using a table and a directed graph, but I cannot see any patterns.

Can anyone find a winning strategy to this problem?

2

There are 2 best solutions below

0
On BEST ANSWER

You want to make your opponent face a situation where there are $0,2$ or $4$ modulo $11$ sticks in the pile.

There are nine possibilities:

If the number of sticks is zero modulo $11$:

If your opponent takes $1$ then you take $6$

If your opponent takes $5$ then you take $6$

If your opponent takes $6$ then you take $5$.

If the number of sticks is $2$ modulo $11$ :

If your opponent takes $1$ then you take $1$

If your opponent takes $5$ then you take $6$

If your opponent takes $6$ then you take $5$.

If the number of sticks is $4$ modulo $11$:

If your opponent takes $1$ then you take $1$

If your opponent takes $5$ then you take $6$

If your opponent takes $6$ then you take $5$.

You will be able to drive your opponent to face an empty pile and will therefore have won.

0
On

HINT

Here is a general approach for such problems.

  1. Start from the 1-step initial conditions. If there is 1,2,3,4,5,6 sticks - who wins?
  2. Then note that you can convert $7$ to $1,2$ or $6$ by taking a legal amount of sticks. What is the best choice based on your conditions from step 1.
  3. Continue increasing stick amounts by 1 until you see a patterns.