Calculating the ideal move in a game

40 Views Asked by At

In a Game for two players, there is a heap of stones. One after another, the players take 1-3 stones from the heap until there are no more. The last player who has to take stones loses.

Is there a formula to calculate the strategically ideal amount of stones a player has to take to win (for each round)?

1

There are 1 best solutions below

2
On

You can find the strategy in the following way:

1) Find a strategy for small number of stones (e.g. 1 up to 10 stones) where possible, one for each number.

2) For bigger numbers of stones, find a strategy such that the other player is forced to give you one of the cases of 1).

For example assume that you have strategies for 1,2,3,5,7,8,9,10 stones, for numbers 4 and 6 you didn't find any. Now there are still 12 stones on the heap. How many do you take? Right, only one. Because if in this case the other player takes one, you are left with 10 and can start your strategy, if he takes two you have 9 and it is a go, etc.

The numbers in the example are just random, you might find strategies for other numbers. However, you should aim for three consecutive numbers at least, to then find a way to get the game always in this position.