MathDB
piles of stones game, winning strategy

Source: Lusophon 2019 CPLP P6

December 31, 2019
gamewinning strategygame strategycombinatorics

Problem Statement

Two players Arnaldo and Betania play alternately, with Arnaldo being the first to play. Initially there are two piles of stones containing xx and yy stones respectively. In each play, it is possible to perform one of the following operations: 1. Choose two non-empty piles and take one stone from each pile. 2. Choose a pile with an odd amount of stones, take one of their stones and, if possible, split into two piles with the same amount of stones. The player who cannot perform either of operations 1 and 2 loses. Determine who has the winning strategy based on xx and yy.