Quoto

Learn / Library / Brainteasers

Piles with a joint move

BrainteasersHard

There are piles of cards with and cards. players alternate. A move either takes any positive number of cards from one pile, or takes the same positive number of cards from both piles. The player who takes the last card wins. You move first and both players play optimally. How many different first moves guarantee you a win?

Checking an answer needs JavaScript. The hint and the solution open without it.

A whole number, a decimal, a fraction like 3/8 or a percent.

Hint

List the lost positions for the player to move, starting from , and see which of them you can reach.

Solution
  1. Call a position lost if the player to move loses; is lost, and the next lost positions, up to order, are , , and .
  2. Each new lost pair starts with the smallest number not used so far, and the gap between its entries is one more than in the previous pair.
  3. From you can reach by taking card from the first pile, by taking from the second, and by taking from each pile.
  4. No other lost position, such as or , can be reached in one move, since that would need unequal amounts from both piles.
  5. So the number of winning first moves is .

Answer: