Comb Game Theory
Comb Game Theory
Paul Kominers Walt Whitman High School 08 Bethesda, MD 20817 [email protected] Abstract We survey the eld of combinatorial game theory. We discuss Zermelos Theorem, a foundational result on which the theory of combinatorial game strategy is based. We then introduce the simple game of Nim and explain how it, through the theory of Nimbers, is critical to and underlies all of impartial combinatorial game theory.
STUDENT ARTICLE
3.1
3.1.1
Combinatorial game theory, founded in the early 20th century, deals with recursive analysis of combinatorial games, two-player games having neither chance elements nor concealed information.1 Combinatorial game theory allows mathematical analysis of games as seemingly simple as Nim and, potentially, those as complex as chess. Additionally, combinatorial games are nite, and the players alternate moves in well-dened plays [Br, De, Fe]. Two foundational works in the eld of partizan games2 are Conways On Numbers and Games [Co] and Berkelamp, Conway, and Guys Winning Ways for Your Mathematical Plays [BCG]; the study of impartial games began with Zermelos Theorem.
3.1.2
Zermelos Theorem
Since combinatorial games are nite, they must end either with a win for one player or a draw for both [Br, Fe]. Throughout this paper, the rst player to move will be referred to as Player 1 and the second player to move will be referred to as Player 2. In any combinatorial game, either Player 1 has a winning strategy, Player 2 has a winning strategy, or both players have a strategy that guarantees a draw [Br, Fe]. Because the games have perfect information, if Player 1s opening move is the best possible opening move and Player 2s response is the best possible response, there is no reason for either player to change his strategy in successive games. However, since there is no chance element, such play will always lead to either a draw or a win for one of the players. This notion is formalized in Zermelos Theorem: Theorem 1 (Zermelos Theorem, see [Br]). In a combinatorial game, either one of the players has a formal strategy that guarantees a win, or both players have formal strategies that guarantee at least a draw.
Paul Kominers is a high school senior at Walt Whitman High School in Bethesda, Maryland. His mathematical interests lie chiey in subelds of combinatorics, including extremal combinatorics and combinatorial game theory. He plans to study computer science in college, although a mathematics major is increasingly tempting. 1 Games with neither chance elements nor concealed information are said to have perfect information. 2 A game which is not impartial is called partizan.
28
29
3.1.3 Impartiality
A game in which both players have identical sets of available moves at any point in the game is called impartial. In other words, if Player 1 and Player 2 are playing an impartial game and Player 2 opts (and is allowed) to skip his move, then Player 1s ideal move is the move which would have been Player 2s ideal move.
3.2 Nim
3.2.1 Denition
The rules of the game of Nim are given below. Game (Nim). The players are given n piles of matches, where the kth pile has mk matches. The players take turns choosing and removing any number of matches from a single pile. The player to take the last match wins. Nim is perhaps the most important impartial combinatorial game. It is self-evident that it is combinatorial: there is perfect information and the game must end when one player cannot remove any more matchsticks. It is impartial because both players have the same choice of matchsticks to remove; given any Nim game, the set of Player 1s available moves is identical to the set of Player 2s given moves. In this article, a Nim game of n piles is written as {m1 , m2 , . . . , mk , . . . , mn }. For example, the Nim game with n = 3 piles of matchsticks such that m1 = m2 = 1 and m3 = 2 will be written as {1, 1, 2}. Player 1s moves will be denoted by lines above the target pile; Player 2s moves will be denoted by lines below. As an example, if Player 1 decided to remove one matchstick from pile three, it would be denoted as: 1, 1, 2 {1, 1, 1} . A complete game might proceed as follows: 1, 1, 2 {1, 1, 1} 1, 1, 0 {1, 0, 0} {0, 0, 0} . In sample game (3.1), Player 2 takes the last matchstick and wins. (3.1)
3.2.2
Symmetric Strategies
The sample game (3.2) is an example, albeit a simple one, of a game won by a symmetric strategy. A symmetric strategy is a strategy in which one player creates a situation in which he can always copy his opponents move. In so doing, the player is guaranteed a response to each of his opponents moves. Most importantly, he can make the last move and win. Imagine that a Nim game has come down to the following two piles on Player 1s move: {3, 3} .
Player 2s win in sample game (3.1) resulted from a foolish move by Player 1. A different opening move would have given Player 1 an easy win: 1, 1, 2 {1, 1, 0} 1, 0, 0 {0, 0, 0} . (3.2)
If Player 2 plays competently, Player 1 has lost. No matter how many matches Player 1 removes from one pile, Player 2 can remove the same number from the other. Eventually, Player 1 will remove the last matchstick from one pile. Player 2 will do the same to the other, thereby winning the game. For example, the game could proceed as follows: 3, 3 {3, 2} 2, 2 {2, 0} {0, 0} .
30
3.2.3
Of course, the winning move is not this easy to spot in all Nim games; Nim can be markedly more complex. For example, consider the game {2, 2, 3, 5, 7, 8, 9} . (3.3)
3
In this game, Player 1 has a losing position, or safe position ; that is, a game state such that, assuming ideal play from ones opponent, one will always lose. Analogously, a winning position, or unsafe position, is a position from which, if one plays ideally, one will always win. To properly apply this notion, instead of thinking of a combinatorial game as a series of moves, we must treat it as a series of inherited positions. Player 1s making a move must be thought of as Player 1s causing Player 2 to inherit Player 1s position, slightly modied. Player 2, in response, modies the position slightly and then causes Player 1 to inherit that position. The modied position P inherited after the original position P is called the successor of P . We will show shortly that a player inheriting a losing position can only ever cause his opponent to inherit a winning position and that every winning position has at least one move such that the players opponent will inherit a losing position.
3.2.4 Nimbers
The notion of inheriting positions is foundational to the theory of Nimbers, alternately called Nimsums or Sprague-Grundy Numbers, invariants which both give limited information about the game and allow us to nd isomorphisms between games. Nimbers are found by the following recursion (see [Br, Fe]): The Nimber of any losing position is 0. The Nimber of any current position is the smallest non-negative integer not in the set of Nimbers of positions which can result from the current position. So, for example, if a given position can only go to 0positions, its Nimber is 1. If it can go to 0- or 1-positions, its Nimber is 2. If it can go to 0- or 2-positions, its Nimber is 1, and if it can go to 1- or 2-positions, its Nimber is 0. Any Nimber greater than 0 indicates a winning position. There is a unique Nimber for each position in an impartial combinatorial game (see [Br] for a proof). This denition of Nimbers is well-dened; in particular, all losing positions have Nimber 0. We can now show that safe positions can have only unsafe successors and that unsafe positions can always have at least one safe successor. Suppose that some losing position A exists such that A has a successor A which is a losing position. As losing positions, both A and A have Nimber 0. However, if A has Nimber 0, the smallest non-negative integer in the set of Nimbers of successors of A cannot be 0. Therefore, A cannot be a losing position, contradicting our initial assumption. Now suppose that some winning position B , with Nimber greater than 0, exists such that B has no losing successor. If B has no losing successor, then it has no successor with Nimber 0. This means that 0 cannot be included in the set of Nimbers of successors of B . Since 0 is the smallest non-negative integer, the smallest non-negative integer not present in a set not containing 0 must be 0. If B s Nimber is 0, then it is a losing rather than a winning position, so a contradiction occurs.
3.2.5
We can now use the theory of Nimbers to show how Player 1 occupies a losing position in sample game (3.3). In Nim, as an alternative to the described recursion, the Nimber of any position can be computed by the following algorithm (see [Br]):
3 The choice of the word safe may seem incongruous until one considers that, for Player 2, the position that Player 1 is in is perfectly safe.
PAUL KOMINERS I NTRODUCTION TO C OMBINATORIAL G AME T HEORY N IM - SUM A LGORITHM: 1. Convert the number of matches in each pile to binary. 2. Add the binary digits modulo two.
31
For an example, we will return to our original sample game, (3.1). By our algorithm, we compute the Nim-sum to be 1 1 2 01 01 10 10
Since this sum gives the Nimber of a position (hence the names Nimber and Nim-sums), it follows that the winning move is the move that reduces the sum to zero (see [Co]). Therefore, we see again that the winning move is to remove the entire pile of two. This particular game also demonstrates an important property of Nim and of combinatorial games in general: two identical games cancel each other out. Suppose we consider a Nim game of n piles to be the sum of n one-pile Nim games. Since the sum of any two piles of the same size is zero, they do not affect the Nimber of any position. Therefore, we may once again examine the game {2, 2, 3, 5, 7, 8, 9} (or, since the two piles of size 2 cancel each other, the equivalent game {3, 5, 7, 8, 9}) and see that the Nim-sum is zero. If the game were to be played out, it might proceed something like this (with Nim-sums of positions given under the positions themselves):
{2,2,3,5,7,8,9}
{0,2,3,5,7,8,9}
2 0
{0,0,0,5,4,1,0}
{0,0,3,5,7,8,9}
0 5
{0,0,0,0,4,1,0}
{0,0,0,5,7,8,9}
3 0
{0,0,0,0,1,1,0}
{0,0,0,5,4,8,9}
{0,0,0,0,1,0,0}
{0,0,0,5,4,8,0}
{0,0,0,0,0,0,0}
Note that Player 1 moves arbitrarily, while Player 2 always moves to return the games Nimsum to zero.
comes from the Greek iso meaning same and morph meaning form.
32
Since there is no limit to the amount by which any element of the set is changed, whatever either player increases an element by, the other player can decrease that element by more. The conditions by which G ends are identical to those of Nim. Therefore, each element in the set corresponds to a pile in the isomorphic Nim game. It is possible to construct some Nim game such that the possible moves produce any sequence of Nimbers. Since two games having identical Nimber trees are isomorphic, there must exist some Nim game that is isomorphic to G. This is formalized in the well-known Sprague-Grundy Theorem: Theorem 3 (Sprague-Grundy Theorem). Any impartial game G is isomorphic to some Nim game. Formal proofs of both Theorems 2 and 3 can be found in Conways On Numbers and Games [Co].
3.3
Conclusion
We dened combinatorial games and discussed several ideas foundational to their study. We also introduced and illustrated the solution to the game of Nim, which is critical in solving many combinatorial games. Finally, we noted that all impartial combinatorial games are isomorphic to some game of Nim. There are still many unsolved problems in combinatorial game theory. Games such as Chess and Go are so complex enough that they deny easy analysis (see [De]). Meanwhile, the ease with which new combinatorial games can be created results in an innite set of new games to work with. These new games often have surprising depth or hidden isomorphisms to better-known games.
References
[BCG] Elwyn Berlekamp, John H. Conway, and Richard Guy: Winning Ways for Your Mathematical Plays, 2nd ed., Vols. 14. Massachusetts: AK Peters, 2001. [Br] [Co] [De] Mortimer Brown: Mathematical Games. Unpublished, 2006. John Conway: On Numbers And Games 2nd ed. Massachusetts: AK Peters, 2000. Erik D. Demaine: Playing games with algorithms: algorithmic combinatorial game theory, Lecture Notes in Computer Science 2136 (2001) [=Proceedings of the 26th Symposium on Mathematical Foundations in Computer Science], 1832. Thomas Ferguson: Impartial Combinatorial Games Notes. Preprint, 2005 (online at http://www.math.ucla.edu/tom/Game Theory/comb.pdf).
[Fe]