What is the waiting move? Let me show you by a simple example:
There are
In this example, the first player will always win. We can prove this by the proof by contradiction, suppose there is a
In this case, removing number
There is a tree with
In this case marking the root is the waiting move, so the first player will always win.
There is a chocolate whose shape is a
In this case eating the left bottom piece is the waiting move, so the first player will always win.
I've give you three examples of games with a waiting move which can be taken advantages by the first player to win the game. But you may ask how the first player can win? What is the concrete strategy? Actually, only the smartest one in playing games can find the strategy, obvious is the fact that I am not the one.
The Mex
is a function whose domain of definition are sets consists of natural numbers. The Mex
of a set is the smallest natural number that is not in the set. For example, the Mex
of
With this we can converting any game to a DAG
and solve the game by calculation the SG
value.
Actually, any game are a state machine. We can find all the states that a game contains, and find all the states that one state can reach, and then we can get a DAG
which is the state machine of the game.
With this graph, we define the SG
value of a state as the Mex
of the SG
values of all the states that can be reached from the current state. And the SG
value of the final state is SG
value of the initial state is not
- claim 1: If the
SG
value of a state is$0$ , we can not reach a state whoseSG
value is$0$ . - claim 2: If the
SG
value of a state is not$0$ , we can reach a state whoseSG
value is$0$ .
The proofs of the two claims are simple, so I'm not going to prove them. But I recommend you to prove them by yourself.
The SG
theorem is for solving the game with multiple sub-games. For this game, when the last sub-game is over, the game is over, and the one who can not move will lose.
The SG
theorem gives the statement below:
The
SG
value of a state is theXOR
of theSG
values of all the sub-games.
Let me explain why this is true. We must know that for every state whose SG
value is SG
value are SG
value of the chosen sub-game. This is same with removing some stones from a pile. But you may ask how about a move make the SG
value of the sub-game greater than
Consider that one in a winning state, he or she will not make the SG
value of a sub-game greater than Nim Sum
0, so he will try this one. For the one in a losing state, he or she may consider take a move that make the SG
value of a sub-game greater than SG
value be SG
value of a sub-game greater, the one has to move like removing stones from a pile. You may prove this by a formal one if you like. Bur for most, this simple one is enough.
There is a chain with
For example, if the chain's length is
Try to solve this by the SG
theorem. The solution will come soon.