Puzzling Stack Exchange is a question and answer site for those who create, solve, and study puzzles. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.)

share|improve this question
    
What happens if A = 5 and at one point there are 4 pebbles on the table and it's A's turn? It is considered a win? – Marius 2 hours ago
    
@Marius: Then A will take 1 pebble, according to the rules. – Gamow 2 hours ago
    
Thanks for clearing it. – Marius 2 hours ago
2  
No Alice and Bob? :o – Tim Couwelier 1 hour ago

Answer

Anastasia wins

Because

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 <= 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 >= 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.

share|improve this answer
    
I had the same idea but you beat me to it :) – Tim Couwelier 1 hour ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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