Nimber

In mathematics, a nimber, also called a Grundy number (not to be confused with Grundy chromatic numbers), is a mathematical value used in combinatorial game theory to represent the value of a position in an impartial game. Nimbers are most closely associated with the game Nim, where the nimber of a heap is the number of objects in that heap. The nimbers are indexed by ordinal numbers and form a subclass of surreal numbers, but are 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 can be used to analyse games such as Nim, Cram, Northcott's game, and the impartial version of Hackenbush.

Nimber addition and multiplication are associative and commutative. Nimber addition has 0 as its additive identity, and each nimber is its own additive inverse. For finite nimbers, nimber addition can be calculated using the bitwise exclusive or (XOR) operation. The class of nimbers, under nimber addition and multiplication, forms a field except that it is a proper class rather than a set.