Anastasia and Barnabas play a game that starts with $330$ pebbles in a bowl. The game consists of two phases. The first phase looks as follows:

  • First Anastasia announces an integer $A$ with $2\le A\le9$.
  • Then Barnabas announces an integer $B$ with $2\le B\le9$ and $B\ne A$.

The second phase looks as follows:

  • The two players alternately take pebbles out of the bowl. Anastasia makes the first move.
  • In every move, Anastasia may either take $1$ pebble or $A$ pebbles.
  • In every move, Barnabas may either take $1$ pebble or $B$ pebbles.
  • The player who takes the last pebble wins the game.

Question: Which player is going to win this game? (As usual, we assume that Anastasia and Barnabas both use optimal strategies.)

  • 1
    $\begingroup$ @Marius: Then A will take 1 pebble, according to the rules. $\endgroup$
    – Gamow
    Commented Apr 6, 2016 at 7:42
  • 12
    $\begingroup$ No Alice and Bob? :o $\endgroup$ Commented Apr 6, 2016 at 8:06
  • 1
    $\begingroup$ +1 for more interesting names than just Alice and Bob. (And because it's an interesting puzzle) $\endgroup$
    – DylanSp
    Commented Apr 6, 2016 at 13:48
  • 4
    $\begingroup$ @Devsman, Barnabas chooses after Anastasia has chosen, therefore Barnabas has more information, so he might be able to use the information about the moves Anastasia can make to choose a better strategy then Anastasia. $\endgroup$ Commented Apr 6, 2016 at 14:43
  • 3
    $\begingroup$ @Devsman Let's play Rock Paper Scissors : you can start and apply your better strategy, I will choose after you ;) $\endgroup$
    – Fabich
    Commented Apr 6, 2016 at 14:46

1 Answer 1



Anastasia wins


Anastasia is the first to choose the integer and she chooses $A = 2$.

Anastasia should first reach a status where there's a number of pebbles left less than $B$.
To achieve this, on every Anastasia's turn we can say that there are

$B + n$ pebbles left

As long as $n > 2$, she can play whatever number. When $n \leq 2$ Anastasia must play the correct number: if $n = 2$ she plays $1$, else if $n = 1$ she plays $2$.
The status after this move is either $B + 1$ or $B - 1$ and it's Barnabas' turn. He cannot win at this turn (because $B \geq 3$) and after his turn we have less than $B$ pebbles left.
Anastasia should now just make sure that after her turn there's an even number of pebbles left, so that Barnabas' can't win. On the last turn there's just 1 pebble left and it's Anastasia's turn.

  • 1
    $\begingroup$ I had the same idea but you beat me to it :) $\endgroup$ Commented Apr 6, 2016 at 8:18

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.