Revision as of 19:48, 8 September 2010 editLambiam (talk | contribs)Autopatrolled, Extended confirmed users, Page movers63,553 editsm →Properties: hyphen← Previous edit | Latest revision as of 00:37, 29 December 2024 edit undoDavid Eppstein (talk | contribs)Autopatrolled, Administrators226,195 edits Undid revision 1265843010 by Symbol & Font Hunter (talk) off-topicTag: Undo | ||
(111 intermediate revisions by 61 users not shown) | |||
Line 1: | Line 1: | ||
{{short description|Number used in combinatorial game theory}} | |||
In ], the ] of '''nimbers''' (occasionally called '''Grundy numbers''') is introduced in ], where they are defined as the values of ] heaps, but arise in a much larger class of games because of the ]. It is the proper class of ] endowed with a new '''nimber addition''' and '''nimber multiplication''', which are distinct from ordinal addition and ordinal multiplication. | |||
{{Distinguish|Number}} | |||
{{multiple issues| | |||
{{lead extra info|date=January 2019}} | |||
{{inadequate lead|date=January 2019}} | |||
}} | |||
In ], the '''nimbers''', also called '''Grundy numbers''', are introduced in ], where they are defined as the values of heaps in the game ]. The nimbers are the ]s endowed with ''nimber addition'' and ''nimber multiplication'', which are distinct from ] and ]. | |||
==Properties== | |||
The Sprague–Grundy theorem states that every ] is equivalent to a nim heap of a certain size. Nimber addition (also known as '''nim-addition''') can be used to calculate the size of a single heap equivalent to a collection of heaps. It is defined recursively by | |||
Because of the ] which states that every ] is equivalent to a Nim heap of a certain size, nimbers arise in a much larger class of impartial games. They may also occur in ]s like ]. | |||
:<math>\alpha + \beta = \operatorname{mex}(\{\,\alpha' + \beta : \alpha' < \alpha\,\} \cup \{\, \alpha + \beta' : \beta' < \beta \,\}),</math> | |||
The nimber addition and multiplication operations are associative and commutative. Each nimber is its own ]. In particular for some pairs of ordinals, their nimber sum is smaller than either addend.<ref>{{Cite book|title=Advances in computer games : 14th International Conference, ACG 2015, Leiden, the Netherlands, July 1-3, 2015, Revised selected papers|others=Herik, Jaap van den,, Plaat, Aske,, Kosters, Walter|isbn=978-3319279923|location=Cham|oclc=933627646|date = 2015-12-24}}</ref> The ] operation is applied to sets of nimbers. | |||
where for a ] ''S'' of ordinals, ](''S'') is defined to be the "minimum excluded ordinal", i.e. mex(''S'') is the smallest ordinal which is not an element of ''S''. For finite ordinals, the '''nim-sum''' is easily evaluated on computer by taking the ] of the corresponding numbers (whereby the numbers are given their ] expansions, and the binary expansion of (''x'' xor ''y'') is evaluated ]-wise). | |||
== Uses == | |||
=== Nim === | |||
{{main|Nim}} | |||
Nim is a game in which two players take turns removing objects from distinct heaps. As moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric, Nim is an impartial game. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap. The goal of the game is to be the player who removes the last object. The nimber of a heap is simply the number of objects in that heap. Using nim addition, one can calculate the nimber of the game as a whole. The winning strategy is to force the nimber of the game to 0 for the opponent's turn.<ref>{{Cite book|title=Introduction to the design & analysis of algorithms|last=Anany.|first=Levitin|date=2012|publisher=Pearson|isbn=9780132316811|edition=3rd|location=Boston|oclc=743298766}}</ref> | |||
=== Cram === | |||
{{main|Cram (game)}} | |||
Cram is a game often played on a rectangular board in which players take turns placing dominoes either horizontally or vertically until no more dominoes can be placed. The first player that cannot make a move loses. As the possible moves for both players are the same, it is an impartial game and can have a nimber value. For example, any board that is an even size by an even size will have a nimber of 0. Any board that is even by odd will have a non-zero nimber. Any {{math|2 × ''n''}} board will have a nimber of 0 for all even {{mvar|n}} and a nimber of 1 for all odd {{mvar|n}}. | |||
=== Northcott's game === | |||
In Northcott's game, pegs for each player are placed along a column with a finite number of spaces. Each turn each player must move the piece up or down the column, but may not move past the other player's piece. Several columns are stacked together to add complexity. The player that can no longer make any moves loses. Unlike many other nimber related games, the number of spaces between the two tokens on each row are the sizes of the Nim heaps. If your opponent increases the number of spaces between two tokens, just decrease it on your next move. Else, play the game of Nim and make the Nim-sum of the number of spaces between the tokens on each row be 0.<ref>{{Cite web|url=http://web.mit.edu/sp.268/www/nim.pdf|title=Theory of Impartial Games|date=Feb 3, 2009}}</ref> | |||
=== Hackenbush === | |||
{{main|Hackenbush}} | |||
Hackenbush is a game invented by mathematician ]. It may be played on any configuration of colored ]s connected to one another by their endpoints and to a "ground" line. Players take turns removing line segments. An impartial game version, thereby a game able to be analyzed using nimbers, can be found by removing distinction from the lines, allowing either player to cut any branch. Any segments reliant on the newly removed segment in order to connect to the ground line are removed as well. In this way, each connection to the ground can be considered a nim heap with a nimber value. Additionally, all the separate connections to the ground line can also be summed for a nimber of the game state. | |||
== Addition == | |||
Nimber addition (also known as '''nim-addition''') can be used to calculate the size of a single nim heap equivalent to a collection of nim heaps. It is defined recursively by | |||
<math display=block>\alpha \oplus \beta = \operatorname{mex} \! \bigl( \{ \alpha' \oplus \beta : \alpha' < \alpha \} \cup \{\alpha \oplus \beta' : \beta' < \beta \} \bigr),</math> | |||
where the ] {{math|mex(''S'')}} of a set {{mvar|S}} of ordinals is defined to be the smallest ordinal that is ''not'' an element of {{mvar|S}}. | |||
For finite ordinals, the '''nim-sum''' is easily evaluated on a computer by taking the ] ] (XOR, denoted by {{math|⊕}}) of the corresponding numbers. For example, the nim-sum of 7 and 14 can be found by writing 7 as 111 and 14 as 1110; the ones place adds to 1; the twos place adds to 2, which we replace with 0; the fours place adds to 2, which we replace with 0; the eights place adds to 1. So the nim-sum is written in binary as 1001, or in decimal as 9. | |||
This property of addition follows from the fact that both {{math|mex}} and XOR yield a winning strategy for Nim and there can be only one such strategy; or it can be shown directly by induction: Let {{mvar|α}} and {{mvar|β}} be two finite ordinals, and assume that the nim-sum of all pairs with one of them reduced is already defined. The only number whose XOR with {{mvar|α}} is {{math|''α'' ⊕ ''β''}} is {{mvar|β}}, and vice versa; thus {{math|''α'' ⊕ ''β''}} is excluded. | |||
<math display=block>\zeta := \alpha \oplus \beta \oplus \gamma</math> | |||
On the other hand, for any ordinal {{math|''γ'' < ''α'' ⊕ ''β''}}, XORing {{mvar|ξ}} with all of {{mvar|α}}, {{mvar|β}} and {{mvar|γ}} must lead to a reduction for one of them (since the leading 1 in {{math|''ξ''}} must be present in at least one of the three); since | |||
<math display=block>\zeta \oplus \gamma = \alpha \oplus \beta > \gamma,</math> | |||
we must have either | |||
<math display=block>\begin{align} | |||
\alpha > \zeta \oplus \alpha &= \beta \oplus \gamma, \\ | |||
\beta > \zeta \oplus \beta &= \alpha \oplus \gamma; | |||
\end{align}</math> | |||
thus {{mvar|γ}} is included as either | |||
<math display=block>\begin{align} | |||
(\beta \oplus \gamma) \oplus \beta, \\ | |||
\alpha \oplus (\alpha \oplus \gamma); | |||
\end{align}</math> | |||
and hence {{math|''α'' ⊕ ''β''}} is the minimum excluded ordinal. | |||
Nimber addition is ] and ], with {{math|0}} as the additive ]. Moreover, a nimber is its own ].<ref name=Unity2021>{{cite book |title=The Unity of Combinatorics |first=Ezra |last=Brown |authorlink=Ezra Brown |first2=Richard K. |last2=Guy |author-link2=Richard K. Guy |section=2.5 Nim arithmetic and Nim algebra|page=35 |publisher=] |year=2021 |isbn=978-1-4704-6509-4 |volume=36 of The Carus Mathematical Monographs |edition=reprint}}</ref> It follows that {{math|1=''α'' ⊕ ''β'' = 0}} ] {{math|1=''α'' = ''β''}}. | |||
== Multiplication == | |||
Nimber multiplication ('''nim-multiplication''') is defined recursively by | Nimber multiplication ('''nim-multiplication''') is defined recursively by | ||
<math display=block> \alpha \, \beta = \operatorname{mex} \! \bigl(\{\alpha' \beta \oplus \alpha \, \beta' \oplus \alpha' \beta' : \alpha' < \alpha, \beta' < \beta \} \bigr).</math> | |||
Nimber multiplication is associative and commutative, with the ordinal {{math|1}} as the multiplicative ]. Moreover, nimber multiplication ] nimber addition.<ref name=Unity2021/> | |||
Except for the fact that nimbers form a ] and not a set, the class of nimbers determines an ] of ] 2. The nimber additive identity is the ordinal 0, and the nimber multiplicative identity is the ordinal 1. In keeping with the characteristic being 2, the nimber additive inverse of the ordinal α is α itself. The nimber multiplicative inverse of the nonzero ordinal α is given by 1/α = mex(''S''), where ''S'' is the smallest set of ordinals (nimbers) such that | |||
Thus, except for the fact that nimbers form a ] and not a set, the class of nimbers forms a ]. In fact, it even determines an ] of ] 2, with the nimber multiplicative inverse of a nonzero ordinal {{mvar|α}} given by | |||
# 0 is an element of ''S''; | |||
# if 0 < α ′ < α and β ′ is an element of ''S'', then /α ′ is also an element of ''S''. | |||
<math display=block>\alpha^{-1} = \operatorname{mex}(S),</math> | |||
For all natural numbers ''n'', the set of nimbers less than 2<sup>2<sup>''n''</sup></sup> form the ] GF(2<sup>2<sup>''n''</sup></sup>) of order 2<sup>2<sup>''n''</sup></sup>. | |||
where {{mvar|S}} is the smallest set of ordinals (nimbers) such that | |||
# {{math|0}} is an element of {{mvar|S}}; | |||
# if {{math|0 < ''α''′ < ''α''}} and {{mvar|β'}} is an element of {{mvar|S}}, then <math>\tfrac{1 + (\alpha' \oplus \alpha) \beta'}{\alpha'}</math> is also an element of {{mvar|S}}. | |||
For all natural numbers {{mvar|n}}, the set of nimbers less than {{math|2<sup>2<sup>''n''</sup></sup>}} form the ] {{math|GF(2<sup>2<sup>''n''</sup></sup>)}} of order {{math|2<sup>2<sup>''n''</sup></sup>}}. Therefore, the set of finite nimbers is isomorphic to the ] as {{math|''n'' → ∞}} of the fields {{math|GF(2<sup>2<sup>''n''</sup></sup>)}}. This subfield is not algebraically closed, since no field {{math|GF(2<sup>''k''</sup>)}} with {{mvar|k}} not a power of 2 is contained in any of those fields, and therefore not in their direct limit; for instance the polynomial {{math|''x''<sup>3</sup> + ''x'' + 1}}, which has a root in {{math|GF(2<sup>3</sup>)}}, does not have a root in the set of finite nimbers. | |||
Just as in the case of nimber addition, there is a means of computing the nimber product of finite ordinals. This is determined by the rules that | Just as in the case of nimber addition, there is a means of computing the nimber product of finite ordinals. This is determined by the rules that | ||
# The nimber product of |
# The nimber product of a Fermat 2-power (numbers of the form {{math|2<sup>2<sup>''n''</sup></sup>}}) with a smaller number is equal to their ordinary product; | ||
# The nimber square of a Fermat 2-power |
# The nimber square of a Fermat 2-power {{mvar|x}} is equal to {{math|3''x''/2}} as evaluated under the ordinary multiplication of natural numbers. | ||
The smallest algebraically closed field of nimbers is the set of nimbers less than the ordinal |
The smallest algebraically closed field of nimbers is the set of nimbers less than the ordinal {{mvar|ω<sup>ω<sup>ω</sup></sup>}}, where {{mvar|ω}} is the smallest infinite ordinal. It follows that as a nimber, {{mvar|ω<sup>ω<sup>ω</sup></sup>}} is ] over the field.<ref>Conway 1976, p. 61.</ref> | ||
== Addition and multiplication tables == | == Addition and multiplication tables == | ||
The following tables exhibit addition and multiplication among the first 16 nimbers. |
The following tables exhibit addition and multiplication among the first 16 nimbers. | ||
This subset is closed under both operations, since 16 is of the form {{math|2<sup>2<sup>''n''</sup></sup>}}. | |||
{| class="wikitable" style="text-align:right" | |||
<small>(If you prefer simple text tables, they are {{Oldid|page=Nimber|oldid=383699838|label=here}}.)</small> | |||
|+ Nimber addition | |||
|- | |||
! + | |||
! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! 10 !! 11 !! 12 !! 13 !! 14 !! 15 | |||
|- | |||
! 0 | |||
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 | |||
|- | |||
! 1 | |||
| 1 || 0 || 3 || 2 || 5 || 4 || 7 || 6 || 9 || 8 || 11 || 10 || 13 || 12 || 15 || 14 | |||
|- | |||
! 2 | |||
| 2 || 3 || 0 || 1 || 6 || 7 || 4 || 5 || 10 || 11 || 8 || 9 || 14 || 15 || 12 || 13 | |||
|- | |||
! 3 | |||
| 3 || 2 || 1 || 0 || 7 || 6 || 5 || 4 || 11 || 10 || 9 || 8 || 15 || 14 || 13 || 12 | |||
|- | |||
! 4 | |||
| 4 || 5 || 6 || 7 || 0 || 1 || 2 || 3 || 12 || 13 || 14 || 15 || 8 || 9 || 10 || 11 | |||
|- | |||
! 5 | |||
| 5 || 4 || 7 || 6 || 1 || 0 || 3 || 2 || 13 || 12 || 15 || 14 || 9 || 8 || 11 || 10 | |||
|- | |||
! 6 | |||
| 6 || 7 || 4 || 5 || 2 || 3 || 0 || 1 || 14 || 15 || 12 || 13 || 10 || 11 || 8 || 9 | |||
|- | |||
! 7 | |||
| 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0 || 15 || 14 || 13 || 12 || 11 || 10 || 9 || 8 | |||
|- | |||
! 8 | |||
| 8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 || 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 | |||
|- | |||
! 9 | |||
| 9 || 8 || 11 || 10 || 13 || 12 || 15 || 14 || 1 || 0 || 3 || 2 || 5 || 4 || 7 || 6 | |||
|- | |||
! 10 | |||
| 10 || 11 || 8 || 9 || 14 || 15 || 12 || 13 || 2 || 3 || 0 || 1 || 6 || 7 || 4 || 5 | |||
|- | |||
! 11 | |||
| 11 || 10 || 9 || 8 || 15 || 14 || 13 || 12 || 3 || 2 || 1 || 0 || 7 || 6 || 5 || 4 | |||
|- | |||
! 12 | |||
| 12 || 13 || 14 || 15 || 8 || 9 || 10 || 11 || 4 || 5 || 6 || 7 || 0 || 1 || 2 || 3 | |||
|- | |||
! 13 | |||
| 13 || 12 || 15 || 14 || 9 || 8 || 11 || 10 || 5 || 4 || 7 || 6 || 1 || 0 || 3 || 2 | |||
|- | |||
! 14 | |||
| 14 || 15 || 12 || 13 || 10 || 11 || 8 || 9 || 6 || 7 || 4 || 5 || 2 || 3 || 0 || 1 | |||
|- | |||
! 15 | |||
| 15 || 14 || 13 || 12 || 11 || 10 || 9 || 8 || 7 || 6 || 5 || 4 || 3 || 2 || 1 || 0 | |||
|} | |||
] of ] – or the table of ] ] operations.<br>The small matrices show the single digits of the binary numbers.]] | |||
] of ].<br>The small matrices are permuted binary ].]] | |||
{| class="wikitable" style="text-align:right" | |||
|+ Nimber multiplication | |||
|- | |||
! × | |||
! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6 !! 7 !! 8 !! 9 !! 10 !! 11 !! 12 !! 13 !! 14 !! 15 | |||
|- | |||
! 0 | |||
| 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 | |||
|- | |||
! 1 | |||
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12 || 13 || 14 || 15 | |||
|- | |||
! 2 | |||
| 0 || 2 || 3 || 1 || 8 || 10 || 11 || 9 || 12 || 14 || 15 || 13 || 4 || 6 || 7 || 5 | |||
|- | |||
! 3 | |||
| 0 || 3 || 1 || 2 || 12 || 15 || 13 || 14 || 4 || 7 || 5 || 6 || 8 || 11 || 9 || 10 | |||
|- | |||
! 4 | |||
| 0 || 4 || 8 || 12 || 6 || 2 || 14 || 10 || 11 || 15 || 3 || 7 || 13 || 9 || 5 || 1 | |||
|- | |||
! 5 | |||
| 0 || 5 || 10 || 15 || 2 || 7 || 8 || 13 || 3 || 6 || 9 || 12 || 1 || 4 || 11 || 14 | |||
|- | |||
! 6 | |||
| 0 || 6 || 11 || 13 || 14 || 8 || 5 || 3 || 7 || 1 || 12 || 10 || 9 || 15 || 2 || 4 | |||
|- | |||
! 7 | |||
| 0 || 7 || 9 || 14 || 10 || 13 || 3 || 4 || 15 || 8 || 6 || 1 || 5 || 2 || 12 || 11 | |||
|- | |||
! 8 | |||
| 0 || 8 || 12 || 4 || 11 || 3 || 7 || 15 || 13 || 5 || 1 || 9 || 6 || 14 || 10 || 2 | |||
|- | |||
! 9 | |||
| 0 || 9 || 14 || 7 || 15 || 6 || 1 || 8 || 5 || 12 || 11 || 2 || 10 || 3 || 4 || 13 | |||
|- | |||
! 10 | |||
| 0 || 10 || 15 || 5 || 3 || 9 || 12 || 6 || 1 || 11 || 14 || 4 || 2 || 8 || 13 || 7 | |||
|- | |||
! 11 | |||
| 0 || 11 || 13 || 6 || 7 || 12 || 10 || 1 || 9 || 2 || 4 || 15 || 14 || 5 || 3 || 8 | |||
|- | |||
! 12 | |||
| 0 || 12 || 4 || 8 || 13 || 1 || 9 || 5 || 6 || 10 || 2 || 14 || 11 || 7 || 15 || 3 | |||
|- | |||
! 13 | |||
| 0 || 13 || 6 || 11 || 9 || 4 || 15 || 2 || 14 || 3 || 8 || 5 || 7 || 10 || 1 || 12 | |||
|- | |||
! 14 | |||
| 0 || 14 || 7 || 9 || 5 || 11 || 2 || 12 || 10 || 4 || 13 || 3 || 15 || 1 || 8 || 6 | |||
|- | |||
! 15 | |||
| 0 || 15 || 5 || 10 || 1 || 14 || 4 || 11 || 2 || 13 || 7 || 8 || 3 || 12 || 6 || 9 | |||
|} | |||
] {{OEIS|A223541}}<br>Calculating the nim-products of powers of two is a decisive point in the recursive algorithm of nimber-multiplication.]] | |||
A more useful way of representing the addition and multiplication tables is to write each number in binary, and decompose it into powers of 2. Define ''e''<sub>''n''</sub> as the nimber ''2''<sup>''n''</sup>. The only simplifying rule for addition is that for all ''n'', ''e''<sub>''n''</sub> + ''e''<sub>''n''</sub> = 0. | |||
== |
==See also== | ||
* ] | |||
*], ''],'' ] Inc. (London) Ltd., 1976 | |||
* Dierk Schleicher and Michael Stoll, – which discusses games, ]s, and nimbers. | |||
==Notes== | |||
{{reflist}} | |||
==References== | |||
{{refbegin}} | |||
* {{cite book | |||
|first1=John Horton | |||
|last1=Conway | |||
|authorlink1=John Horton Conway | |||
|title=On Numbers and Games | |||
|publisher=] Inc. (London) Ltd. | |||
|year=1976 | |||
|title-link=On Numbers and Games | |||
}} | |||
* {{cite book | |||
|first1=H. W. | |||
|last1=Lenstra | |||
|authorlink1=Hendrik Willem Lenstra, Jr. | |||
|title=Nim multiplication | |||
|series = Report IHES/M/78/211 | |||
|institution= Institut des hautes études scientifiques | |||
|hdl=1887/2125 | |||
|year=1978 | |||
}} | |||
* {{cite arXiv | |||
|first1=Dierk | |||
|last1=Schleicher | |||
|first2=Michael | |||
|last2=Stoll | |||
|eprint=math.DO/0410026 | |||
|title= An Introduction to Conway's Games and Numbers|year=2004 | |||
}} which discusses games, ]s, and nimbers. | |||
{{refend}} | |||
{{Authority control}} | |||
] | ] | ||
] | ] | ||
] | |||
] | |||
] | |||
] | |||
] |
Latest revision as of 00:37, 29 December 2024
Number used in combinatorial game theory Not to be confused with Number.This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
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 nimber multiplication, which are distinct from ordinal addition and ordinal multiplication.
Because of the Sprague–Grundy theorem which states that every impartial game is equivalent to a Nim heap of a certain size, nimbers arise in a much larger class of impartial games. They may also occur in partisan games like Domineering.
The nimber addition and multiplication operations are associative and commutative. Each nimber is its own additive inverse. In particular for some pairs of ordinals, their nimber sum is smaller than either addend. The minimum excludant operation is applied to sets of nimbers.
Uses
Nim
Main article: NimNim is a game in which two players take turns removing objects from distinct heaps. As moves depend only on the position and not on which of the two players is currently moving, and where the payoffs are symmetric, Nim is an impartial game. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap. The goal of the game is to be the player who removes the last object. The nimber of a heap is simply the number of objects in that heap. Using nim addition, one can calculate the nimber of the game as a whole. The winning strategy is to force the nimber of the game to 0 for the opponent's turn.
Cram
Main article: Cram (game)Cram is a game often played on a rectangular board in which players take turns placing dominoes either horizontally or vertically until no more dominoes can be placed. The first player that cannot make a move loses. As the possible moves for both players are the same, it is an impartial game and can have a nimber value. For example, any board that is an even size by an even size will have a nimber of 0. Any board that is even by odd will have a non-zero nimber. Any 2 × n board will have a nimber of 0 for all even n and a nimber of 1 for all odd n.
Northcott's game
In Northcott's game, pegs for each player are placed along a column with a finite number of spaces. Each turn each player must move the piece up or down the column, but may not move past the other player's piece. Several columns are stacked together to add complexity. The player that can no longer make any moves loses. Unlike many other nimber related games, the number of spaces between the two tokens on each row are the sizes of the Nim heaps. If your opponent increases the number of spaces between two tokens, just decrease it on your next move. Else, play the game of Nim and make the Nim-sum of the number of spaces between the tokens on each row be 0.
Hackenbush
Main article: HackenbushHackenbush is a game invented by mathematician John Horton Conway. It may be played on any configuration of colored line segments connected to one another by their endpoints and to a "ground" line. Players take turns removing line segments. An impartial game version, thereby a game able to be analyzed using nimbers, can be found by removing distinction from the lines, allowing either player to cut any branch. Any segments reliant on the newly removed segment in order to connect to the ground line are removed as well. In this way, each connection to the ground can be considered a nim heap with a nimber value. Additionally, all the separate connections to the ground line can also be summed for a nimber of the game state.
Addition
Nimber addition (also known as nim-addition) can be used to calculate the size of a single nim heap equivalent to a collection of nim heaps. It is defined recursively by where the minimum excludant mex(S) of a set S of ordinals is defined to be the smallest ordinal that is not an element of S.
For finite ordinals, the nim-sum is easily evaluated on a computer by taking the bitwise exclusive or (XOR, denoted by ⊕) of the corresponding numbers. For example, the nim-sum of 7 and 14 can be found by writing 7 as 111 and 14 as 1110; the ones place adds to 1; the twos place adds to 2, which we replace with 0; the fours place adds to 2, which we replace with 0; the eights place adds to 1. So the nim-sum is written in binary as 1001, or in decimal as 9.
This property of addition follows from the fact that both mex and XOR yield a winning strategy for Nim and there can be only one such strategy; or it can be shown directly by induction: Let α and β be two finite ordinals, and assume that the nim-sum of all pairs with one of them reduced is already defined. The only number whose XOR with α is α ⊕ β is β, and vice versa; thus α ⊕ β is excluded. On the other hand, for any ordinal γ < α ⊕ β, XORing ξ with all of α, β and γ must lead to a reduction for one of them (since the leading 1 in ξ must be present in at least one of the three); since we must have either thus γ is included as either and hence α ⊕ β is the minimum excluded ordinal.
Nimber addition is associative and commutative, with 0 as the additive identity element. Moreover, a nimber is its own additive inverse. It follows that α ⊕ β = 0 if and only if α = β.
Multiplication
Nimber multiplication (nim-multiplication) is defined recursively by
Nimber multiplication is associative and commutative, with the ordinal 1 as the multiplicative identity element. Moreover, nimber multiplication distributes over nimber addition.
Thus, except for the fact that nimbers form a proper class and not a set, the class of nimbers forms a ring. In fact, it even determines an algebraically closed field of characteristic 2, with the nimber multiplicative inverse of a nonzero ordinal α given by
where S is the smallest set of ordinals (nimbers) such that
- 0 is an element of S;
- if 0 < α′ < α and β' is an element of S, then is also an element of S.
For all natural numbers n, the set of nimbers less than 2 form the Galois field GF(2) of order 2. Therefore, the set of finite nimbers is isomorphic to the direct limit as n → ∞ of the fields GF(2). This subfield is not algebraically closed, since no field GF(2) with k not a power of 2 is contained in any of those fields, and therefore not in their direct limit; for instance the polynomial x + x + 1, which has a root in GF(2), does not have a root in the set of finite nimbers.
Just as in the case of nimber addition, there is a means of computing the nimber product of finite ordinals. This is determined by the rules that
- The nimber product of a Fermat 2-power (numbers of the form 2) with a smaller number is equal to their ordinary product;
- The nimber square of a Fermat 2-power x is equal to 3x/2 as evaluated under the ordinary multiplication of natural numbers.
The smallest algebraically closed field of nimbers is the set of nimbers less than the ordinal ω, where ω is the smallest infinite ordinal. It follows that as a nimber, ω is transcendental over the field.
Addition and multiplication tables
The following tables exhibit addition and multiplication among the first 16 nimbers.
This subset is closed under both operations, since 16 is of the form 2. (If you prefer simple text tables, they are here.)
See also
Notes
- Advances in computer games : 14th International Conference, ACG 2015, Leiden, the Netherlands, July 1-3, 2015, Revised selected papers. Herik, Jaap van den,, Plaat, Aske,, Kosters, Walter. Cham. 2015-12-24. ISBN 978-3319279923. OCLC 933627646.
{{cite book}}
: CS1 maint: location missing publisher (link) CS1 maint: others (link) - Anany., Levitin (2012). Introduction to the design & analysis of algorithms (3rd ed.). Boston: Pearson. ISBN 9780132316811. OCLC 743298766.
- "Theory of Impartial Games" (PDF). Feb 3, 2009.
- ^ Brown, Ezra; Guy, Richard K. (2021). "2.5 Nim arithmetic and Nim algebra". The Unity of Combinatorics. Vol. 36 of The Carus Mathematical Monographs (reprint ed.). American Mathematical Society. p. 35. ISBN 978-1-4704-6509-4.
- Conway 1976, p. 61.
References
- Conway, John Horton (1976). On Numbers and Games. Academic Press Inc. (London) Ltd.
- Lenstra, H. W. (1978). Nim multiplication. Report IHES/M/78/211. Institut des hautes études scientifiques. hdl:1887/2125.
- Schleicher, Dierk; Stoll, Michael (2004). "An Introduction to Conway's Games and Numbers". arXiv:math.DO/0410026. which discusses games, surreal numbers, and nimbers.