Who should win the game dependent on $x$ and $y$?

31 Views Asked by At

Let's say we have a game that is played with two piles containing $x$ and $y$ logs, respectively. For practical purposes, $x,y\in\mathbb{N}$. The objective of the game is to remove that last log. Player 1 goes first and Player 2, second. During their turn, a player can remove as many logs from only one pile as they want. For example, Player 1 could remove all logs from the $x$ pile in their turn (they would not want to do that though since they would lose to Player 2 who would simply remove all logs from $y$).

Who should win the game dependent on $x$ and $y$? Interestingly, this problem is found under the 'induction' section of our text.

2

There are 2 best solutions below

2
On

HINT: Who should win if $x=y$, and how? Once you’ve answered that correctly, you can easily discover what should happen when $x\ne y$.

0
On

As Brian mentioned, first consider the case in which $x=y$.

In this case the second player is guaranteed a win. If the first player removes $n$ logs from one pile, the second player removes $n$ logs from the other pile. This way the second player is always guaranteed a move. After the second player's move the piles will have the same number of logs in them so this move always works.

If $x\ne y$ the first player always wins. On his first move, he will remove logs from one pile so the piles have the same number of logs. Then he can proceed as the second player in the $x=y$ strategy above.