HOME

TheInfoList



OR:

In
combinatorial game theory Combinatorial game theory is a branch of mathematics and theoretical computer science that typically studies sequential games with perfect information. Study has been largely confined to two-player games that have a ''position'' that the players ...
, the Sprague–Grundy theorem states that every
impartial game In combinatorial game theory, an impartial game is a game in which the allowable moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric. In other words, the only difference betw ...
under the
normal play convention A normal play convention in a game is the method of determining the winner that is generally regarded as standard. For example: *Preventing the other player from being able to move *Being the first player to achieve a target *Holding the highest va ...
is equivalent to a one-heap game of nim, or to an infinite generalization of nim. It can therefore be represented as a
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called ''Cardinal n ...
, the size of the heap in its equivalent game of nim, as an
ordinal number In set theory, an ordinal number, or ordinal, is a generalization of ordinal numerals (first, second, th, etc.) aimed to extend enumeration to infinite sets. A finite set can be enumerated by successively labeling each element with the least n ...
in the infinite generalization, or alternatively as a
nimber In mathematics, the nimbers, also called ''Grundy numbers'', are introduced in combinatorial game theory, where they are defined as the values of heaps in the game Nim. The nimbers are the ordinal numbers endowed with ''nimber addition'' and ' ...
, the value of that one-heap game in an algebraic system whose addition operation combines multiple heaps to form a single equivalent heap in nim. The Grundy value or nim-value of any impartial game is the unique nimber that the game is equivalent to. In the case of a game whose positions are indexed by the natural numbers (like nim itself, which is indexed by its heap sizes), the sequence of nimbers for successive positions of the game is called the nim-sequence of the game. The Sprague–Grundy theorem and its proof encapsulate the main results of a theory discovered independently by R. P. Sprague (1936) and P. M. Grundy (1939). Reprinted, 1964, 27: 9–11.


Definitions

For the purposes of the Sprague–Grundy theorem, a ''game'' is a two-player
sequential game In game theory, a sequential game is a game where one player chooses their action before the others choose theirs. The other players must have information on the first player's choice so that the difference in time has no strategic effect. Sequen ...
of
perfect information In economics, perfect information (sometimes referred to as "no hidden information") is a feature of perfect competition. With perfect information in a market, all consumers and producers have complete and instantaneous knowledge of all market pr ...
satisfying the ''ending condition'' (all games come to an end: there are no infinite lines of play) and the ''normal play condition'' (a player who cannot move loses). At any given point in the game, a player's ''position'' is the set of ''moves'' they are allowed to make. As an example, we can define the ''zero game'' to be the two-player game where neither player has any legal moves. Referring to the two players as A (for Alice) and B (for Bob), we would denote their positions as (A, B) = (\, \), since the set of moves each player can make is empty. An ''
impartial game In combinatorial game theory, an impartial game is a game in which the allowable moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric. In other words, the only difference betw ...
'' is one in which at any given point in the game, each player is allowed exactly the same set of moves. Normal-play nim is an example of an impartial game. In nim, there are one or more heaps of objects, and two players (we'll call them Alice and Bob), take turns choosing a heap and removing 1 or more objects from it. The winner is the player who removes the final object from the final heap. The game is ''impartial'' because for any given configuration of pile sizes, the moves Alice can make on her turn are exactly the same moves Bob would be allowed to make if it were his turn. In contrast, a game such as
checkers Checkers (American English), also known as draughts (; British English), is a group of strategy board games for two players which involve diagonal moves of uniform game pieces and mandatory captures by jumping over opponent pieces. Checkers ...
is not impartial because, supposing Alice were playing red and Bob were playing black, for any given arrangement of pieces on the board, if it were Alice's turn, she would only be allowed to move the red pieces, and if it were Bob's turn, he would only be allowed to move the black pieces. Note that any configuration of an impartial game can therefore be written as a single position, because the moves will be the same no matter whose turn it is. For example, the position of the ''zero game'' can simply be written \, because if it's Alice's turn, she has no moves to make, and if it's Bob's turn, he has no moves to make either. A move can be associated with the position it leaves the next player in. Doing so allows positions to be defined recursively. For example, consider the following game of Nim played by Alice and Bob.


Example Nim Game

* At step 6 of the game (when all of the heaps are empty) the position is \, because Bob has no valid moves to make. We name this position *0. * At step 5, Alice had exactly one option: to remove one object from heap C, leaving Bob with no moves. Since her ''move'' leaves Bob in position *0, her ''position'' is written \. We name this position *1. * At step 4, Bob had two options: remove one from B or remove one from C. Note, however, that it didn't really matter which heap Bob removed the object from: Either way, Alice would be left with exactly one object in exactly one pile. So, using our recursive definition, Bob really only has one move: *1. Thus, Bob's position is \. * At step 3, Alice had 3 options: remove two from C, remove one from C, or remove one from B. Removing two from C leaves Bob in position *1. Removing one from C leaves Bob with two piles, each of size one, i.e., position \, as described in step 4. However, removing 1 from B would leave Bob with two objects in a single pile. ''His'' moves would then be *0 and *1, so ''her'' move would result in the position \. We call this position *2. Alice's position is then the set of all her moves: \big\. * Following the same recursive logic, at step 2, Bob's position is \big\. * Finally, at step 1, Alice's position is \Big\.


Nimbers

The special names *0, *1, and *2 referenced in our example game are called ''
nimber In mathematics, the nimbers, also called ''Grundy numbers'', are introduced in combinatorial game theory, where they are defined as the values of heaps in the game Nim. The nimbers are the ordinal numbers endowed with ''nimber addition'' and ' ...
s''. In general, the nimber *n corresponds to the position in a game of nim where there are exactly n objects in exactly one heap. Formally, nimbers are defined inductively as follows: *0 is \, *1 = \, *2 = \ and for all n \geq 0, *(n+1) = *n \cup \. While the word ''nim''ber comes from the game ''nim'', nimbers can be used to describe the positions of any finite, impartial game, and in fact, the Sprague–Grundy theorem states that every instance of a finite, impartial game can be associated with a ''single'' nimber.


Combining Games

Two games can be combined by ''adding'' their positions together. For example, consider another game of nim with heaps A', B', and C'.


Example Game 2

We can combine it with our first example to get a combined game with six heaps: A, B, C, A', B', and C':


Combined Game

To differentiate between the two games, for the first example game, we'll label its starting position \colorS, and color it blue: \colorS = \Big\ For the second example game, we'll label the starting position \colorS' and color it red: \colorS' = \Big\. To compute the starting position of the combined game, remember that a player can either make a move in the first game, leaving the second game untouched, or make a move in the second game, leaving the first game untouched. So the combined game's starting position is: \colorS \color + \colorS' \color= \Big\ \cup \Big\ The explicit formula for adding positions is: S+S'=\\cup\, which means that addition is both commutative and associative.


Equivalence

Positions in impartial games fall into two ''outcome classes'': either the next player (the one whose turn it is) wins (an \boldsymbol''- position''), or the previous player wins (a \boldsymbol''- position''). So, for example, *0 is a \mathcal-position, while *1 is an \mathcal-position. Two positions G and G' are ''equivalent'' if, no matter what position H is added to them, they are always in the same outcome class. Formally, G \approx G' if and only if \forall H , G + H is in the same outcome class as G' + H. To use our running examples, notice that in both the
first First or 1st is the ordinal form of the number one (#1). First or 1st may also refer to: *World record, specifically the first instance of a particular achievement Arts and media Music * 1$T, American rapper, singer-songwriter, DJ, and rec ...
and
second The second (symbol: s) is the unit of time in the International System of Units (SI), historically defined as of a day – this factor derived from the division of the day first into 24 hours, then to 60 minutes and finally to 60 seconds ...
games above, we can show that on every turn, Alice has a move that forces Bob into a \mathcal-position. Thus, both \colorS and \colorS' are \mathcal-positions. (Notice that in the combined game, ''Bob'' is the player with the \mathcal-positions. In fact, \colorS \color + \colorS' is a \mathcal-position, which as we will see in Lemma 2, means \color S \color \approx \color S'.)


First Lemma

As an intermediate step to proving the main theorem, we show that for every position G and every \mathcal-position A, the equivalence G\approx A+G holds. By the above definition of equivalence, this amounts to showing that G+H and A+G+H share an outcome class for all H. Suppose that G+H is a \mathcal-position. Then the previous player has a winning strategy for A+G+H: respond to moves in A according to their winning strategy for A (which exists by virtue of A being a \mathcal-position), and respond to moves in G+H according to their winning strategy for G+H (which exists for the analogous reason). So A+G+H must also be a \mathcal-position. On the other hand, if G+H is an \mathcal-position, then A+G+H is also an \mathcal-position, because the next player has a winning strategy: choose a \mathcal-position from among the G+H options, and we conclude from the previous paragraph that adding A to that position is still a \mathcal-position. Thus, in this case, A+G+H must be a \mathcal-position, just like G+H. As these are the only two cases, the lemma holds.


Second Lemma

As a further step, we show that G\approx G' if and only if G+G' is a \mathcal-position. In the forward direction, suppose that G\approx G'. Applying the definition of equivalence with H=G, we find that G'+G (which is equal to G+G' by
commutativity In mathematics, a binary operation is commutative if changing the order of the operands does not change the result. It is a fundamental property of many binary operations, and many mathematical proofs depend on it. Most familiar as the name of ...
of addition) is in the same outcome class as G+G. But G+G must be a \mathcal-position: for every move made in one copy of G, the previous player can respond with the same move in the other copy, and so always make the last move. In the reverse direction, since A=G+G' is a \mathcal-position by hypothesis, it follows from the first lemma, G\approx G+A, that G\approx G+(G+G'). Similarly, since B=G+G is also a \mathcal-position, it follows from the first lemma in the form G'\approx G'+B that G'\approx G'+(G+G). By
associativity In mathematics, the associative property is a property of some binary operations, which means that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement f ...
and commutativity, the right-hand sides of these results are equal. Furthermore, \approx is an
equivalence relation In mathematics, an equivalence relation is a binary relation that is reflexive, symmetric and transitive. The equipollence relation between line segments in geometry is a common example of an equivalence relation. Each equivalence relation ...
because equality is an equivalence relation on outcome classes. Via the transitivity of \approx, we can conclude that G\approx G'.


Proof

We prove that all positions are equivalent to a nimber by
structural induction Structural induction is a proof method that is used in mathematical logic (e.g., in the proof of Łoś' theorem), computer science, graph theory, and some other mathematical fields. It is a generalization of mathematical induction over natural nu ...
. The more specific result, that the given game's initial position must be equivalent to a nimber, shows that the game is itself equivalent to a nimber. Consider a position G = \. By the induction hypothesis, all of the options are equivalent to nimbers, say G_i \approx *n_i. So let G'=\. We will show that G \approx *m, where m is the mex (minimum exclusion) of the numbers n_1, n_2, \ldots, n_k, that is, the smallest non-negative integer not equal to some n_i. The first thing we need to note is that G \approx G', by way of the second lemma. If k is zero, the claim is trivially true. Otherwise, consider G+G'. If the next player makes a move to G_i in G, then the previous player can move to *n_i in G', and conversely if the next player makes a move in G'. After this, the position is a \mathcal-position by the lemma's forward implication. Therefore, G+G' is a \mathcal-position, and, citing the lemma's reverse implication, G \approx G'. Now let us show that G'+*m is a \mathcal-position, which, using the second lemma once again, means that G'\approx *m. We do so by giving an explicit strategy for the previous player. Suppose that G' and *m are empty. Then G'+*m is the null set, clearly a \mathcal-position. Or consider the case that the next player moves in the component *m to the option *m' where m'. Because m was the ''minimum'' excluded number, the previous player can move in G' to *m'. And, as shown before, any position plus itself is a \mathcal-position. Finally, suppose instead that the next player moves in the component G' to the option *n_i. If n_i < m then the previous player moves in *m to *n_i; otherwise, if n_i > m, the previous player moves in *n_i to *m; in either case the result is a position plus itself. (It is not possible that n_i = m because m was defined to be different from all the n_i.) In summary, we have G\approx G' and G'\approx *m. By transitivity, we conclude that G \approx *m, as desired.


Development

If G is a position of an impartial game, the unique integer m such that G \approx *m is called its Grundy value, or Grundy number, and the function that assigns this value to each such position is called the Sprague–Grundy function. R. L. Sprague and P. M. Grundy independently gave an explicit definition of this function, not based on any concept of equivalence to nim positions, and showed that it had the following properties: *The Grundy value of a single nim pile of size m (i.e. of the position *m) is m; * A position is a loss for the next player to move (i.e. a \mathcal-position) if and only if its Grundy value is zero; and *The Grundy value of the sum of a finite set of positions is just the
nim-sum In mathematics, the nimbers, also called ''Grundy numbers'', are introduced in combinatorial game theory, where they are defined as the values of heaps in the game Nim. The nimbers are the ordinal numbers endowed with ''nimber addition'' and ' ...
of the Grundy values of its summands. It follows straightforwardly from these results that if a position G has a Grundy value of m, then G + H has the same Grundy value as *m + H, and therefore belongs to the same outcome class, for any position H. Thus, although Sprague and Grundy never explicitly stated the theorem described in this article, it follows directly from their results and is credited to them. These results have subsequently been developed into the field of
combinatorial game theory Combinatorial game theory is a branch of mathematics and theoretical computer science that typically studies sequential games with perfect information. Study has been largely confined to two-player games that have a ''position'' that the players ...
, notably by Richard Guy,
Elwyn Berlekamp Elwyn Ralph Berlekamp (September 6, 1940 – April 9, 2019) was a professor of mathematics and computer science at the University of California, Berkeley.Contributors, ''IEEE Transactions on Information Theory'' 42, #3 (May 1996), p. 1048. DO10.1 ...
,
John Horton Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many branches ...
and others, where they are now encapsulated in the Sprague–Grundy theorem and its proof in the form described here. The field is presented in the books '' Winning Ways for your Mathematical Plays'' and ''
On Numbers and Games ''On Numbers and Games'' is a mathematics book by John Horton Conway first published in 1976. The book is written by a pre-eminent mathematician, and is directed at other mathematicians. The material is, however, developed in a playful and unpre ...
''.


See also

*
Genus theory {{multiple issues, {{confusing, date=March 2009 {{more citations needed, date=January 2019 In the mathematical theory of games, genus theory in impartial games is a theory by which some games played under the misère play convention can be analy ...
*
Indistinguishability quotient In combinatorial game theory, and particularly in the theory of impartial games in misère play, an indistinguishability quotient is a commutative monoid that generalizes and localizes the Sprague–Grundy theorem for a specific game's rule set. I ...


References


External links


Grundy's game
at
cut-the-knot Alexander Bogomolny (January 4, 1948 July 7, 2018) was a Soviet-born Israeli-American mathematician. He was Professor Emeritus of Mathematics at the University of Iowa, and formerly research fellow at the Moscow Institute of Electronics and Math ...

Easily readable, introductory account from the UCLA Math Department


a
sputsoft.com
* {{DEFAULTSORT:Sprague-Grundy theorem Combinatorial game theory Theorems in discrete mathematics