Here is a simple game.
We have 2 boxes.
A position in the game is (n,m) which means the first box contains n coins, the second box contains m coins.
A move is for one player to empty one of the boxes, and then distribute the remaining coins in the non-empty box among the 2 boxes, such that each box ends up with aleast one coin.
The winner is the player who makes the last move, ie the player who makes (1,1). Cause the next player won't have a way to distribute 1 among 2 boxes where each box ends up with >=1 coins.
If you have (1,X) that is not terminal position. If we have anything > 1, we can always make a move to (1, (X-1)). Thereforce, the only "terminal position" (or P-position) is (1,1).
Another observation is that (2,x) or (x,2) is a winning position for the player who gets it.
If you're given (odd, odd) you lose no matter what if the second player is playing perfectly.
Why ?
You'll be forced to return to the second player (odd, even).
The second player can always remove one of the odd boxes, and distribute it to be (odd-1, 1)
Now when it is your turn, you can either remove the (odd-1) [so you lose], or remove the 1.
If you remove the one, you'll be back to giving the second player (odd, even).
Now what he has to do is the same. This process will keep repeating, and ultimatly the even number you're returning to the second player will be as small as 2, where he can win by emptying the box which does not have 2 and distributing the 2 so he gives you (1,1).
So how can you win if you want to ? Give your opponent (odd, odd). How to do that ?
if you're given (odd, odd) you have no hope. If you have atleast one even, give your opponent (1, even-1) and so you'll win because you'll enforce that cycle of (1,odd) => (even, odd) [to you], until the even you get is 2 and so you win.
We have 2 boxes.
A position in the game is (n,m) which means the first box contains n coins, the second box contains m coins.
A move is for one player to empty one of the boxes, and then distribute the remaining coins in the non-empty box among the 2 boxes, such that each box ends up with aleast one coin.
The winner is the player who makes the last move, ie the player who makes (1,1). Cause the next player won't have a way to distribute 1 among 2 boxes where each box ends up with >=1 coins.
If you have (1,X) that is not terminal position. If we have anything > 1, we can always make a move to (1, (X-1)). Thereforce, the only "terminal position" (or P-position) is (1,1).
Another observation is that (2,x) or (x,2) is a winning position for the player who gets it.
If you're given (odd, odd) you lose no matter what if the second player is playing perfectly.
Why ?
You'll be forced to return to the second player (odd, even).
The second player can always remove one of the odd boxes, and distribute it to be (odd-1, 1)
Now when it is your turn, you can either remove the (odd-1) [so you lose], or remove the 1.
If you remove the one, you'll be back to giving the second player (odd, even).
Now what he has to do is the same. This process will keep repeating, and ultimatly the even number you're returning to the second player will be as small as 2, where he can win by emptying the box which does not have 2 and distributing the 2 so he gives you (1,1).
So how can you win if you want to ? Give your opponent (odd, odd). How to do that ?
if you're given (odd, odd) you have no hope. If you have atleast one even, give your opponent (1, even-1) and so you'll win because you'll enforce that cycle of (1,odd) => (even, odd) [to you], until the even you get is 2 and so you win.
