The figure below represents a bookshelf with two shelves and five stacks of books, three of them with two books and two of them with only one book. Alice and Luiz invented a game in which each of them, alternately, removes one or two books from one of the stacks of books. The one who takes the last book wins. Alice starts the challenge. Which of them has a winning strategy, regardless of the opponent's moves?

![](https://cdn.mathpix.com/cropped/2024_05_01_a50b5476db779c3986d5g-09.jpg?height=486&width=793&top_left_y=1962&top_left_x=711)

#
Solution

The one who leaves two piles with 1 book each for the opponent to play wins the game. To achieve this, Alice just needs to remove a pile with 2 books on her first move. After that, Luiz has 3 options, which are:

I) Remove a pile with 2 books: Alice just needs to remove the other pile with 2 books to reach the winning position mentioned at the beginning of the solution.

II) Remove a pile with only 1 book: Alice just needs to remove the other pile with 1 book, leaving two piles with 2 books each, which she wins on the next move or reaches the winning position mentioned at the beginning of the solution.

III) Remove 1 book from a pile with 2 books: Alice just needs to remove 1 book from the remaining pile with 2 books, leaving 4 piles with 1 book each, and Alice will reach the winning position mentioned at the beginning of the solution on the next move. Therefore, Alice has the winning strategy.

Another way is to convert the quantities of the piles to binary notation: 10, 10, 10, 1, 1. When Alice plays, she just needs to remove a quantity such that the sum of the remaining values results in a number with only even digits, for example, on her first move, if she removes a pile with 2 books, the sum of the remaining values will be $10+10+1+1=22$. By doing this, in all her moves, she can reach the winning position.