# 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.
In the specific case of misere-play impartial games, such commutative monoids have become known as misere quotients.

## Example: Misere Nim variant

Suppose the game of Nim is played as usual with heaps of objects, but that at the start of play, every heap is restricted to have either one or two objects in it. In the normal-play convention, players take turns to remove any number of objects from a heap, and the last player to take an object from a heap is declared the winner of the game; in Misere play, that player is the loser of the game.
Regardless of whether the normal or misere play convention is in effect, the outcome of such a position is necessarily of one of two types:

### N

    The Next player to move has a forced win in best play; or

### P

    The Previous player to move has a forced win.
We can write down a commutative monoid presentation for the misere quotient of this 1- and 2-pile Nim game by first recasting its conventional nimber-based solution into a multiplicative form, and then modifying that slightly for misere play.

### Normal-play analysis

The nimbers that occur in the normal play of such positions are *0, *1, *2, and *3.
| Nimber | Outcome | Positions with that nimber |
| $\ast 0$ | P | Even number of heaps of size 1 and even number of heaps of size 2 |
| $\ast 1$ | N | Odd number of heaps of size 1 and even number of heaps of size 2 |
| $\ast 2$ | N | Even number of heaps of size 1 and odd number of heaps of size 2 |
| $\ast 3$ | N | Odd number of heaps of size 1 and odd number of heaps of size 2 |
These four nim values combine according to the Klein four-group:
    ${\begin{array}{c|ccc}+&\ast 0&\ast 1&\ast 2&\ast 3\\\hline \ast 0&\ast 0&\ast 1&\ast 2&\ast 3\\\ast 1&\ast 1&\ast 0&\ast 3&\ast 2\\\ast 2&\ast 2&\ast 3&\ast 0&\ast 1\\\ast 3&\ast 3&\ast 2&\ast 1&\ast 0\end{array}}$
The Klein four-group is also defined by the commutative group presentation
    $\mathrm {V} =\langle a,b\mid a^{2}=b^{2}=1\rangle$.
The elements of $\mathrm {V} =\{1,a,b,ab\}$ can be thought of as in one-to-correspondence with the nim values $\{\ast 0,\ast 1,\ast 2,\ast 3\}$ that occur in the play of this simplified Nim game; they combine exactly in the same way.
So far, this formal introduction of the Klein four-group has added nothing new to the conventional analysis of 1- and 2-pile Nim using nimbers and nim-addition.
Instead, we have merely recast the theory into a multiplicative form.

### Misere-play analysis

The advantage of the multiplicative form is that it allows us to write down a similar solution for the misere quotient of Nim played with heaps of size one and two only.
We introduce the commutative monoid presentation
    $\mathrm {M} =\langle a,b\mid a^{2}=1,\ b^{3}=b\rangle .$
whose six elements are $\{1,a,b,ab,b^{2},ab^{2}\}.$
| Misere quotient value | Outcome | Positions in that class |
| 1 | N | Even number of heaps of size 1 and no heaps of size 2 |
| a | P | Odd number of heaps of size 1 and no heaps of size 2 |
| b | N | Even number of heaps of size 1 and odd number of heaps of size 2 |
| ab | N | Odd number of heaps of size 1 and odd number of heaps of size 2 |
| $b^{2}$ | P | Even number of heaps of size 1 and even number (greater than zero) of heaps of size 2 |
| $ab^{2}$ | N | Odd number of heaps of size 1 and even number (greater than zero) of heaps of size 2 |
The solution to the correct play of misere Nim was already fully described by Bouton in 1902. In the final sentence of that paper, Bouton writes that in misere Nim, "the safe combinations are the same as before, except that an odd number of piles, each containing one, is now safe [ie, is an P-position], while an even number of ones is not safe [ie, is an N-position]." The misere quotient formulation above is easily seen to be equivalent in the case of Nim played with heaps of size one and two only.

## Formal definition

Suppose $A$ is a set of impartial combinatorial games that is finitely-generated with respect to disjunctive sums and closed in both of the following senses:
(1) Additive closure: If $G$ and $H$ are games in $A$, then their disjunctive sum $G+H$ is also in $A$.
(2) Hereditary closure: If $G$ is a game in $A$ and $H$ is an option of $G$, then $H$ is also in $A$.
Next, define on $A$ the indistinguishability congruence ≈ that relates two games $G$ and $H$ if for every choice of a game $X$ in $A$, the two positions $G+X$ and $H+X$ have the same outcome (i.e., are either both first-player wins in best play of $A$, or alternatively are both second-player wins).
One easily checks that ≈ is indeed a congruence on the set of all disjunctive position sums in $A$, and that this is true regardless of whether the game is played in normal or misere play. The totality of all the congruence classes form the indistinguishability quotient.
If $A$ is played as a normal-play (last-playing winning) impartial game, then the congruence classes of $A$ are in one-to-one correspondence with the nim values that occur in the play of the game (themselves determined by the Sprague–Grundy theorem).
In misere play, the congruence classes form a commutative monoid, instead, and it has become known as a misere quotient.

## Algorithms for computing misere quotients

Many more complicated and intricate misere quotients have been calculated for various impartial games, and particularly for octal games. A general-purpose algorithm for computing the misere quotient monoid presentation of a given a finite set of misere impartial game positions has been devised by Aaron N. Siegel and is described in its Appendix C.