Nim-addition
   HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the nimbers, also called Grundy numbers (not to be confused with Grundy chromatic numbers), are introduced in
combinatorial game theory Combinatorial game theory is a branch of mathematics and theoretical computer science that typically studies sequential games with perfect information. Research in this field has primarily focused on two-player games in which a ''position'' ev ...
, where they are defined as the values of heaps in the game Nim. The nimbers are the
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 leas ...
s endowed with ''nimber addition'' and ''nimber multiplication'', which are distinct from
ordinal addition In the mathematical field of set theory, ordinal arithmetic describes the three usual operations on ordinal numbers: addition, multiplication, and exponentiation. Each can be defined in essentially two different ways: either by constructing an expl ...
and
ordinal multiplication In the Mathematics, mathematical field of set theory, ordinal arithmetic describes the three usual operations on ordinal numbers: addition, multiplication, and exponentiation. Each can be defined in essentially two different ways: either by constru ...
. Because of the
Sprague–Grundy theorem In combinatorial game theory, the Sprague–Grundy theorem states that every impartial game under the normal play convention is equivalent to a one-heap game of nim, or to an infinite generalization of nim. It can therefore be represented ...
which 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 be ...
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 game In combinatorial game theory, a game is partisan (sometimes partizan) if it is not impartial. That is, some moves are available to one player and not to the other, or the payoffs are not symmetric. Most games are partisan. For example, in chess, on ...
s like Domineering. The nimber addition and multiplication operations are associative and commutative. Each nimber is its own
additive inverse In mathematics, the additive inverse of an element , denoted , is the element that when added to , yields the additive identity, 0 (zero). In the most familiar cases, this is the number 0, but it can also refer to a more generalized zero el ...
. In particular for some pairs of ordinals, their nimber sum is smaller than either addend. The
minimum excludant In mathematics, the mex ("minimum excluded value") of a subset of a well-ordered set is the smallest value from the whole set that does not belong to the subset. That is, it is the minimum value of the complement set. Beyond sets, subclasses of ...
operation is applied to sets of nimbers.


Definition

As a class, nimbers are indexed by
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 leas ...
s, and form a subclass of
surreal number In mathematics, the surreal number system is a total order, totally ordered proper class containing not only the real numbers but also Infinity, infinite and infinitesimal, infinitesimal numbers, respectively larger or smaller in absolute value th ...
s, introduced by
John Horton Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician. He was active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many b ...
as part of his theory of combinatorial games. However, nimbers are distinct from ordinal and surreal numbers in that they follow distinct
arithmetic Arithmetic is an elementary branch of mathematics that deals with numerical operations like addition, subtraction, multiplication, and division. In a wider sense, it also includes exponentiation, extraction of roots, and taking logarithms. ...
rules, nim-addition and nim-multiplication. Other than that they are a proper class rather than a set, nimbers form a
field Field may refer to: Expanses of open ground * Field (agriculture), an area of land used for agricultural purposes * Airfield, an aerodrome that lacks the infrastructure of an airport * Battlefield * Lawn, an area of mowed grass * Meadow, a grass ...
under nim-addition and nim-multiplication. As a set, finite nimbers can be put in one-to-one correspondence with finite ordinal numbers, which are the
natural numbers In mathematics, the natural numbers are the numbers 0, 1, 2, 3, and so on, possibly excluding 0. Some start counting with 0, defining the natural numbers as the non-negative integers , while others start with 1, defining them as the positiv ...
. Nonetheless, their arithmetic structures are not
isomorphic In mathematics, an isomorphism is a structure-preserving mapping or morphism between two structures of the same type that can be reversed by an inverse mapping. Two mathematical structures are isomorphic if an isomorphism exists between the ...
; nimber arithmetic fundamentally differs from ordinary arithmetic operations on natural numbers. Nimbers are often denoted using a star notation .


Uses


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.


Cram

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 board will have a nimber of 0 for all even and a nimber of 1 for all odd .


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

Hackenbush is a game invented by mathematician
John Horton Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician. He was active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many b ...
. It may be played on any configuration of colored
line segment In geometry, a line segment is a part of a line (mathematics), straight line that is bounded by two distinct endpoints (its extreme points), and contains every Point (geometry), point on the line that is between its endpoints. It is a special c ...
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 \alpha \oplus \beta = \operatorname \! \bigl( \ \cup \ \bigr), where the
minimum excludant In mathematics, the mex ("minimum excluded value") of a subset of a well-ordered set is the smallest value from the whole set that does not belong to the subset. That is, it is the minimum value of the complement set. Beyond sets, subclasses of ...
of a set of ordinals is defined to be the smallest ordinal that is ''not'' an element of . For finite ordinals, the nim-sum is easily evaluated on a computer by taking the
bitwise In computer programming, a bitwise operation operates on a bit string, a bit array or a binary numeral (considered as a bit string) at the level of its individual bits. It is a fast and simple action, basic to the higher-level arithmetic operat ...
exclusive or Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (on ...
(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 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. \zeta := \alpha \oplus \beta \oplus \gamma 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 \zeta \oplus \gamma = \alpha \oplus \beta > \gamma, we must have either \begin \alpha > \zeta \oplus \alpha &= \beta \oplus \gamma, \quad\text\\ pt\beta > \zeta \oplus \beta &= \alpha \oplus \gamma. \end Thus is included as either \begin (\beta \oplus \gamma) \oplus \beta, \quad\text\\ pt\alpha \oplus (\alpha \oplus \gamma); \end and hence is the minimum excluded ordinal. Nimber addition is
associative In mathematics, the associative property is a property of some binary operations that rearranging the parentheses in an expression will not change the result. In propositional logic, associativity is a valid rule of replacement for express ...
and
commutative 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. Perhaps most familiar as a pr ...
, with as the additive
identity element In mathematics, an identity element or neutral element of a binary operation is an element that leaves unchanged every element when the operation is applied. For example, 0 is an identity element of the addition of real numbers. This concept is use ...
. Moreover, a nimber is its own
additive inverse In mathematics, the additive inverse of an element , denoted , is the element that when added to , yields the additive identity, 0 (zero). In the most familiar cases, this is the number 0, but it can also refer to a more generalized zero el ...
. It follows that
if and only if In logic and related fields such as mathematics and philosophy, "if and only if" (often shortened as "iff") is paraphrased by the biconditional, a logical connective between statements. The biconditional is true in two cases, where either bo ...
.


Multiplication

Nimber multiplication (nim-multiplication) is defined recursively by \alpha \, \beta = \operatorname \! \bigl(\ \bigr). Nimber multiplication is associative and commutative, with the ordinal as the multiplicative
identity element In mathematics, an identity element or neutral element of a binary operation is an element that leaves unchanged every element when the operation is applied. For example, 0 is an identity element of the addition of real numbers. This concept is use ...
. Moreover, nimber multiplication distributes over nimber addition. Thus, except for the fact that nimbers form a
proper class Proper may refer to: Mathematics * Proper map, in topology, a property of continuous function between topological spaces, if inverse images of compact subsets are compact * Proper morphism, in algebraic geometry, an analogue of a proper map f ...
and not a set, the class of nimbers forms a
ring (The) Ring(s) may refer to: * Ring (jewellery), a round band, usually made of metal, worn as ornamental jewelry * To make a sound with a bell, and the sound made by a bell Arts, entertainment, and media Film and TV * ''The Ring'' (franchise), a ...
. In fact, it even determines an
algebraically closed field In mathematics, a field is algebraically closed if every non-constant polynomial in (the univariate polynomial ring with coefficients in ) has a root in . In other words, a field is algebraically closed if the fundamental theorem of algebra ...
of characteristic 2, with the nimber multiplicative inverse of a nonzero ordinal given by \alpha^ = \operatorname(S), where is the smallest set of ordinals (nimbers) such that # is an element of ; # if and is an element of , then \tfrac is also an element of . For all natural numbers , the set of nimbers less than form the
Galois field In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subtr ...
of order . Therefore, the set of finite nimbers is isomorphic to the
direct limit In mathematics, a direct limit is a way to construct a (typically large) object from many (typically smaller) objects that are put together in a specific way. These objects may be groups, rings, vector spaces or in general objects from any cate ...
as of the fields . This subfield is not algebraically closed, since no field with not a power of 2 is contained in any of those fields, and therefore not in their direct limit; for instance the polynomial , which has a root in , 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 ) with a smaller number is equal to their ordinary product; # The nimber square of a Fermat 2-power is equal to 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.Conway 1976, p. 61.


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 . (If you prefer simple text tables, they are .)


See also

*
Surreal number In mathematics, the surreal number system is a total order, totally ordered proper class containing not only the real numbers but also Infinity, infinite and infinitesimal, infinitesimal numbers, respectively larger or smaller in absolute value th ...


Notes


References

* * * which discusses games,
surreal number In mathematics, the surreal number system is a total order, totally ordered proper class containing not only the real numbers but also Infinity, infinite and infinitesimal, infinitesimal numbers, respectively larger or smaller in absolute value th ...
s, and nimbers. {{Authority control Combinatorial game theory Finite fields Ordinal numbers