INTEGERS: ELECTRONIC JOURNAL OF COMBINATORIAL NUMBER THEORY 5 (2005), #G05

TAMING THE WILD IN IMPARTIAL COMBINATORIAL GAMES

Thane E. Plambeck^{1}

2341 Tasso Street, Palo Alto, California 94301

                             thane@best.com

Received: 12/3/04, Revised: 7/14/05, Accepted: 7/15/05, Published: 7/19/05

Abstract

We introduce a misere quotient semigroup construction in impartial combinatorial game theory, and argue that it is the long-sought natural generalization of the normal-play Sprague-Grundy theory to misere play. Along the way, we illustrate how to use the theory to describe complete analyses of two wild taking and breaking games.

1. Introduction

On page 146 of On Numbers and Games, in Chapter 12, “How to Lose When You Must,” John Conway writes:

Note that in a sense, [misere] restive games are ambivalent Nim-heaps, which choose their size (g_{0} or g) according to their company. There are many other games which exhibit behaviour of this type, and it would be very interesting to have some general theory for them.

This paper provides such a general theory, cast in the language of commutative semigroups. We have two goals:

• Generalize the normal-play Sprague-Grundy theory of impartial games to misere play.

• Describe complete winning strategies for particular wild misere games.

We introduce a quotient semigroup structure on the set of all positions of an impartial game with fixed rules. The basic construction is the same for both normal and misere play. In normal play, it leads to the familiar Sprague-Grundy theory. In misere play, when applied to the set of all sums of positions played according to a particular game’s rules, it leads to a quotient of a free commutative semigroup by the game’s indistinguishability congruence. Playing a role similar to the one that nim sequences do for normal play, mappings from single-heap positions into a game’s misere quotient semigroup succinctly and necessarily encode all relevant information about its best misere play. Studying examples in detail, we’ll see how wild misere games that involve an infinity of evermore complicated canonical forms amongst their position sums may nevertheless possess a relatively simple, even finite misere quotient. Many previously unsolved wild misere games have now been resolved [P] using such techniques.

1http://www.plambeck.org/oldhtml/mathematics/games/misere

2. Prerequisites

We’re going to assume that our reader is already familiar with the theory of normal- and misere-play impartial combinatorial games as presented in [WWI], [WWII], or [ONAG]. For basic concepts and results cited from commutative semigroup theory, we follow [CP].

Specifically, our reader should be familiar with the following: the abstract definition of an impartial game; the convention that a sum of games is played disjunctively; the difference between the normal play (last player winning) and misere play (last player losing) play conventions; the rules of the game of Nim; the Sprague-Grundy theory, including nim equivalents (ie, nim-heaps ∗k), nim-addition, and the mex rule; the idea that each impartial game has a deterministic outcome class that describes it as either an P-position (previous player winning in best play) or an N-position (next player winning); the notion of canonical forms for normal and misere play games, and how to compute them; the game code notation for specifying the rules of a taking and breaking game, and related concepts.

For misere play, we’re going to additionally assume that the reader knows what genus symbols are, how to compute them, their relation to correct play of misere Nim, and the role they play in the tame-wild distinction. We’ll try to limit our dependence on these latter concepts, however.

3. Misere taking and breaking games as semigroup quotients

Suppose Γ is a taking and breaking game whose rules have been fixed in advance. The reader is invited to think of Γ as standing for Nim, or Dawson’s Chess, or Kayles, or any other impartial game that can be played using heaps of beans.

3.1 Heap alphabets

Let h_{i} be a distinct, purely formal symbol for each i ≥ 1. We will call the set H = {h_{1}, h_{2}, h_{3}, …} the heap alphabet. A particular symbol h_{i} will sometimes be called a heap of size i.

The notation H_{n} stands for the subset H_{n} = {h_{1}, …, h_{n}} ⊆ H for each n ≥ 1.

3.2 Game positions

Let F_{H} be the free commutative semigroup on the heap alphabet H. The semigroups F_{H} and F_{H_{n}} include an identity Λ, which is just the empty word.

There’s a natural correspondence between the elements of F_{H} and the set of all position sums of a taking and breaking game Γ. In this correspondence, a finite sum of heaps of various sizes is written multiplicatively using corresponding elements of the heap alphabet H. For example, a position with two heaps of size six, and one each of sizes three and two would correspond to the product

h_{2}h_{3}h_{6}^{2}.

This multiplicative notation for sums makes it convenient to take the convention that the empty position Λ = 1. It corresponds to the endgame—a position with no options.

The following definition and simple lemma are of the utmost importance to us.

3.3 Indistinguishability

Fix the rules and associated play convention (normal or misere) of a particular taking and breaking game Γ. Let u, v ∈ F_{H} be game positions in Γ. We’ll say that u is indistinguishable^{2} from v over F_{H}, and write the relation u ρ v, if for every element w ∈ F_{H}, uw and vw are either both P -positions, or are both N-positions.

Lemma 1 The relation ρ is a congruence on F_{H}.

Proof. We must show that ρ is a reflexive, symmetric, transitive, and compatible relation on F_{H}. It’s easy to see that the indistinguishability definition ensures that u ρ u is always true, and that u ρ v implies v ρ u. So ρ is reflexive and symmetric.

2The indistinguishability definition originates in Conway’s ([ONAG] pg 147ff) discussion of misere canonical forms, where the elements w were taken instead from the set of all impartial misere combinatorial games. We’re interested in indistinguishability only over the smaller set (and subsets of) F_{H}, the set of all sums that actually arise in the game Γ we’re studying. Although the difference may seem slight, it is in fact crucial to the success of the methods described in this paper. See Section 11 for more discussion.

• ρ is transitive: Suppose u ρ v and v ρ s. Since u ρ v, for every choice of w ∈ F_{H}, uw and vw have the same outcome. Since v ρ s, vw and sw have the same outcome. So uw and sw have the same outcome, ie, u ρ s.

• ρ is compatible: We need to show that u ρ v implies uw ρ vw for every w ∈ F_{H}. So suppose that s is an arbitrary element of F_{H}. We need to show that uws and vws have the same outcome. But if we let w′ = ws, we can use that fact that u ρ v to conclude that uw′ and vw′ have the same outcome. So uw ρ vw.

□

We come now to the central object of our study.

3.4 The quotient semigroup

Suppose the rules and play convention of a taking and breaking game Γ are fixed, and let ρ be the indistinguishability congruence on F_{H}, the free commutative semigroup of all positions in Γ. The indistinguishability quotient Q = Q(Γ) is the commutative semigroup

Q = F_{H}/ρ.

Notice that the indistinguishability quotient can be taken with respect to either play convention (normal or misere). The details of the indistinguishability congruence then determine the structure of the indistinguishability quotient. Since the word “indistinguishability” is quite a mouthful, we prefer to call Q the quotient semigroup of Γ.

When Γ is a normal play game, its quotient semigroup Q = Q(Γ) is more than just a semigroup. The Sprague-Grundy theory says that it is always a group. It’s isomorphic to a direct product of a (possibly infinite) set of Z_{2}’s (cyclic groups of order two). If u is a position in F_{H} with normal play nim-heap equivalent ∗k, the members of a particular congruence class uρ ∈ F_{H}/ρ will be precisely all positions that have normal-play nimheap equivalent ∗k. The identity of Q is the congruence class of all positions with nim-heap equivalent ∗0. The “group multiplication” corresponds to nim addition. We won’t have much more to say about such normal play quotients in this paper. Instead, we’ll be almost exclusively interested in misere quotient semigroups.

For misere play, the quotient structure is a semigroup. Surprisingly, it’s often a finite object, even for a game that has an infinite number of different canonical forms occurring amongst its sums.

Do the elements of a particular congruence class all have the same outcome? Yes. Each class can be thought of as carrying a big stamp labelled “P” (previous player wins in best play for all positions in this class) or “N” (next player wins). In normal play, there’s only one equivalence class labelled “P”—these are the positions with nim heap equivalent ∗0. In misere play, for all but the trivial games with one position ∗0, or two positions {∗0, ∗1}, there is always more than one “P” class—one corresponding to the position ∗1, and at least one more, corresponding to the position ∗2 + ∗2.

It’s time to look at a concrete example of the quotient semigroup of a wild misere game.

4. How to lose at 0.123

The octal game 0.123 can be played with counters arranged in heaps. Two players take turns removing one, two or three counters from a heap, subject to the following conditions:

1. Three counters may be removed from any heap;

2. Two counters may be removed from a heap, but only if it has more than two counters; and

3. One counter may be removed only if it is the only counter in that heap.

In normal play of 0.123, the last player able to make a legal move is declared the winner. In normal play, each heap size reduces to a nim-heap. The resulting nim sequence^{3} is periodic of length 5, beginning at heap 5. See Figure 1.

+ 1 2 3 4 5
0+ 1 0 2 2 1
5+ 0 0 2 1 1
10+ 0 0 2 1 1
15+ ⋯

Figure 1: Normal play nim heap equivalents for 0.123.

In misere play, the last player to make a legal move is declared to be the loser of the game.

Taking our notation from Winning Ways ([WWII], Vol II, Chapter 13, “Survival in the Lost World”), we exhibit the genus sequence of misere 0.123 in Figure 2. This sequence is also periodic of length 5. See Figure 2.

3See Winning Ways [WWII], Vol I, Chapter 4, pg 87, “Other Take-Away Games;” also Table 7(b), pg 104.

+ 1 2 3  4 5
0+ 1 0 2  2 1
5+ 0^{02} 0 2^{1420} 1^{20} 1
10+ 0^{02} 0 2^{1420} 1^{20} 1
15+ ⋯

Figure 2: G*-values of .123

In Figure 2, an entry that is a simple integer (0, 1, or 2) represents that the game at that position has a misere canonical form identical to a misere nim heap of the corresponding size. The genus symbols^{4} of the nim heaps that occur in Table 2 are

0 = 0^{1202020···} = 0^{120}
1 = 1^{0313131···} = 1^{031}
2 = 2^{2020202···} = 2^{20}.

In misere play of 0.123, the first non-nim-heap occurs at the six-counter heap. It is the game h_{6} = 2_{+} = {2}. The eight-counter heap is h_{8} = {2_{+}, 1}, and the nine-counter heap is h_{9} = {h_{8}, 0}. Unlike h_{6}, the latter two positions are wild—their genera match the genus of no misere Nim position. Although the subsequent canonical forms of the games occurring at heap sizes = 1, 3, and 4 (modulo 5) are not identical to h_{6}, h_{8}, and h_{9}, respectively, their respective genera do repeat, as indicated in Figure 2.

The information in Figure 2 is sufficient to determine outcome classes for single heap misere 0.123 positions, and also sums of a single heap with arbitrary numbers of nim heaps of size one or two (via the genus symbol exponents). To capture information about the best play of all misere 0.123 positions (ie, an arbitrary sum of arbitrarily-sized heaps), we change our viewpoint entirely—we write down a semigroup presentation for its misere quotient Q.

4.1 The misere quotient semigroup Q_{0.123}

1 2 3 4 5
0+ x e z z x
5+ b^{2} e a b x
10+ b^{2} e a b x
15+ ⋯

Figure 3: Semigroup identifications for single heaps in misere 0.123 Theorem 1. The misere quotient Q(Γ) of the wild octal game Γ = 0.123 is isomorphic to a twenty-element commutative semigroup Q_{0.123} with identity e that is presented by the following generators and relations:

4See [WWII], Vol II, pg 422, “Animals and Their Genus.” In [WWI], see Vol I, pg 402.

{x, z, a, b | x^{2} = a^{2} = e, z^{4} = z^{2}, b^{4} = b^{2}, abz = b, b^{3}x = b^{2}, z^{3}a = z^{2}}.

We won’t have the tools in place to prove that Q and Q_{0.123} are isomorphic for several more sections (see Section 9 if you can’t wait). Our immediate goal is to take a closer look at Q_{0.123} itself.

The twenty elements of Q_{0.123} are

{e, x, z, a, b, xz, xa, xb, z^{2}, za, zb, b^{2}, xz^{2}, xza, xzb, xb^{2}, z^{3}, zb^{2}, xz^{3}, xzb^{2}},

and they can be partitioned into fifteen pairwise distinguishable N-position elements

{e, z, a, b, xz, xb, za, xz^{2}, xza, xzb, xb^{2}, z^{3}, zb^{2}, xz^{3}, xzb^{2}},

and five pairwise distinguishable P-position elements

{x, xa, b^{2}, z^{2}, zb}.

See Figure 4.

The outcome class of a given 0.123 misere position can be determined in two steps. In the first step, semigroup equivalents for the various single heaps of the position are looked up using Figure 3, whose second row repeats indefinitely. In the second step, the semigroup equivalents are multiplied together and the semigroup presentation relations in Theorem 1 are used to compute the outcome class.

Here’s an example. Suppose we have a sum of six heaps of sizes

1, 3, 4, 8, 9, and 21.

Looking up these heap sizes in Figure 3, we find they are equivalent to semigroup elements

x, z, z, a, b, and b^{2},

respectively. Multiplying them together, applying commutativity, and reducing via the semigroup relations, we obtain the element

xz^{2}ab^{3} = (abz)xzb^{2} = (b)xzb^{2} = (b^{3}x)z = b^{2}z = zb^{2}.

Figure 4 reveals zb^{2} to be an N position.

# element genus outcome x z a b
1  e  0^{120}  N  2 3 4 5
2  x  1^{031}  P  1 6 7 8
3  z  2^{20}  N  6 9 10 11
4  a  2^{1420}  N  7 10 1 11
5  b  1^{20}  N  8 11 11 12
6  xz  3^{31}  N  3 13 14 15
7  xa  3^{0531}  P  4 14 2 15
8  xb  0^{31}  N  5 15 15 16
9  z^{2}  0^{02}  P  13 17 17 5
10  za  0^{420}  N  14 17 3 5
11  zb  3^{02}  P  15 5 5 18
12  b^{2}  0^{02}  P  16 18 18 16
13 xz^{2}  1^{13}  N  9 19 19 8
14 xza  1^{531}  N  10 19 6 8
15 xzb  2^{13}  N  11 8 8 20
16 xb^{2}  1^{13}  N  12 20 20 12
17  z^{3}  2^{20}  N  19 9 9 11
18 zb^{2}  2^{20}  N  20 12 12 20
19 xz^{3}  3^{31}  N  17 13 13 15
20 xzb^{2}  3^{31}  N  18 16 16 18

Figure 4: Elements, genera, outcomes, and the action of generators in the misere quotient semigroup Q_{0.123}.

4.2 Exercise

A winning move from the position considered in the previous section happens to be to take its entire heap of size 3. What is the semigroup element and genus of the resulting P position? (Answer in this footnote^{5}).

5. Knuth-Bendix rewriting and Rédei’s theorem

The reader might have wondered whether the “word reduction” algebra of the previous section can always be carried out in general. Perhaps it’s one of those undecidable word problems that we hear about in semigroup theory? The answer is no, at least for the particular example considered—Q_{0.123} is a finite semigroup, after all. We might as well have written out its entire 20×20 multiplication table, and used that to reduce a general word to one of the twenty canonical semigroup elements, instead.

In fact, there’s no problem even in the general case, provided our starting point is a finitely presented commutative semigroup S that we’ve already proved to be isomorphic to the misere quotient. In this case, there will be no problem with the word reduction problem in S when we come to apply our semigroup presentation to the selection of best moves in the game.

5[Answer: b^{2}, of genus 0^{02}.]

How does this work in practice? A canonical presentation [AKS] can be always be computed from a finitely presented commutative semigroup via the Knuth-Bendix rewriting process [KB]. In the case of commutative semigroups, the Knuth-Bendix algorithm is always guaranteed to terminate, and the output of the Knuth-Bendix rewriting process— ie, the canonical presentation—determines an algorithm to solve the word problem in S.

5.1 Confluent rewriting for 0.123

For example, Figure 5 shows a confluent rewriting system [BN] for 0.123. It was computed using the computer algebra package GAP4 [GAP].

       Rewriting System for Semigroup( [ x, z, a, b, e ] ) with rules
          [ [ x^2, e ],  [ a^2, e ], , [ z^4, z^2 ], [ a*b, z*b ],
            [ z^2*b, b ], [ b^3, x*b^2 ], [ z^2*a, z^3 ] ]

Figure 5: A confluent rewriting system for Q_{0.123}.

To reduce a general word in the generators {x, z, a, b} to an element of Q_{0.123}, one repeatedly replaces any matching left hand side of a rule by the corresponding right hand side, until no more such reductions are possible. The Knuth-Bendix confluence property guarantees that this process always terminates, and always terminates in the same outcome, no matter what order the rules are applied.

5.2 Rédei’s theorem

Another relevant result, due to L. Rédei, is the following:

Theorem [Rédei] Every finitely generated commutative semigroup with an identity is finitely presentable.

Rédei’s result implies that a partial analysis of a misere game (ie, a misere quotient taken only over positions with no heap larger than a fixed size n) will have a finitely presented misere quotient.

6. Pretending

The reader may have felt another misgiving about our exposition in section 4. We started off this paper by highlighting the misere quotient Q(Γ) as the fundamental object of interest in the misere play of a taking and breaking game Γ. But when we actually started to compute outcomes for a concrete, specific position of 0.123, we immediately bought to bear two additional pieces of information:

1. Figure 3 was used to look up a specific semigroup element of Q_{0.123} for each heap in the position; and

2. Figure 4’s partition of Q_{0.123} elements into P- and N- positions was used to look up the outcome classes of specific semigroup elements.

Both of these pieces of information are indeed critical to the complete analysis of a misere game. We chose to introduce them informally, first, to simplify our exposition of the misere quotient machinery. Now is the time to be more precise.

We call the former information a pretending function and the latter, a quotient partition. Their definitions both involve the misere quotient semigroup S.

6.1 Pretending functions and outcome partitions

Let S be a semigroup. Let H be the heap alphabet {h_{1}, h_{2}, …}. A pretending function is a mapping

Φ : H → S.

If p and r are positive integers and Φ additionally satisfies

Φ(h_{k}) = Φ(h_{k+p})

for every k ≥ r, we call Φ a periodic pretending function of index r period p.

Pretending functions play a role in the analysis of misere games similar to the one that nim sequences do in normal play.

An outcome partition S = P ⋃ N is a partition of a semigroup S into two nonempty parts, the P positions and the N positions.

7. A look inside the structure of a wild misere game

In 1940, Rees [R1] proved a fundamental structural result in semigroup theory that is analogous to the Jordan-Hölder-Schreier Theorem in group theory. Rees’s theorem

Normal play  Misere play
Nim heap equivalent Quotient semigroup element
Nim addition  Quotient semigroup multiplication
Periodic nim sequence Periodic pretending function
P position  P portion of outcome partition

Figure 6: Normal vs misere play concepts in impartial games

asserts that any two relative ideal series of a semigroup S have isomorphic refinements; in particular, any two composition series of S are isomorphic^{6}. We will not require (or even state) Rees’s results in their full generality, but will use ideas associated with Rees’s Theorem to describe the mathematical structure of Q_{0.123} in section 7.1. Our source for the definitions and results cited in this section is [CP], which we follow closely.

7.1 The Rees congruence.

Let I be an ideal of a semigroup S. Define a relation u η v to mean that either u = v or else both u and v belong to I. We call η the Rees congruence modulo I. The equivalence classes of S mod η are I itself and every one element set {w} with w in S \ I. The set S/I should be thought of as the result of collapsing I into a single (zero) element, while the elements outside of I retain their identity.

7.2 Principal series and factors

By a principal series of a semigroup S, we mean a chain

S = S_{1} ⊃ S_{2} ⊃ ⋯ ⊃ S_{m} ⊃ S_{m+1} = ∅  (1)

of ideals S_{i} (i = 1, …, m) of S, beginning with S and ending with the empty set, and such that there is no ideal of S strictly between S_{i} and S_{i+1} (i = 1, …, m).

By the factors of a principal series S, we mean the Rees factor semigroups S_{i}/S_{i+1}.

7.3 Principal series for Q_{0.123}

The final four columns of Figure 4 show the action of each of the four generators {x, z, a, b} on Q_{0.123}. We’ve written the same information graphically in Figures 7, 8, 9, and 10. The elements x and a are simple involutions, but z and b are not.

6See [CP], pg 74.

[figure: 10; 14; 11; 15; 12; 16; 17; 19; 18; 20; 1; 2; 3; 6; 4; 7; 5; 8; 9; 13]
Figure 7: The action of x on Q_{0.123}.

[figure: 1; 3; 9; 17; 10; 4; 2; 6; 13; 19; 14; 7; 5; 11; 8; 15; 16; 20; 12; 18]
Figure 8: The action of z on Q_{0.123}.

Such pictures aid in computing the transformations corresponding to the other sixteen semigroup elements of Q_{0.123}, finding the principal ideal series of the semigroup, and working out the associated Rees factor semigroups.

It’s not too hard to show (eg, [L], Proposition 1.3, pg 21) that a semigroup S of transformations of a finite set X (in this example, X = {1, 2, ⋯, 20}) has a unique minimal ideal J, and that J necessarily consists of the elements u ∈ S with the smallest cardinality image set (or rank) |uS|. For S = Q_{0.123}, these smallest-rank elements are J = {12, 16, 18, 20}. They each have rank four. The minimal (or kernel) ideal is therefore

J = S_{5} = {b^{2}, xb^{2}, zb^{2}, xzb^{2}},

which is part of the entire principal series

Q_{0.123} = S = S_{1} ⊃ S_{2} ⊃ S_{3} ⊃ S_{4} ⊃ S_{5} ⊃ S_{6} = ∅,

where

S_{1} = S_{2} ∪ {e, x, a, xa}.
S_{2} = S_{3} ∪ {z, xz, za, xza}
S_{3} = S_{4} ∪ {z^{2}, xz^{2}, z^{3}, xz^{3}}
S_{4} = S_{5} ∪ {b, xb, zb, xzb}
S_{5} = {b^{2}, xb^{2}, zb^{2}, xzb^{2}}
S_{6} = ∅.

Given such a principal series, we’ll also define D_{n} = S_{n} \ S_{n+1}. The sets D_{n} partition S, and together form the congruence classes of the mutual divisibility congruence on S (see Section 8.2).

[figure: 5; 11; 6; 14; 9; 17; 13; 19; 16; 20; 1; 4; 2; 7; 3; 10; 8; 15; 12; 18]
Figure 9: The action of a on Q_{0.123}.

[figure: 10; 13; 1; 5; 12; 16; 8; 2; 9; 14; 17; 7; 3; 11; 18; 20; 15; 6; 4; 19]
Figure 10: The action of b on Q_{0.123}.

The Rees factor semigroups S_{1}/S_{2}, S_{3}/S_{4}, and S_{5}/S_{6} are each isomorphic to the Klein four-group Z_{2} × Z_{2} with adjoined zero

K_{4} ∪ {0} = (Z_{2} × Z_{2}) ∪ {0}.

For example, Figure 11 contains the multiplication table of S_{3}/S_{4}.

0 z^{2} xz^{2} z^{3} xz^{3}
0 0 0 0 0 0
z^{2} 0 z^{2} xz^{2} z^{3} xz^{3}
xz^{2} 0 xz^{2} z^{2} xz^{3} z^{3}
z^{3} 0 z^{3} xz^{3} z^{2} xz^{2}
xz^{3} 0 xz^{3} z^{3} xz^{2} z^{2}

Figure 11: Multiplication in S_{3}/S_{4}.

The group K_{4} also happens to be the normal play quotient of 0.123. One often finds such an isomorphism between the normal play quotient of a game and one of its misere game Rees factors (after deleting the adjoined zero)—in fact, illustrating this phenomenon was our motivation for calculating the Rees factors in the first place!

The factors S_{2}/S_{3} and S_{4}/S_{5} are null semigroups—all products equal zero. See Figure

0 b xb zb xzb
0 0 0 0 0 0
b 0 0 0 0 0
xb 0 0 0 0 0
zb 0 0 0 0 0
xzb 0 0 0 0 0

Figure 12: Multiplication in S_{4}/S_{5}.

8. Idempotents and tame islands

Using some more elementary definitions and semigroup results, it’s possible to shed more light on the structure of tame and wild positions in a misere quotient such as Q_{0.123}.

8.1 The natural partial ordering of idempotents

A reflexive, antisymmetric, and transitive relation ≤ on a set X is called a partial ordering. An element f of a semigroup S is an idempotent if f^{2} = f.

Let E be the set of all idempotents of a semigroup S. Define g ≤ f (for g, f ∈ E) to mean gf = fg = g. Then ≤ is a partial ordering of E which we call the natural partial ordering of idempotents of S. (See [CP], its Section 1.8, for a proof that ≤ is a partial ordering of E).

Let’s apply these definitions to Q_{0.123}. After computing the square of each its twenty elements (Figure 4) to see if it is an idempotent, one finds that E = {e, z^{2}, b^{2}}. It’s easy to see that

z^{2} ≤ e, since z^{2}e = z^{2},

and

b^{2} ≤ e, since b^{2}e = b^{2}.

How do z^{2} and b^{2} compare? Start with z^{2}b^{2}, insert an a^{2} = e factor, and apply the semigroup relation zab = b (Theorem 1) twice:

z^{2}b^{2} = z^{2}(a^{2})b^{2}
= (zab)(zab)
= b^{2},

i.e.,

b^{2} ≤ z^{2}.

The natural partial ordering of idempotents of Q_{0.123} is therefore the linear ordering

b^{2} ≤ z^{2} ≤ e.

8.2 Divisibility and idempotents: the tame islands.

If u and v are elements of a commutative semigroup S we say that u divides v, and write u|v, if there exists a w such that uw = v. Define a relation u τ v to mean that both u divides v and v divides u. We’ll call τ the mutual divisibility relation.

Here’s a useful result ([CP], pg 22):

Theorem A semigroup S contains a subgroup if and only if it contains an idempotent.

Here’s another useful result [AKS]:

Theorem In a commutative semigroup S, the mutual divisibility relation is a congruence. The congruence class fτ containing an idempotent f is precisely the maximal subgroup of S for which that element is the identity.

Applying the latter theorem to the principal series of Q_{0.123} (equation 1), we find that the sets

D_{1} = {e, x, a, xa}.
D_{3} = {z^{2}, xz^{2}, z^{3}, xz^{3}}
D_{5} = {b^{2}, xb^{2}, zb^{2}, xzb^{2}}

are three disjoint subgroups of Q_{0.123}. Their respective identities

e, z^{2}, b^{2}

are the three idempotents of Q_{0.123}. The semigroup multiplication for elements within each of the subgroups D_{1}, D_{3}, and D_{5} follows that of Z_{2} × Z_{2}, which in turn is just the same as that of the misere Nim positions

{∗2 + ∗2, ∗1, ∗2, ∗3}

with respective genera

{0^{02}, 1^{13}, 2^{20}, 3^{30}}.

We call D_{1}, D_{3} and D_{5} the tame islands of Q_{0.123}.

8.3 Decomposition of a commutative semigroup

The type of commutative semigroup decomposition carried out in the previous section was first completely described in 1954 by Tamura and Kimura [TK]. To describe their result, we need one more definition:

A semigroup S is archimedean if for any two elements of S, each divides some power of the other.

Here is the result of Tamura and Kimura (see also [CP], its Section 4.3, pg 135):

Theorem Any commutative semigroup S is uniquely expressible as a semilattice Y of archimedean semigroups S_{α}. The semigroup S can be embedded in a semigroup T which is a union of groups if and only if S is separative, and this is so if and only if each S_{α} is cancellative. The semigroup T can be taken to be the union of the same semilattice Y of groups G_{α}, where G_{α} is the quotient group of S_{α}, for each α.

We needn’t concern ourselves too much with the theorem of Tamura and Kimura, except to the extent that it informs us of the most general structure conceivable for a misere game’s quotient. Our interests lie in computing quotient semigroup presentations for particular games, casting their solutions in the form of periodic pretending functions. In the general case, this may be difficult—just as it is in many normal play games. Nevertheless, many weapons at hand in normal play have their natural analogues in misere play. The remainder of this paper is therefore devoted to computational aspects of quotient semigroup construction.

9. Proving quotients correct

In 1955, Guy and Smith proved a result about normal play octal games ([WWI], Chapter 4) that they stated as follows:

Theorem [[GS], pg 516]: If a game Γ is defined by a finite octal, having P places after the point, and if we can empirically find positive integers p and r_{0} such that the equation

G(r + p) = G(r)

is true for all r in the range r_{0} ≤ r < 2r_{0} + p + P, then it is true for all r ≥ r_{0}, so that G-function has ultimate period p.

Our goal in this section is prove an analogue of the Guy & Smith result for misere play. Roughly speaking, this involves replacing the normal-play single-heap nim equivalence function G() by an appropriate periodic pretending function Φ(), and replacing the notion of normal play P-positions corresponding to positions of nim equivalent ∗0 with an appropriate outcome partition of Q(Γ).

9.1 Correctness to heap size n

Fix a positive integer n and heap alphabet H_{n} = {h_{1}, h_{2}, …, h_{n}}. We first consider the problem of verifying that an asserted finite and explicit misere quotient semigroup Q(Γ), pretending function Φ, and outcome partition are correct to heap size n in the sense that they together correctly describe all P- and N-positions of the misere play of a game Γ, provided no heap is larger than size n.

Here’s the necessary machinery.

9.1.1 Move pairs

Suppose

h_{f} → t  (2)

is a concrete move of Γ that involves replacing the single heap of size f ≤ n with various other smaller heaps represented by the element t ∈ F_{H_{n}}, according to the rules. The given pretending function Φ determines a pair of corresponding semigroup elements (s_{f}, s) in the obvious way: on the left-hand side of (2), s_{f} is just the pretending function image of the heap h_{f}; on the right-hand side, we multiply the images of the various heaps h_{i} occuring in t together to obtain s. Each (s_{f}, s) ∈ Q × Q that can be formed in this way will be called a move pair to heap size n.

The set of M_{n} of all move pairs to heap size n can be thought of as a relation on Q, but we’re not expecting it to be a reflexive or symmetric relation, since each pair is derived from a move in the game, and these each have a “direction.”

Lemma The set M_{n} of all move pairs to heap size n is finite.

Proof. As there are only finitely many moves to heap size n, the result is immediate. □

9.1.2 Move pair translates

What want to do with M_{n} is extend it to all pairs of the form

(u · s_{f}, u · s),

where u is an arbitrary element of Q. This is the set T_{n} of all move pair translates to heap size n

T_{n} = ⋃ ; {u ∈ Q \atop (s_{f}, s) ∈ M_{n}}(u · s_{f}, u · s),

where f is allowed to range freely 1 ≤ f ≤ n. We sometimes call the quotient semigroup element u the basis of a translate.

Lemma The set T_{n} of all move translates is a finite relation on Q.

Proof Since there are only finitely many elements in Q by assumption, the result is immediate. □

9.1.3 Verification algorithms

Now let’s consider what we need to do in order to prove that an analysis is correct to heap size n. An induction argument needs two subpieces to be successful:

1. Show that there is no move from a concrete position asserted to be P to another P position.

2. Show that every non-endgame position asserted to be N has some move to a P position.

We can dispense with the first case by computing all the move pair translates to heap size n, and seeing whether there is any translate of the form

(P position, P position).

Confirming that there is no such translate already completes the first half the inductive argument. An example computation of this type is carried out in Section 9.2.1, below.

For the second half, we want to make sure that we can always find a move from every non-endgame position asserted to be an N-position to some P -position. This is more complicated. In the algorithm to be described, each N-position type ω in the given outcome partition of Q is considered separately. Roughly speaking, the desired algorithm works by examining of the “fine structure” of move pair translates of the form (ω, P), restricted to each subset U of H_{n}.

In order to be precise, we need some more definitions and notation.

For a given nonempty set U with U ⊆ H_{n}, we define

B(U) = {p ∈ F_{U} | ∀ h_{i} ∈ U, the heap h_{i} occurs at least once in p}.

There are 2^{n} − 1 such sets B(U), and together they form a partition of the infinite set F_{H_{n}} into a finite number of parts. We also define a symbol for the product of the elements of U:

P (U) = ∏_{h_{i}∈U} h_{i}.

If h_{i} ∈ U, we define an operator ∂/∂h_{i} acting on positions p ∈ B(U) by

\frac{∂}{∂h_{i}} p = p̂,

where p̂ = p/h_{i}, ie, p̂ is the position obtained by deleting one heap of size i from p. It follows that for p ∈ B(U) and each h_{i} ∈ U,

p = h_{i} \frac{∂}{∂h_{i}} p.

A general element p ∈ B(U) can always be written (up to the ordering of factors) in the form

p = r ∏_{h_{i}∈U} h_{i} = r · P (U)  (3)

for a unique value r ∈ F_{H_{n}}. (It may be that r = Λ = 1 is the empty position, i.e., the endgame). In fact, if U is the set of heaps of sizes {i_{1}, ⋯, i_{k}}, then

r = \frac{∂}{∂h_{i_{1}}} \frac{∂}{∂h_{i_{2}}} ⋯ \frac{∂}{∂h_{i_{k}}} p.

A general legal move from a position p ∈ B(U) is of the form

h_{i} → t,  (4)

where h_{i} ∈ U and the allowable values t ∈ F_{H_{n}} are determined by the rules Γ. Define a corresponding subset M_{n}(U) ⊆ M_{n} of move pairs of Γ

M_{n}(U) = { (Φ(h_{i}), Φ(t)) | h_{i} ∈ U, and h_{i} → t is a legal move in the play of Γ}. (5)

Let S(U) be the subsemigroup of Q generated by the identity e of Q and all the Φ(h_{i})’s for h_{i} ∈ U. We’re going to be interested in a set of move pair translates T_{n}(U) ⊆ T_{n} obtained from the set described in equation (5)

T_{n}(U) = { (s · Φ(h_{i}), s · Φ(t)) | (Φ(h_{i}), Φ(t)) ∈ M_{n}(U), and s ∈ S(U)}.

Finally, abusing our notation slightly for notational convenience, for a nonempty U ⊆ H_{n}, we define

Φ(U) = ∏_{h_{i}∈U} Φ(h_{i}) = Φ(P (U)),

and define Φ(U) = 1 if U is empty.

We’re ready to prove the following theorem.

Theorem 2. Suppose ω ∈ Q is asserted to be an N-position type. The following are equivalent.

1. Every non-endgame position p ∈ F_{H_{n}} asserted to be of type ω has a move to a P-position.

2. For every choice of a nonempty subset U ⊆ H_{n} and quotient semigroup element s ∈ S(U) such that the equation

ω = s · Φ(U)  (6)

is satisfied, there is some heap h_{i} ∈ U and legal move of Γ

h_{i} → t

such that

(s · Φ(U) , s · Φ(t) · Φ(\frac{∂}{∂h_{i}} P (U))  (7)

is a move pair translate of the form

(ω, P -position).

Proof. (1) ⇒ (2). Let U = {h_{i_{1}}, ⋯, h_{i_{k}}} and s ∈ S(U) be an arbitrary solution of equation (6) for some k ≥ 1. By definition we can write

s = ∏_{1≤j≤k} Φ(h_{i_{j}})^{ν_{j}}

for some appropriate powers ν_{j} ≥ 0. Forming a position p ∈ F_{H_{n}} as the product

p = ( ∏_{1≤j≤k} h_{i_{j}}^{ν_{j}}) ( ∏_{1≤j≤k} h_{i_{j}}) ,  (8)

we have Φ(p) = s · Φ(U) = ω. If p is not the endgame, by assumption there is a winning move

h_{i_{j}} → t,  (9)

and we observe that this move can be made in the second half of the product on the right hand side of (8). The resulting P -position q is of the form

q = ( ∏_{1≤j≤k} h_{i_{j}}^{ν_{j}}) (\frac{∂}{∂h_{i_{j}}} ∏_{1≤j≤k} h_{i_{j}}) t.  (10)

In particular, (Φ(h_{i_{j}}), Φ(t)) is a move pair to heap size n, and translating that move pair by the basis

b = s · Φ(\frac{∂}{∂h_{i}} P (U))

yields a move pair translate

(s · Φ(U) , s · Φ(t) · Φ(\frac{∂}{∂h_{i}} P (U))

of the form (ω, P -position),

as desired.

(2) ⇒ (1). The converse is similar. Suppose p ∈ F_{H_{n}} is a non-endgame position of type ω. Let

U = {h_{i} | h_{i} occurs at least once as a heap in p}.

Then p can be written in the form of equation (3) for a unique r ∈ F_{H_{n}}, and applying the pretending function Φ to both sides of equation (3), we obtain equation (6), where s = Φ(r). The hypothesis applies, so there is a legal winning move to a P position

h_{i} → t

such that applying that move to p leads to a position q of the form in equation (10) with corresponding move translate of the form in equation (7). So p has a move to a P -position, as desired. □

Relying upon Theorem 2, we can now describe a brute-force algorithm for verifying that every non-endgame position asserted to be an N position has some move to a P position, to heap size n. Simply put, each N position type ω is considered separately, and must pass the test given in the second half of the statement of Theorem 2. Since (i) the number 2^{n} of subsets U to be considered is finite; and (ii) there’s only a finite number of moves to heap size n; and finally, (iii) there are only a finite number of choices for values s, since they’re taken from various subsemigroups of the proposed quotient semigroup Q, which required to be finite by assumption, we can exhaust all possible ways of forming equation (6). If the desired translates exist for every value of ω, U, s, and move h_{i} → t meeting the conditions stated in Theorem 2, the verification succeeds; otherwise, it fails.

An illustration computation of the type described in Theorem 2 is carried out in Section 9.2.2, below.

9.1.4 Complexity

The algorithm given at the beginning of Section 9.1.3 for verifying that no P → P moves exist to heap size n is a polynomial-time computation in its natural parameters n and |Q|. By contrast, the complexity of the verification algorithm we’ve given for N → P moves is exponential in n, since it involves considering all subsets U ⊆ H_{n}. In practice, the latter algorithm can be sped up dramatically by exploiting available information about the values present in the proposed pretending function Φ and the structure of the quotient semigroup Q. For example, the N → P verification algorithm to heap size n as presented in this paper ignores all information that may be already available about the correctness of the proposed quotient to heap size n − 1. A more complete discussion of such improvements, which involve a combination of semigroup theory, data-structure organization, and heuristics, would take us too far afield from the goals of this paper.

Closely related to the problem of N → P move verification is the important problem of misere quotient semigroup construction. This is another rich subject with many points of contact with semigroup structure theory and algorithm design, but it is not treated in this paper.

9.2 Correctness of the 0.123 quotient to heap size 12

Let’s illustrate how the two verification computations work in the specific case of 0.123, to heap size 12. It less than one second to run both verification procedures in GAP [GAP], a computer algebra package.

9.2.1 No P → P moves exist to heap size 12

We include in Figure 13 a portion of an automatically generated proof that there’s “no move from a position asserted to P to a P position” to heap size 12 in 0.123.

Recall that the positions asserted to be P are the semigroup elements

P = {x, xa, z^{2}, zb, b^{2}}.

If there were a move from a position asserted to P to a P position, there would be a translate (u · s_{f}, u · s) of the form (P-position, P-position).

Figure 12 lists all moves to heap size twelve, and the associated translates in the particular subcase where the basis of the translate sets is the semigroup element x. Since there is no translate of the form (P, P), we are done. The computation for the other 19 basis elements in the semigroup is similar.

9.2.2 N → P moves must exist, to heap size 12

In this section, we illustrate how to verify that a position asserted to be N must have a move to a P position, again using 0.123 as our example. Because the algorithm we’ve presented in Section 9.1.3 involves considering each of the 2^{12} − 1 = 4095 nonempty subsets U of H_{12} in turn, we must satisfy ourselves by showing only a small portion of the computation.

Take, for example, the semigroup element ω = xb, which is asserted be an N position in 0.123. Theorem 2 informs us that we’re going to be interested in move translates of the form

(xb, P -position).

Move     Move Pair Translated by x       Outcomes
1->0             (e,x)                    (N,P)
3->0             (x*z,x)                  (N,P)
3->1             (x*z,e)                  (N,N)
4->1             (x*z,e)                  (N,N)
4->2             (x*z,x)                  (N,P)
5->2             (e,x)                    (N,P)
5->3             (e,x*z)                  (N,N)
6->3             (x*b^2,x*z)              (N,N)
6->4             (x*b^2,x*z)              (N,N)
7->4             (x,x*z)                  (P,N)
7->5             (x,e)                    (P,N)
8->5             (x*a,e)                  (P,N)
8->6             (x*a,x*b^2)              (P,N)
9->6             (x*b,x*b^2)              (N,N)
9->7             (x*b,x)                  (N,P)
10->7            (e,x)                    (N,P)
10->8            (e,x*a)                  (N,P)
11->8            (x*b^2,x*a)              (N,P)
11->9            (x*b^2,x*b)              (N,N)
12->9            (x,x*b)                  (P,N)
12->10           (x,e)                    (P,N)

Figure 13: Verification that there is no P → P translate to heap size 12 in 0.123 in the particular case that the basis is equal to x.

All such move translates are shown in the first column of Figure 14. Each is listed together with the basis element u, concrete move, and move pair that generates it.

To illustrate the main features of the verification computation for positions of type ω = xb, we’ll show operation of the algorithm on the fifteen nonempty subsets U of {h_{4}, h_{8}, h_{9}, h_{10}}.

Figure 15 shows the subsemigroups S(U) for each choice of U. Figure 16 shows all solutions to the equation ω = xb = s · Φ(U) in Q_{0.123}. Intersecting each set in the second column of Figure 15 with the corresponding set in third column of Figure 16, we obtain the solution pairs s, U for equation (6) in Theorem 2. There are six cases of interest, and they’re shown using boxes in Figure 15 and Figure 16. Figure 17 shows the necessary winning move required by Theorem 2, for each of the six cases.

The verification computations for the other fourteen N-position types in 0.123 are similar.

Move

Translate Basis u Move Move pair
(xb, x)  x  9 → 7  (b, e)
(xb, zb)  b  5 → 3  (x, z)
(xb, zb)  b  10 → 8  (x, a)
(xb, zb)  xzb  3 → 1  (z, x)
(xb, zb)  xzb  8 → 5  (a, x)
(xb, zb)  xzb  4 → 1  (z, x)

Figure 14: The translates of the form (xb, P-position) for 0.123 with no heap larger than size 12.

10. Generalizing Guy and Smith to misere play

Having dispensed with correctness to heap size n, we’re ready to generalize the theorem of Guy and Smith to misere play.

Theorem 3 Suppose a misere impartial game Γ is defined by a finite octal, having P places after the point. If we can empirically find a misere quotient semigroup Q, associated outcome partition Q = P ⋃ N, pretending function Φ, and positive integers p and r_{0} such that the equation

Φ(h_{r+p}) = Φ(h_{r})

holds and the analysis is correct to heap size r for all r in the range r_{0} ≤ r < 2r_{0} + p + P, then it is also correct to heap size r for all r ≥ r_{0}, so that the Φ-function has ultimate period p.

Proof. Because the verification algorithms described in the previous section depend only upon move translates and the images of the pretending function on single heap positions, it suffices to show that the move translates T_{r+p} to heap size r + p are identical to the move translates T_{r}, i.e.,

T_{r+p} = T_{r}

for all r ≥ 2r_{0} + p + P. For this, the original proof of Guy and Smith for normal play carries over with only minor modifications. We shamelessly duplicate their language and notation in what follows.

Suppose that the given periodicity relationship has been shown to be correct to heap size r for r_{0} ≤ r < r_{1}, where r_{1} ≥ 2r_{0} + p + P. We want to show it is also true for r = r_{1}. Let h_{r_{1}+p} → h_{s′}h_{t′} be a typical move from the heap of size h_{r_{1}+p} involving removing c beans from the heap. Then

(Φ(h_{r_{1}+p}), Φ(h_{s′})Φ(h_{t′}))

is a typical move pair and

(uΦ(h_{r_{1}+p}), uΦ(h_{s′})Φ(h_{t′}))

U  S(U)
{h_{4}}  {1, z, z^{2}, z^{3}}
{h_{8}}  {1, a}
{h_{9}}  {1, b, b^{2}, xb^{2}}
{h_{10}}  {1, x}
{h_{4}, h_{8}}  {1, z, a, z^{2}, az, z^{3}}
{h_{4}, h_{9}}  {1, z, b, z^{2}, bz, b^{2}, z^{3}, b^{2}z, xb^{2}, b^{2}xz}
{h_{4}, h_{10}}  {1, z, x, z^{2}, xz, z^{3}, xz^{2}, xz^{3}}
{h_{8}, h_{9}}  {1, a, b, bz, b^{2}, b^{2}z, b^{2}x, b^{2}xz}
{h_{8}, h_{10}}  {1, x, a, ax}
{h_{9}, h_{10}}  { 1 , b, x, b^{2}, bx, b^{2}x}
{h_{4}, h_{8}, h_{9}}  {1, z, a, b, z^{2}, az, bz, b^{2}, z^{3}, b^{2}z, b^{2}x, b^{2}xz}
{h_{4}, h_{8}, h_{10}}  {1, z, a, x, z^{2}, az, xz, ax, z^{3}, xz^{2}, axz, xz^{3}}
{h_{4}, h_{9}, h_{10}} {1, z , b, x, z^{2}, bz, xz, b^{2}, bx, z^{3}, xz^{2}, b^{2}z, bxz, b^{2}x, xz^{3}, b^{2}xz}
{h_{8}, h_{9}, h_{10}}  {1, b, a , x, b^{2}, bz, bx, ax, b^{2}x, b^{2}z, bxz, b^{2}xz}
{h_{4}, h_{8}, h_{9}, h_{10}}  { 1 , a, b, x, z, bz, ax, az , b^{2}, bx, xz, z^{2} ,
b^{2}z, bxz, axz, z^{3}, b^{2}x, xz^{2}, b^{2}xz, xz^{3}}

Figure 15: Subsemigroups S(U) of Q_{0.123} for various choices of subsets U ⊆ H_{12}. Boxed elements s additionally satisfy the equation ω = xb = s · Φ(U) (see equation (6) in Theorem 2, and also Figure 16).

is a typical move translate with u ∈ Q arbitrary. Then

c + s′ + t′ = r_{1} + p,

and c ≤ P, and we can suppose s′ ≤ t′ so that

P + t′ + t′ ≥ r_{1} + p ≥ 2r_{0} + 2p + P,

so that

t′ − p ≥ r_{0} ≥ 0,

and therefore Φ(h_{t′−p}) = Φ(h_{t′}) by the inductive hypothesis. But there is also a permissible move h_{r_{1}} → h_{s′}h_{t′−p} so we see that

(uΦ(h_{r_{1}+p}), uΦ(h_{s′})Φ(h_{t′})) = (uΦ(h_{r_{1}}), uΦ(h_{s′})Φ(h_{t′−p}))

are identical move translates. We’ve shown that T_{r} ⊆ T_{r+p}. A similar argument shows that T_{r+p} ⊆ T_{r}. So T_{r} = T_{r+p} and the verification algorithms of the previous section will succeed. □

11. Canonical forms and genera vs misere quotients

In this section, we contrast the quotient semigroup approach to 0.123 to two traditional approaches to misere games: canonical forms and genus values.

Values s ∈ Q_{0.123}
U  Φ(U) with xb = s · Φ(U)
{h_{4}}  z  {bxz}
{h_{8}}  a  {bxz}
{h_{9}}  b  {x, xz^{2}, axz}
{h_{10}}  x  {b}
{h_{4}, h_{8}}  za  {bx}
{h_{4}, h_{9}}  zb  {xz, ax, xz^{3}}
{h_{4}, h_{10}}  zx  {bz}
{h_{8}, h_{9}}  zb  {xz, ax, xz^{3}}
{h_{8}, h_{10}}  ax  {bz}
{h_{9}, h_{10}}  bx  { 1 , z^{2}, az}
{h_{4}, h_{8}, h_{9}}  b  {x, xz^{2}, axz}
{h_{4}, h_{8}, h_{10}}  zax  {b}
{h_{4}, h_{9}, h_{10}}  bxz  { z , a}
{h_{8}, h_{9}, h_{10}}  bxz  {z, a }
{h_{4}, h_{8}, h_{9}, h_{10}} bx  { 1 , z^{2} , az }

Figure 16: Values Φ(U) and all solutions of the equation xb = s · Φ(U) in Q_{0.123} for various choices of subsets U ⊆ H_{12}. Boxed elements are additionally members of S(U); see Figure 15.

11.1 Misere canonical forms

In normal play, the Sprague-Grundy theory describes how to determine the outcome of a sum G + H of two games G and H by computing canonical forms for each summand— these turn out to be nim-heap equivalents. We then can imagine that we’re playing Nim on each summand G and H instead, and can use nim addition to determine the outcome of the sum G+H. At the center of the Sprague-Grundy theory is the equation G+G = 0, which always holds for an arbitrary normal play combinatorial game G.

In misere play, canonical forms can be computed also, but the resulting positions are not nim-heaps in general. Instead, the canonical form of a typical misere game looks like a complicated tree of options (see [ONAG], for example, in its chapter 12, “How to Lose when you Must;” or [WWII], its chapter 13, “Survival in the Lost World.”) Figure 20 illustrates such a tree. The rules for the reduction of a general misere game to its canonical form game tree are also described in [ONAG] and [WWII]. Nevertheless, the canonical form viewpoint on misere play does not turn out to be so useful in solving wild misere games. In this section we would like to shed some light on why this is the case.

Consider the misdeeds of ∗2, the humble nim heap of size 2. In normal play, we always have the equation

∗2 + ∗2 = ∗0 = 0.

\begin{matrix}U & s & Φ(U) & h_{i} & h_{i} → t & s · Φ(U) & s · Φ(t) · Φ(\frac{∂}{∂h_{i}} P (U)) \\ \{h_{9}, h_{10}\} & 1 & bx & h_{10} & h_{10} → h_{8} & bx & 1 · a · b = ab = zb \\ \{h_{4}, h_{9}, h_{10}\} & z & bxz & h_{4} & h_{4} → h_{1} & bx & z · x · bx = zb \\ \{h_{8}, h_{9}, h_{10}\} & a & bxz & h_{8} & h_{8} → h_{5} & bx & a · x · bx = ab = zb \\ \{h_{4}, h_{8}, h_{9}, h_{10}\} & 1 & bx & h_{4} & h_{4} → h_{1} & bx & 1 · x · bxz = zb \\ \{h_{4}, h_{8}, h_{9}, h_{10}\} & z^{2} & bx & h_{4} & h_{4} → h_{1} & bx & z^{2} · x · bxz = bz^{3} = zb \\ \{h_{4}, h_{8}, h_{9}, h_{10}\} & az & bx & h_{4} & h_{4} → h_{1} & bx & az · x · bxz = a^{2}x^{2}ab = zb \end{matrix}

Figure 17: Verification of some winning moves for positions of type ω = xb, as required by Theorem 2. In each row, the final two columns together form a move translate (w, P -position) (cf equation (7) and Figure 14).

But in misere play of Nim,

∗2 + ∗2 ≠ 0.

The left-hand side is a P position, and the right-hand side, an N position.

It is true in misere Nim that

(∗2 + ∗2 + ∗2) ρ ∗ 2,

ie, these two sums are indistinguishable in misere Nim. So we can think of

∗2 + ∗2 + ∗2 ↦ ∗2,

as a valid outcome-preserving simplication rule in misere Nim. The same indistinguishability relation holds even in a general sum of tame misere games. But this doesn’t change the fact that

∗2 + ∗2 + ∗2 ≠ ∗2,

since the misere canonical forms of ∗2 + ∗2 + ∗2 and ∗2 are not identical.

It gets worse. When we move beyond tame games to wild misere games such as 0.123, we may find that only a weaker indistinguishability relation such as

(∗2 + ∗2 + ∗2 + ∗2) ρ (∗2 + ∗2)  (11)

is valid. Such facts are far from obvious or easily proved when one is working in the context of canonical forms. And for other games—such as 4.7—there is provably no pair of integers m > n such that

\underbrace{∗2 + ⋯ + ∗2}_{m copies} ↦ \underbrace{∗2 + ⋯ + ∗2}_{n copies}

is an outcome-preserving simplification rule [P1].

So—even the relatively unassuming game ∗2 is an extremely changeable animal whose behaviour in sums very much depends on the “local context” of the rules of the game under analysis. More complicated misere games often have even worse behavior, and involve extremely complicated canonical forms. Calculating them explicitly tends to exhaust a computer’s memory rapidly. By instead restricting our attention to a particular game’s position sums and concentrating on its quotient rather than its canonical forms, it becomes possible to uncover locally valid simplication rules such as equation (11), and make progress analyzing wild misere games.

11.2 Genera in 0.123

Let the symbol h_{n} stand for the heap of size n in 0.123. The canonical form game trees for h_{6} and h_{11} are shown in Figures 18 and 19. It’s apparent that these trees are not isomorphic—they represent different canonical forms. If two canonical forms are different, there has to be a game T in the global semigroup of all impartial misere combinatorial games that distinguishes between them [ONAG]. But exactly what game T would distinguish between them? Such a T cannot be a position of 0.123—if it were, our identification of these two heaps with the semigroup element b^{2} (implicit in Figure 3) would be invalid.

[figure]
Figure 18: The heap h_{6} in 0.123 is 2_{+} = {2}, a game of genus 0^{02}.

[figure]

Figure 19: The heap h_{11} in 0.123, also of genus 0^{02}.

So what does such a game T look like? One game—obtained via computer search— that distinguishes between h_{6} and h_{11} is

T = {2_{+}3, 2_{+}20, 3, 1},

a game of genus 0^{20}. The game T is illustrated in Figure 20. We have

genus(h_{6} + T) = 0^{20}, while
genus(h_{11} + T) = 0^{0520}.

[figure]

Figure 20: The non-0.123 position T = {2_{+}3, 2_{+}20, 3, 1} distinguishes between the 0.123 positions h_{6} and h_{11} in the global semigroup of all impartial misere combinatorial games. But since T never occurs as a position of 0.123, the existence of such a T is not relevant to the best play of 0.123.

In particular, the sum h_{6} + T is a misere N-position, while h_{11} + T is a P-position. However, the existence of such a T is not relevant to the best play of 0.123, for the simple reason that it never occurs in 0.123!

By way of contrast, consider h_{3} +h_{3}, a third position of genus 0^{02} in 0.123. Unlike h_{6} and h_{11}, the position h_{3} + h_{3} is of type z^{2} in 0.123. And indeed the position h_{3} + h_{3} can be distinguished from both h_{6} and h_{11} in 0.123. For example, S = h_{5} + h_{9}, a position of type bx, distinguishes between h_{6} and h_{3} + h_{3}:

genus(h_{6} + S) = 0^{02}, while
genus(h_{3} + h_{3} + S) = 0^{31}.

The former is a misere P-position, while the latter is an N-position.

We conclude that positions that have the same genus symbol may or may not be equivalent in the misere quotient semigroup.

11.3 Summary

Loosely recapitulating the previous two sections, we might say this:

When we’re trying to analyze the misere positions of a game Γ with fixed rules, canonical forms can make positions that are really the same in Q(Γ) look different, while genus computations can make positions that are really different in Q(Γ) look the same. Only the quotient semigroup Q(Γ) precisely captures such nuances.

11.4 The Sibert-Conway solution to 0.77 (Misere Kayles)

The solution to misere Kayles was discovered by William Sibert. His original description of it appears in the interesting unpublished manuscript [Si]. See also the paper by Sibert and Conway [SC], and the second edition of Winning Ways [WWII] (at the end of Volume II). In this section we summarize the solution as presented in the paper by Sibert and Conway; in the following one, we give the corresponding misere quotient.

The PN-positions of Kayles (ie, the positions that a P positions in normal play, but N positions in misere play) are precisely the positions

E(5) E(4, 1),
E(17, 12, 9) E(20, 4, 1), or
25 E(17, 12, 9) D(20, 4, 1).

The NP-positions (N normal, P misere) are of the form

D(5) D(4, 1),
E(5) D(4, 1),
D(9) E(4, 1),
12 E(4, 1),
E(17, 12, 9) D(20, 4, 1), or
25 D(9) D(4, 1).

The notation E(a, b, …) (resp. D(a, b, …)) refers to any position composed by taking an even (resp., odd) number of heaps of size a or b or . . .. For example,

5 + 4 + 1 + 1

is a position included in the set

D(5) D(4, 1)

since it is composed by taking a single (ie, odd number) heap of size 5 and the total number of 4’s or 1’s (ie, three) is also odd.

For every other position in misere Kayles not listed in the PN- and NP-positions above, its misere and normal play outcomes agree.

1 2  3  4  5  6 7 8  9 10 11 12
0+ 1^{031} 2^{20} 3^{31} 1^{031} 4^{146} 3^{31} 2^{20} 1^{13} 4^{046} 2^{20} 6^{46} 4^{046}
12+ 1^{13} 2^{20} 7^{57} 1^{13} 4^{64} 3^{31} 2^{20} 1^{031} 4^{64} 6^{46} 7^{57} 4^{64}
24+ 1^{731} 2^{20} 8^{8[10]} 5^{75} 4^{64} 7^{57} 2^{20} 1^{13} …

Figure 21: Genera for 0.77 11.5 The Kayles misere quotient

A presentation of the Kayles misere quotient Q_{0.77} can be written down using seven generators

{x, z, w, v, t, f, g},

which first appear in its pretending function at the respective heap sizes

{1, 2, 5, 9, 12, 25, 27}.

Let the symbol e represent the identity of Q_{0.77}. The generators satisfy the relations

x^{2} = e, z^{3} = z, w^{3} = w, v^{3} = v,
t^{4} = t^{2}, f^{4} = f^{2}, g^{3} = g.

If Q_{0.77} were isomorphic to the direct product of these seven generators, it would be a semigroup of order 2 × 3 × 3 × 3 × 4 × 4 × 3 = 864. However, many indistinguishability relations hold between monomials in the generators. The actual Kayles quotient is a semigroup of order only 40. Its elements are shown in Figure 22. We can contrast this with the normal play quotient, which is a group of order 16.

\begin{matrix}e & x & z & w & v \\ t & f & g & xz & xw \\ xv & xt & xf & xg & z^{2} \\ zw & zg & w^{2} & wf & wg \\ v^{2} & vt & vf & tf & xz^{2} \\ xzw & xzg & xw^{2} & xwf & xwg \\ xv^{2} & xvt & xvf & xtf & zwg \\ v^{2}t & vtf & xzwg & xv^{2}t & xvtf \end{matrix}

Figure 22: The forty elements of the Kayles misere quotient

The pretending function for misere Kayles is shown in Figure 23. Its final twelve values repeat indefinitely. For the sake of comparison, the normal play nim sequence of Kayles is shown in Figure 24. It also has period twelve.

The multiplication in Q_{0.77} is given by the Knuth-Bendix rewriting system shown in Figure 25. It was calculated using the computer algebra package GAP4 [GAP].

The semigroup Q_{0.77} has nine pairwise distinguishable P-position types

{x, v, t, z^{2}, xw, xw^{2}, xv^{2}, xvt, xvf}

1 2 3  4  5  6 7 8  9 10 11 12
0+ x z xz  x  w xz z xz^{2} v z zw t
12+ xz^{2} z zwx xz^{2} v^{2}t xz z xvt wz^{2} zw zwx wz^{2}
24+ f z g xwz^{2} wz^{2} zwx z xz^{2} g zw zwx wz^{2}
36+ xz^{2} z xz xz^{2} wz^{2} zwx z xz^{2} g z zwx wz^{2}
48+ xz^{2} z g  xz^{2} wz^{2} zwx z xz^{2} wz^{2} z zwx wz^{2}
60+ xz^{2} z g  xz^{2} wz^{2} zwx z xz^{2} g zw zwx wz^{2}
72+ xz^{2} z g  xz^{2} wz^{2} zwx z xz^{2} g z zwx wz^{2}
84+ xz^{2} z g  xz^{2} wz^{2} zwx z xz^{2} g z zwx wz^{2}
96+ …

Figure 23: The pretending function of misere Kayles.

1 2 3 4 5 6 7 8 9 10 11 12
0+ 1 2 3 1 4 3 2 1 4 2 6 4
12+ 1 2 7 1 4 3 2 1 4 6 7 4
24+ 1 2 8 5 4 7 2 1 8 6 7 4
36+ 1 2 3 1 4 7 2 1 8 2 7 4
48+ 1 2 8 1 4 7 2 1 4 2 7 4
60+ 1 2 8 1 4 7 2 1 8 6 7 4
72+ 1 2 8 1 4 7 2 1 8 2 7 4
84+ 1 2 8 1 4 7 2 1 8 2 7 4
96+ …

Figure 24: The nim sequence of normal play Kayles.

Rewriting System for Semigroup( [ e, x, z, w, v, t, f, g ] ) with rules
[ [ x^2, e ], [ z*v, z*w ], [ z*t, z*w ], [ w*t, z^2 ],
[ v*w, z^2 ], [ t^2, v*t ], [ f^2, z^2 ], [ f*g, x*g ],
[ v*g, w*g ], [ t*g, w*g ], [ g^2, z^2 ], [ z^3, z ],
[ z*w^2, z ], [ w^3, w ],   [ v^3, v ],   [ v^2*f, f ],
[ z^2*g, g ], [ w^2*g, g ], [ z*f, x*z ], [ z^2*w, x*w*f ],
[ w^2*f, x*z^2 ] ]

Figure 25: A Knuth-Bendix rewriting system for misere Kayles (0.77).

[figure: z^{2}; vt; v^{2}; w^{2}; e]

Figure 26: The natural partial ordering of the five idempotents of the misere Kayles (0.77) quotient.

I(e) = {e, x}
I(w^{2}) = {w^{2}, w, wx, w^{2}x}
I(v^{2}) = {v^{2}, v, vx, v^{2}x}
I(vt) = {vt, v^{2}t, xvt, xv^{2}t}
I(z^{2}) = See Figure 28.

Figure 27: The five maximal subgroups I() of Q_{0.77}. Each subgroup includes precisely those elements that both divide and are divisible by an idempotent element that acts as that subgroup’s identity.

and five idempotents

{e, z^{2}, w^{2}, v^{2}, vt}.

Figure 27 and Figure 28 together identify the five maximal subgroups of Q_{0.77}. There is a maximal subgroup corresponding to each idempotent (recall Section 8.2, above).

The natural partial ordering of idempotents is shown in Figure 26.

The maximal subgroup I(z^{2}) is isomorphic to the normal play 0.77 quotient. Figure 28 shows this correspondence.

\begin{matrix}∗0 & ∗1 & ∗2 & ∗3 & ∗4 & ∗5 & ∗6 & ∗7 \\ z^{2} & xz^{2} & z & xz & xwf & wf & wz & wxz \end{matrix}

\begin{matrix}∗8 & ∗9 & ∗10 & ∗11 & ∗12 & ∗13 & ∗14 & ∗15 \\ g & gx & gz & gxz & gw & gwx & gwz & gwxz \end{matrix}

Figure 28: The maximal subgroup I(z^{2}) of the Kayles misere quotient semigroup Q_{0.77} includes precisely those elements that both divide and are divisible by the idempotent element z^{2}. The sixteen elements of I(z^{2}) form a subgroup of the semigroup Q_{0.77} that is isomorphic to the Kayles normal play quotient Z_{2} × Z_{2} × Z_{2} × Z_{2}.

12. Other games and discussion

The techniques described in this paper yield complete analyses for many previously unsolved wild octal games; in subsequent work we hope to provide a census of such results. Some examples are available now at the web site [P]. Even where the semigroup techniques fail to yield a complete analysis, the author has observed them to be a powerful tool in extending the analysis of impartial games in misere play. For each of the many complete analyses of normal play impartial games in the literature, the corresponding misere quotient calls out to be discovered.

Commutative semigroup theory is a rich area of mathematical research, and much of it is directly applicable in misere play analyses. It seems quite likely that much more can be said in answer to question asked in [WWII] (pg 451):

Are misere analyses really so difficult?

Acknowledgement

I thank Aaron Siegel and Dan Hoey for drawing my attention to errors in Section 11.5 of the first draft of this manuscript.

References

[A1] D. T. Allemang, “Machine Computation with Finite Games,” MSc Thesis,

           Trinity College (Cambridge), 1984. http://www.plambeck.org/oldhtml/mathematics
           /games/misere/allemang.

[A2] D. T. Allemang, “Solving misere games quickly without search,” unpublished research (2002).

[A3] D. T. Allemang, “Generalized genus sequences for misere octal games,” International Journal of Game Theory 30 (2002) 4, 539-556.

[AKS] I. M. Araújo, A. V. Kelarev, and A. Solomon, “Effective Identification of Commutative Semigroup Algebras which are Principal Ideal Rings with Identity,” Comm. Algebra, 32:4

(2004) 1237-1254. http://www.illywhacker.net/papers/araujo.pdf

[BN] Franz Baader and Tobias Nipkow, Term Rewriting and All That, Cambridge Univ Press, 1998.

[Bou] Charles L. Bouton, Nim, a game with a complete mathematical theory, Ann. Math., Princeton (2), 3 (1901-02) 35-39.

[CP] A. H. Clifford and G. B. Preston, The Algebraic Theory of Semigroups, Vol I. American Mathematical Society, 1961.

[WWI] E. R. Berlekamp, J. H. Conway and R. K. Guy (1982) Winning Ways, Vol I-II, Academic Press, New York.

[WWII] E. R. Berlekamp, J. H. Conway and R. K. Guy (2003) Winning Ways, Vol I-IV, A. K. Peters, Ltd., Natick, Massachusetts.

[ONAG] J. H. Conway (1976) On Numbers and Games, Academic Press, New York; also AK Peters, Ltd.; 2nd edition (December 1, 2000).

[D] T. R. Dawson (1935) “Caissa’s Wild Roses,” in Five Classics of Fairy Chess, Dover Publications Inc, New York (1973).

[F] Thomas S Ferguson, “A Note on Dawson’s Chess,” unpublished research note, available at

http://www.math.ucla.edu/~tom/papers/unpublished/DawsonChess.pdf

[F2] Thomas S. Ferguson, “Misere Annihilation Games,” Journal of Combinatorial Theory, Series A 37, 205–230 (1984).

[F3] Thomas S. Ferguson, “On Sums of Graph Games with Last Player Losing,” Int. Journal of Game Theory Vol. 3, Issue 3 (1974), pg 159–167.

[Fraenkel] Aviezri S. Fraenkel, “Combinatorial Games: Selected Bibliography with a Succinct Gourmet Introduction,” in Games of no Chance (MSRI Publications, 29 1996

http://www.msri.org/publications/books/Book29/files/bibl.pdf

[GAP] The GAP Group, GAP – Groups, Algorithms, and Programming, Version 4.4 ; 2004,

http://www.gap-system.org.

[Gril] P. A. Grillet, Commutative Semigroups. Kluwer Academic Publishers, 2001. ISBN 0-7923-7067-8.

[Guy89] Richard K Guy, Fair Game: How to Play Impartial Combinatorial Games, COMAP, Inc, 60 Lowell St, Arlington, MA 02174

[GrSm56] P. M. Grundy & Cedric A. B. Smith, Disjunctive games with the last player losing, Proc. Cambridge Philos. Soc., 52 (1956) 527-533; MR 18, 546b.

[Guy91] R. K. Guy (1991), Mathematics from fun & fun from mathematics: an informal autobiographical history of combinatorial games, in: Paul Halmos: Celebrating 50 Years of Mathematics (J. H. Ewing and F. W. Gehring, eds). Springer Verlag, New York, pp. 287-295.

[GS] R. K. Guy and C. A. B. Smith (1955) “The G-values of various games,” Proc Camb. Phil. Soc. 52, 512-526.

[GN] Richard K. Guy and Richard J. Nowakowski, “Unsolved Problems in Combinatorial Games,” in More Games of No Chance, MSRI Publications, 42 2002.

http://www.msri.org/publications/books/Book42/files/guy.pdf

[KB] Donald E. Knuth and P. B. Bendix, “Simple word problems in universal algebras,” Proc. of the Conf. on Computational Problems in Abstract Algebra, Oxford 1967, John Leech (ed.), Pergamon Press, 1970.

[L] Gerard Lallement, “Semigroups and Combinatorial Applications,” Wiley Interscience 1979.

[Mal] Joseph Malkevitch, “Combinatorial Games (Part I): The World of

Piles of Stones,”  American Mathematical Society,  December 2002

           http://www.ams.org/new-in-math/cover/games1.html

[M] E. H. Moore, “A definition of abstract groups,” Trans. Amer. Math Soc. 3 (1902), 485-492.

[P] Misere Games. (Web site with many misere game solutions and more references)

           http://www.plambeck.org/oldhtml/mathematics/games/misere

[P1] T. E. Plambeck, “Daisies, Kayles, and the Sibert-Conway decomposition in misere octal games”, Theoretical Computer Science (Math Games) 96 (1992), pg 361-388.

[Rédei] L. Rédei, The theory of finitely generated commutative semigroups. Pergamon, 1965.

[R1] D. Rees, “On semi-groups,” Proc. Cambridge Phil. Soc. 36 (1940) 387-400 (MR 2, 127).

[Si] William L. Sibert, The Game of Misere Kayles: The “Safe Number” vs “Unsafe Number” Theory, unpublished manscript, October 1989.

[SC] W. L. Sibert and J. H. Conway, “Mathematical Kayles,” International Journal of Game Theory (1992) 237-246.

[TK] T. Tamura and N. Kimura, “On decompositions of a commutative semigroup,” Kodai Math. Sem. Rep. 1954 109-112 (MR 16, 670).

[Y] Yohei Yamasaki, “On misere Nim-type games,” J. Math. Soc. Japan 32 No. 3, 1980, pg 461-475.