When are two games considered the same? This is a bit of a subtle question, for sometimes a game can be disguised to look like a different game even though the gameplay is essentially the same.
Example 3.1 Any game of Nim can be translated into a game of Green Hackenbush by turning a pile of stones into a beanstalk of the same length.
Example 3.2 Two players alternate choose distinct numbers from 1 through 9. If either player manages to select 3 numbers that sum to 15, they win; otherwise the game ends in a tie.
Surprisingly, this game is just Tic-Tac-Toe in disguise! To see this, simply arrange the numbers from 1 through 9 in a grid so that three numbers sum to 15 if and only if they lie on a line.
Because of such examples, we will essentially divorce the game from whatever representation we are using for its positions and instead focus just on the possible move sequences in that game. These can be shown pictorially in terms of the game tree of the game. The game tree has one vertex for each subposition in the game with left options denoted as left children (connected by edges down and to the left) and right options denoted as right children.
For example, consider the Domineering position . It has the following game tree:
Although we have labeled all of the vertices with their corresponding board positions for clarity, actually one can play the game perfectly well with just the unlabeled game tree. Starting at the top, Left is allowed to move down branches to the left, while Right is allowed to move down branches to the right. Because of this, we say that two games and are isomorphic, written , if they have the same unlabeled game tree.
You have probably noticed that included in the game tree are situations in which one player makes two moves in a row, which doesn’t occur in actual play. Still, we will keep these branches because if this position occurs as a small piece of a larger position, then it is possible that one player will move twice in this piece while their opponent moves elsewhere.
Since the full game tree can be a bit unwieldy at times, we will sometimes pare it down in various ways that do not change the gameplay. For instance, if two left children or two right children of a given vertex are isomorphic (i.e., have the same subtree), then we don’t need to include both children since they are essentially the same. This often happens when two subpositions are somehow symmetric, for instance, if one of them is a horizontal or vertical reflection of the other in Domineering. If we were to simplify the tree above, it might look something like the following.
Naturally, the most interesting question given a combinatorial game is who wins given best play. As noted in Theorem 2.1, if Left goes first, then either Left or Right has a winning strategy; similarly, if Right goes first, then either Left or Right has a winning strategy. Thus there are four possible combinations of outcomes depending on who goes first and who wins.
Definition 3.3 Let be a combinatorial game.
If Left has a winning strategy regardless of who goes first, we write and say is positive.
If Right has a winning strategy regardless of who goes first, we write and say is negative.
If Left has a winning strategy when Right goes first and Right has a winning strategy when Left goes first, we write (since the Previous player to move wins) and say is a zero game.We will explain why this terminology makes sense in a little bit. For now, note that the game with no options for either player is a zero game.
If Left has a winning strategy when Left goes first and Right has a winning strategy when Right goes first, we write (since the Next player to move wins) and say is fuzzy.
The classes , , , and are called outcome classes.
We may sometimes write for the outcome class of . Note that Left always prefers positions to either or positions, both of which she always prefers to positions, while Right has the opposite preferences.The players’ preferences between and depends on whether it is their turn to move.
Example 3.4 All of the outcome classes are represented by simple Hackenbush positions.
If we know the outcome classes of all the left and right options of , then we can determine the outcome class of as follows.
First suppose Left goes first:
If all of ’s left options lie in or , then Right has a winning strategy going first in all of them, so Right has a winning strategy in going second.
If instead has at least one left option in or , then Left has a winning strategy in it going second, so Left has a winning strategy in going first.
Similarly, if Right goes first:
If all of ’s right options lie in or , then Left has a winning strategy going first in all of them, so Left has a winning strategy in going second.
If instead has at least one right option in or , then Right has a winning strategy in it going second, so Right has a winning strategy in going first.
To summarize:
Left wins going first if she can move to or ;
Right wins going first if he can move to or .
One can then use this to determine the outcome class of from the definition: if only Left, only Right, both, or neither can win going first, then lies in , , , or , respectively.
Example 3.5 Consider the Domineering position whose game tree we found above. The left options lie in and ; the presence of implies Left wins going first. Likewise, the right options lie in and ; the presence of implies Right wins going first. Hence this position lies in .
In practice, one can determine the outcome class of a game recursively from its game tree. First, start with the leaves (positions with no options) for they must lie in . Then use the criteria above to work your way up the tree, determining each outcome class as you go.
Example 3.6 Consider the following Domineering game tree. (Note that we use symmetry in several places to simplify the tree.)
The situation becomes simpler when dealing with impartial games due to the following result.
Proof. Suppose that Left can win going first. Then since is impartial, Right can use the same strategy to win going first, so . If instead Right can win when Left goes first, Left can use the same strategy to win when Right goes first, so .
Hence if it is your turn, there are only two possibilities.
If you are given an position, you can win by moving to a position.
If you are given a position, you cannot win since you can only move to positions.That is, unless your opponent makes a mistake.
Example 3.8 The game Subtraction(1,2,3) is played with a single pile of stones. On a player’s turn, she may take either 1, 2, or 3 stones from the pile (provided there are enough stones left). For which initial positions does the first player have a winning strategy?
Solution. Let us determine which positions are positions and which are positions by considering them in order. We will abuse notation and write for the position with stones.
Clearly since there are no options.
Since , , and all have as an option, they all lie in .
The options of are , , and , which all lie in , so .
Since , , and all have as an option, they all lie in .
The options of are , , and , which all lie in , so .
...and so on.
A simple induction argument shows that if and only if is a multiple of 4.If you would like some practice writing proofs, you should consider writing out this proof in full. See the next footnote for the rest of the proof. We will prove the result by (strong) induction on . The base cases have been done above. For , the options of are , , and . If is a multiple of 4, then , , and are not multiples of 4, so by the inductive hypothesis, . Since all of ’s options are in , we have . If instead is not a multiple of 4, then one of , , and is a multiple of 4 (depending on the remaineder of when divided by 4), so by the inductive hypothesis, one of ’s options lies in , so .
Although this solution describes how to determine the and positions in this example from scratch, you don’t need to go through this whole process if you can guess what the and positions are. The following theorem gives an easy way to justify that your guess is correct.
Theorem 3.9 Suppose that the positions of an impartial game can be partitioned into two (disjoint) sets and such that:
every option of a position in lies in ; and
every position in has an option in .
Then is the set of positions and is the set of positions.
Proof. Induction on the number of subpositions.Let be any position, and suppose by induction that any option of that lies in is a position and any option of that lies in is an position. If , then all of its options lie in and hence in , so lies in . Conversely, if , then one of its options lies in and hence in , so .
Hence we could also write the solution to the example above as follows.
Solution. We claim that is a position if and only if is a multiple of 4. Indeed, if is a multiple of 4, then none of its options (which all lie in ) are a multiple of 4. Conversely, if is not a multiple of 4, then one of its options—either , , or depending on the remainder of when divided by 4—is a (nonnegative) multiple of 4.
Example 3.10 Wythoff’s Game (also called Wythoff’s Nim) is played with two piles of stones. On a player’s turn, she may take any number of stones from one of the piles or the same number of stones from both piles.
We can visualize the possible positions in a matrix indexed by the sizes of the two piles. Then from any position, one can move up within that column, to the left within that row, or along the diagonal to the northwest (like the queen in Chess). Now, the upper left corner, when there are no stones in either pile, is clearly a position, so any position that has it as an option is an position. For clarity, we will represent positions with , and positions with .
This doesn’t give us a general formula for determining whether a position is in , but for any particular position we could theoretically compute whether it lies in or .The set of positions in Wythoff’s Game is known explicitly and is related to the golden ratio. See here for more details.
Often a large combinatorial game will break up into smaller pieces in the sense that the player must choose one of the pieces and then play in that piece, leaving the other pieces unchanged. For instance, in Domineering, if two parts of the board get separated by dominoes, then they are more or less independent.
Definition 3.11 Let and be games. The sum is the game played on the disjoint union of and (placed next to each other), in which a player’s turn consists of choosing one of and and making a move in it, leaving the other unchanged.Obviously, you cannot choose to play in if you have no legal moves to play in it.
With this definition, we see that the complete Domineering position shown above is just the sum of the four (oddly shaped) positions shown to its right, a Nim position is just the sum of its piles, and so forth.
Since smaller positions are usually easier to analyze, we would hope to be able to analyze a larger game by analyzing its disjoint pieces. In other words, if we know the outcome classes of and , what can we say about the outcome class of ?
Our first result will finally explain why positions (second-player wins) are called zero games.
In other words, if a player can win in , she can also win in , so adding a zero game will not change the outcome. To see this informally, neither player will want to play in since it is a first-player loss. Therefore they’ll both try to play in , and the player who loses will be forced to play in first and then lose.Proof. Suppose Alice has a winning strategy in .Fix either Alice or Bob to go first.Then Alice can also win in by using the following strategy: she only plays in if Bob did on the previous turn; otherwise she plays in . If she can do this, then:
The moves played in will alternate between Alice and Bob, with Bob going first.
The moves played in will also alternate between Alice and Bob, with the same player going first as in the whole game .
Hence when moving in , she can ignore moves made in and play according to the second player’s winning strategy (which exists since ), while when moving in , she can ignore moves made in and play according to her winning strategy in . If she does this, then she will never be forced to move in since she will not lose in , and she will always have a move to play in since she will not lose in . Thus Alice can win in .
Similarly, if Bob has a winning strategy in , he can win in . It follows that and lie in the same outcome class.
Conversely, suppose is a game such that and lie in the same outcome class for all games . Then we must have , for we could take to be the empty game with no moves.In that case, , so since , we would have to have .Hence the class of zero games consists precisely of those games that can be added to any game without changing its outcome.
Games in are better for Left than games in , so we should expect that adding a game in should only help Left.
Proposition 3.13 Let . If Left has a winning strategy in a game , then she also has one in .
Similarly, if , then whenever Right has a winning strategy in a game , he also has one in .
Proof. As in the proof of Proposition 3.12, Left will win if she plays in immediately after Right does (following her winning strategy in ) and otherwise plays in (following her winning strategy in ).
In particular, this result implies that the sum of two positive games () is again positive, while the sum of a positive and a fuzzy game () is either positive or fuzzy (and both possibilities can occur, as seen in the example below). Likewise, the sum of two negative games () is again negative, while the sum of a negative and a fuzzy game can be either negative or fuzzy.
Example 3.14 Let be the positive Domineering position .
The position given by is fuzzy, but is positive.Left can win by playing in if going first and in if going second.
The position given by is also fuzzy, but now is fuzzy.The first player can always win by playing in first.
As one might expect, the sum of a positive and negative game can lie in any outcome class. Finally, living up to their name, the sum of two fuzzy games can also lie in any outcome class. (This is left as an exercise for the reader.)
Although isomorphism is a reasonable notion for what it means for two games to be the same, it is lacking in one key respect: it is too strong!
Example 3.15 Consider the following two Hackenbush positions.
Because of this, we will define the following weaker notion of equivalence of games.
Definition 3.16 Two games and are equivalent or equal, written , if and lie in the same outcome class for all games .
In other words, two games are equal if one can be substituted for the other in any sum of games without changing the outcome. Hence the two Hackenbush positions in the example above are equal. Similarly, Proposition 3.12 shows that any two zero games are equal. On the other hand, the fuzzy positions and in Example 3.14 are not equal (for the outcomes of and in that example are different).
You may find it a bit troubling that games can be equal but not isomorphic. A reasonable analogy is that two rational numbers can be equal even if they are written differently, like and . Since we generally only care about arithmetic operations with rational numbers, and and behave the same way with respect to such operations, we may as well think of them as equal. Similarly, we say two games are equal if they are basically indistinguishable when we only care about outcomes and sums, even if they may not be strictly isomorphic. Constructions like this are common in mathematics and go by the name of equivalence relations.
Definition 3.17 A relation on a set is an equivalence relation if it satisfies, for all :
(reflexivity) ;
(symmetry) if , then ;
(transitivity) if and , then .
Proof. For reflexivity, if is a game, then the outcome of is always the same as itself, so .
For symmetry, if , then the outcomes of and are always the same, so the outcomes of and are as well, meaning .
For transitivity, if and , then the outcomes of and are always the same, as are those of and , so the outcomes of and are always the same, meaning .
It might also seem that our definition of equality of games is either (a) useless because there will not be many interesting positions that are equal to one another, or (b) hopeless to check in practice since one needs to verify the definition for every game . But as we shall see, it is both an effective definition and one that yields a deep and interesting theory.
Example 3.19 All games in (i.e. zero games) are equal. This is an immediate consequence of Proposition 3.12.
Example 3.20 Consider the following Domineering positions:
In fact, this is enough to ensure that and are equal! Indeed, using Proposition 3.12, we have that for any game ,
In the next chapter, we will develop some formalism that will make it easier to work with these definitions.