How it was found

What Moore's rule needed that Bouton's did not

Put Grundy values where the heap sizes were and Bouton's 1901 criterion becomes the 1935 theorem. Do the same to Moore's 1910 criterion, where a move may change up to k heaps, and it becomes a theorem only for games in which no move ever raises a value. Over 127 take-away games it is exact on the 34 that never climb and wrong on all 93 that do, and the reason is one move the binary columns cannot see: a climb and a drop made together.

Assumes: The step nobody took for thirty-four years · Taking from several heaps at once

Between Bouton’s paper of 1901 and the theorem of 1935 there is exactly one step, and it has been isolated: Bouton says a Nim position is lost when its heap sizes exclusive-or to nothing, and Sprague and Grundy say a sum of any impartial games is lost when the heaps’ Grundy values do. Same operation, different quantity. The essay that isolated the step ended on a question about the other complete solution of that decade:

Replace the heap sizes in Moore’s criterion by some per-heap quantity and ask whether any assignment makes it exact on a game it was not written for … If some assignment does, then the 1910 paper was one substitution from a theory of a family of games rather than of one.

The obvious assignment is the one that worked in 1935, and the answer to it is clean. Moore’s criterion with Grundy values substituted is exact on precisely the games in which no move can raise a Grundy value, and wrong on every other game tested. The family exists. It is the family of games that behave like Nim measured in a larger unit — which is to say that 1910 was one substitution away from a theory of its own game in disguise, and of very little else.

Moore's rule, substituted, is exact where nothing climbs. Moore's 1910 criterion with each heap's Grundy value in place of its size, checked against exhaustive search on 127 take-away games. With one heap a move it is exact on all of them. With two or three heaps a move it is exact on the 34 games in which no move raises a Grundy value and wrong on every one of the 93 in which some move does.
Fig. 1 Every take-set and every any-take-but set inside one to six, 127 games, each judged by Moore’s criterion on the heaps’ Grundy values against a full search of the game. With one heap changed a move the criterion is exact everywhere. With two or three it is exact on the 34 games where no move raises a value and wrong on all 93 where some move does.

The rule, the game, and the substitution

Moore’s Nim lets a player take counters from as many as kk heaps in one move, any amount from each, at least one counter in all. Moore proved in 1910 that the player to move loses exactly when the heap sizes, written in binary and stacked, have every column summing to a multiple of k+1k + 1. At k=1k = 1 that is Bouton’s rule, since a column sum divisible by two is an even one.

To ask the substitution question the game has to be widened first, because the question is about other games. The Moore compound of some component games is played like this: a move chooses between one and kk of the components and makes a legal move in each of the chosen ones. With Nim heaps as components it is Moore’s game. With heaps of a subtraction game — take one or two counters, say — it is a game Moore never considered, and it has a perfectly good set of lost positions that a search can find.

The substituted criterion is Moore’s test with each heap’s size replaced by its Grundy value in its own game: write the values in binary, stack them, and call the position lost when every column sum is divisible by k+1k + 1. At k=1k = 1 the Moore compound is the ordinary disjunctive sum and this is the Sprague–Grundy theorem, exact on everything — the first row of the figure is a control, and it passes on all 127 games.

The two other rows are the finding. At two heaps a move and four heaps in the position, and at three a move and five heaps, the substituted criterion agrees with search on every position of 34 games and disagrees somewhere in each of the other 93. Not one game in the census lies between. The 34 are the games in which no move from any heap reaches a heap of larger Grundy value; the 93 are the games in which some move does.

What “never climbs” means in a range of heaps

A climb is a legal move from a heap of value vv to a heap of value greater than vv. The mex rule forbids a move to the same value and guarantees one to every smaller value, and about larger values it says nothing. In most games they are there: in take one or two, whose values run 0,1,2,0,1,2,…0, 1, 2, 0, 1, 2, \ldots, a heap of three is worth nought and moves to a heap of one worth one.

The values descend, in Nim only. How often a position can move to a position of a higher Grundy value. The mex rule guarantees every value below is reachable and says nothing about above; in Nim nothing above is ever reachable, and in every other game here it often is.
Fig. 2 How often a heap can move to a heap of higher Grundy value, in five games. The mex rule guarantees every lower value and says nothing about higher ones; Nim never reaches one, and every other game here often does.

Bouton’s own transplant counted these chances and found Nim the only game of five that never takes one. The census above does the same per game, and one caution belongs to it before any of its numbers are quoted. Heaps run to eight, and a game cut off at heap eight is itself a game — heaps only shrink — so the count of 34 is a count of games that never climb in that range. Twenty-four of them are any-take-but games, which never climb at any size; ten are finite take-sets such as take 5 or take 4 or 5, which climb by heap twice their largest take and have simply not reached it by eight. Inside the range both kinds behave identically, and the criterion treats them identically. That is the right result rather than a loophole: the claim being tested is about the game played, and the game played stops at eight.

The one fact Moore’s proof used about a heap

Why should climbing matter? Because Moore’s own proof uses one fact about heap sizes that is true of sizes and false of most Grundy values, and nobody reading the proof about Nim could tell it was being used.

The proof has two halves, as Bouton’s does.

From a lost position, every move leads to a won one. A move changes at most kk heaps. Look at the highest binary column in which any changed heap differs. Every changed heap that differs there has decreased, so each has gone from a one to a nought in that column; the column sum has dropped by at least one and at most kk, which cannot be a multiple of k+1k + 1. So the column is no longer divisible, and the position is not lost.

From any other position, some move leads to a lost one. Work down the columns from the top, choosing at most kk heaps to lower so that every column comes out divisible. The choice needs each chosen heap to be lowerable to whatever smaller size the arithmetic asks for, and a Nim heap can be.

Substitute Grundy values and read the halves again. The second survives untouched: the mex rule guarantees a move from any heap to every smaller value, which is exactly what the construction asks of a heap. The first survives too, provided every changed heap’s value goes down. That is the word the proof leaned on — decreased — and it is not a property of a Grundy value. It is the property of never climbing.

So one direction is a proof, and it is short. If a game never climbs, Moore’s criterion on its Grundy values is exact at every kk and every number of heaps, because both halves of Moore’s 1910 argument go through word for word. And the same holds for a position mixing several games, as long as none of them climbs, since the argument only ever looks at one heap at a time.

A move the binary columns cannot see

The other direction needs a position where the criterion fails, and climbing supplies one by a construction small enough to hold in the hand.

A move the binary columns cannot see. In take 1 or 2 with 4 heaps and up to 2 heaps changed a move, heaps 1, 1, 1, 3 have Grundy values 1, 1, 1, 0, whose binary columns are divisible by 3. One move lowers one heap's value and raises another's, leaving the same values in a different order, so the criterion calls both ends lost. Search says the first is won and the second lost.
Fig. 3 Four heaps of take one or two, up to two changed a move. The values 1, 1, 1, 0 have column sums 0 and 3, both divisible by three, and so do 0, 1, 1, 1 after one move that drops a heap worth one to nought and raises a heap worth nought to one. The criterion calls both lost, and they are joined by a legal move.

In take one or two with four heaps and up to two changed a move, take the heaps 1,1,1,31, 1, 1, 3. Their values are 1,1,1,01, 1, 1, 0, and the column of ones sums to three: divisible by three, so the criterion calls the position lost. Now make one move in two heaps at once — empty one of the heaps of one, and take two from the heap of three. The values become 0,1,1,10, 1, 1, 1. They are the same four numbers in a different order, so the columns have not changed and the criterion calls this position lost as well.

Two lost positions cannot be joined by a move; that is what lost means. So the criterion is wrong about one of them, and search says which: 1,1,1,31, 1, 1, 3 is won, and the move just described wins it.

What makes the move invisible is that it is a swap. One heap drops from value ww to value uu and another climbs from uu to ww, and the multiset of values, which is all the criterion reads, comes out where it started. Two ingredients are needed. A climb from uu to ww, which is what the game has to supply. And the freedom to change two heaps in one move, which is what Moore’s rule supplies at every k≥2k \ge 2.

From that the general statement takes one more line. Given any climb from uu to ww, set out k+1k + 1 heaps of value uu and k+1k + 1 heaps of value ww. Every column sum is a multiple of k+1k + 1, so the criterion calls it lost; and the swap — the climb in one heap, a drop from ww to uu in another, which the mex rule guarantees — leads to the same multiset again. Every game that climbs anywhere defeats the substituted criterion at 2k+22k + 2 heaps. Together with the proof above, the substituted criterion is exact on exactly the games that never climb, at every kk of two or more.

Why the 1935 theorem never had to care

That raises a question about the theorem that did work. Sprague and Grundy substituted into Bouton’s criterion, the values climb in nearly every game, and the result is exact everywhere. Why is the same climb harmless there?

Because at k=1k = 1 a move changes one heap, and a swap needs two. A single heap’s value cannot change while the multiset of values stays fixed, so no move joins two positions with the same exclusive-or, climbing or not. The mex rule’s silence about larger values is never tested, because the rule of the disjunctive sum — one component per move — forbids the only manoeuvre that would test it.

This is the connection worth carrying away, because it runs against the usual account. The Sprague–Grundy theorem is usually described as working for all games, and so it does; but what it tolerates — values that go up as well as down — it tolerates because of the sum, not because of the values. The other ways of adding games, where one move may touch several components, have no value theory of this kind, and the swap is the smallest reason why. Moore’s parameter is a dial on the one feature of the sum that was protecting it, and turning the dial from one to two removes the protection at once.

Moore’s own game hides all of this, as Bouton’s hid the climbing values: a Nim heap’s value is its size, a size only goes down, and a proof written about Nim cannot reveal which of the two facts it rests on.

Safe below k+2k + 2 heaps, for any games

The construction needs 2k+22k + 2 heaps. The search finds the criterion wrong much sooner, and also finds a range in which nothing can go wrong whatever the games.

The criterion is safe up to k + 1 heaps. For take 1 or 2, how many positions the substituted Moore criterion gets wrong, by the number of heaps and by how many heaps a move may change. Nothing is wrong at one heap a move, or at k + 1 heaps or fewer; the first errors appear at exactly k + 2 heaps and the count rises with every heap added.
Fig. 4 Take one or two, every position of two to six heaps up to eight counters each. At one heap a move nothing is wrong; at two and three, nothing is wrong at k + 1 heaps or fewer, and the first errors arrive at exactly k + 2 heaps — 52 of 495 positions at four heaps with two a move, 53 of 1,287 at five with three.

The lower edge of the error region is a theorem. With at most kk heaps, a column sum is at most kk, so divisibility by k+1k + 1 means every column is empty and the criterion reads every value is nought. With exactly k+1k + 1 heaps a column sum is divisible only at nought or k+1k + 1, so the criterion reads every value is the same. In both cases no move stays inside the set: a move changes at most kk heaps, each changed heap’s value changes (the mex rule forbids a move to the same value), and with k+1k + 1 heaps at least one heap is left as it was. Once one value has moved, the values are no longer all equal, and with all values nought one of them has stopped being nought. And from outside the set, lowering every heap above the smallest value to that value takes at most kk heaps, which is a legal move. Climbing never enters.

So a position of up to k+1k + 1 components is decided by the substituted criterion for any games at all. With kk or fewer it is the selective compound’s rule — a position is lost when every component is lost. With exactly k+1k + 1 it is something less familiar: lost exactly when all the components have the same Grundy value.

The upper edge is a measurement. In take one or two the first errors come at k+2k + 2 heaps, four heaps at two a move and five at three, not at the six and eight the construction needs; and in the census every one of the 93 climbing games is already wrong at k+2k + 2. A shorter swap explains the example — a climb from nought to ww, beside k+1k + 1 heaps of value ww, makes a criterion-lost position of k+2k + 2 heaps, and the swap leaves it lost — but not every climb starts at nought, and the general construction at k+2k + 2 needs the game to have heaps of the values u∣wu \mathbin{|} w and u⊕wu \oplus w to fill the columns. That every climbing game fails at k+2k + 2 is measured on 127 games and not proved.

Three different games at once

The safe region is worth testing on its own terms, since its argument used nothing about the components being alike.

Any games at all, up to k + 1 heaps. Mixed compounds of three and four different take-away games, each of them a game that climbs. With three heaps and two changed a move, a position is lost exactly when every heap has the same Grundy value, as the substituted criterion says; with four heaps and three a move it is still exact; with four heaps and two a move it is wrong on 378 positions.
Fig. 5 One heap each of three or four different games, every one of which climbs. At three heaps with two changed a move, the lost positions are exactly the 48 (or 54) whose three values are equal. At four heaps with three a move it is still exact; at four heaps with two a move, one heap past the safe region, it is wrong on 378 of 6,561.

Take one heap of take one or two, one of take 1, 3 or 4 and one of any take but 2, and let a move change up to two of them. All three games climb. Of the 729 positions with heaps up to eight, 48 are lost, and they are exactly the 48 whose three Grundy values are equal. The same holds with a different triple, 54 of 729. Add a fourth game and allow three a move, and the lost positions are the 156 with all four values equal. Allow only two a move with the same four heaps, and the criterion is wrong on 378 positions.

That is a curious statement for a mixed compound, and it is checkable by hand on a small board: three unrelated take-away games on one table, a player allowed to move in any two of them, and the player to move loses exactly when the three heaps are worth the same. Nothing about the games’ rules appears in it except through their values, and the values climb freely.

Wrong in both directions

When the criterion fails past the safe region, it fails in a way that is worth contrasting with the failure Bouton’s criterion had.

Wrong in both directions. For seven take-away games that climb, the positions of 5 heaps on which the substituted Moore criterion is wrong, split by direction: lost positions it calls won, and won positions it calls lost. Every game has both kinds.
Fig. 6 Seven games that climb, every position of five heaps up to eight, two changed a move. The errors split into lost positions the criterion calls won and won positions it calls lost, and every game has both kinds — from 82 and 80 in take one or two to 42 and 238 in take one or three.

Bouton’s 1901 criterion carried to a subtraction game was wrong in one direction only: it called some lost positions won and never the reverse, because the subtraction game’s values were a fixed part of the heap sizes and the old test could only refuse positions the true one accepted. That made it sound but incomplete, which is a usable thing to be.

The substituted Moore criterion has no such shape. In take one or two at five heaps it calls 82 lost positions won and 80 won positions lost; in take one or three, 42 and 238. Both kinds follow from the swap. A position the criterion accepts but which has a swap to another accepted position is a win called lost — the first panel of the move figure. And a position the criterion rejects can still be truly lost, once its true losing neighbours are no longer the ones the criterion names. Since half of Moore’s argument survives — every rejected position still has a move to an accepted one — the errors are not a matter of the criterion being too strict or too lenient. The accepted set is simply the wrong set, by a margin that grows with the number of heaps: 52 of 495 positions at four, 162 of 1,287 at five, 504 of 3,003 at six.

Nim in other units, and nothing else

So the family the question asked for exists. What is in it?

Nim in other units obeys Moore. Four take-away games in which no move raises a Grundy value — Nim, take two or more, take three or more, and any take but one and three — each judged by Moore's criterion on its Grundy values with two and with three heaps changed a move, and then all four mixed in one position. The criterion is exact on every position.
Fig. 7 Four games that never climb — Nim, take two or more, take three or more, any take but one and three — each judged at five heaps with two and three changed a move, and then all four mixed in one position. Exact on every position. Each sequence is the heap size divided by a whole unit and rounded down.

The census of games that never climb answered that before this question was asked. No game with a finite list of takes avoids climbing for ever — its values are bounded, and a bounded sequence cannot rise strictly along every chain of moves. Among games that allow every take except a finite list, many never climb, and every one of them has the Grundy sequence ⌊n/(j+1)⌋\lfloor n / (j + 1) \rfloor, where jj counts the smallest takes forbidden in an unbroken run: Nim with its heaps counted in units of j+1j + 1.

In such a game a heap of value vv can move to every value below vv and to nothing else, which is exactly what a Nim heap of size vv can do. So its Moore compound is not merely decided by Moore’s criterion on the values. It is Moore’s own game, with each heap’s counters grouped into units and the remainder ignored. The figure checks that four such games, alone and mixed four to a position, obey Moore’s columns at two and at three heaps a move with no exception.

The substitution therefore buys two things over Moore’s original, and both are smaller than the 1935 one. It extends the 1910 rule to Moore’s game played in other units, which is a relabelling. And it decides every position of k+1k + 1 components or fewer, of any games at all, which is genuine but narrow. Past that, in every game that climbs, the Grundy value is not enough information to decide a Moore compound, and no rule built only on the values can be right.

The convention named

Everything here is under normal play: the player who cannot move loses. A move in the Moore compound chooses between one and kk components and makes a legal move of that component’s own game in each chosen one; for Nim heaps that is exactly Moore’s rule, take from up to kk heaps, and for other games it is the reading that keeps each component’s moves its own. Under misère play Moore’s game takes the same patch Bouton’s does, and nothing here was run under it.

The games are take-away games on single heaps — finite take-sets and any-take-but sets inside one to six — not octal games that split heaps, whose options are sums and whose values a single heap does not carry alone.

And the per-heap quantity tried is the Grundy value and nothing else. The question as it was left allowed any assignment, and the Grundy value is the obvious one because it is the one that worked in 1935. That no other assignment works on a climbing game is not shown here. What is shown is narrower and still decisive for the Grundy value: on a climbing game the outcome of a Moore compound is not a function of the heaps’ Grundy values at all, since the two ends of a swap share every value and differ in outcome.

What the census cannot show

Exhaustive search over heaps to eight, at most six heaps, and kk from one to three. The proofs cover every size: never climbing implies exactness everywhere, and a climb anywhere implies failure at 2k+22k + 2 heaps. The census adds two things the proofs do not — that 34 and 93 split the 127 games the way the proofs say, which is a check on the search rather than new information, and that failure arrives at k+2k + 2 heaps in every climbing game tried. The second is the one claim here that a larger range could overturn, and the place to look is a game whose only climbs start high and whose values are too few to fill the columns of a short swap.

The figures also show only that the criterion fails past k+1k + 1 heaps, and how often. They do not show what the lost positions of a climbing game’s Moore compound are. Bounded Moore’s Nim met the same wall from the other side — residues of heap sizes that could not determine the outcome at k≥2k \ge 2 — and needed a statistic of the whole position rather than of each heap.

Who did what, and when

E. H. Moore published his game and its column rule in the Annals of Mathematics in 1910. R. P. Sprague and P. M. Grundy published the value theorem in 1935 and 1939. Compounds in which a move touches several components at once — conjunctive and selective — were studied by C. A. B. Smith in 1966 and are set out in Winning Ways. When kk is at least the number of components the Moore compound is the selective compound, and the rule above for kk heaps or fewer is that compound’s own. The intermediate family, at most kk components a move with more than kk on the table, is Moore’s rule widened to other games, and the census, the swap and the k+1k + 1 boundary above are computed here rather than quoted.

Still open: what a climbing heap has to report

The Grundy value is not enough for a Moore compound of a climbing game, and the swap says exactly what it misses: whether a heap can rise, and to where. A heap of take one or two worth nought that can reach a value of one is not the same component, under Moore’s rule, as a Nim heap of nought that can reach nothing.

So the natural next quantity is the value together with the set of larger values the heap can climb to. That pair determines everything the swap uses, and it is finite for every take-away game — a heap of a bounded game has finitely many options. Whether it is enough is a question with an exact answer on the same census: group each game’s heaps by the pair, and ask whether two positions that agree heap by heap on it ever differ in outcome. If they never do, Moore’s 1910 criterion was one table away from a theory of every take-away game, rather than one substitution away from a theory of Nim; if they do, a Moore compound needs to know something about a heap’s options that no summary of its values carries, which is a second way the theory runs out.

Part 9 of 9

One argument about Moores-nim. The parts either side of it:

The objects named here

The third axis, after the field and the series: the games, values and theorems themselves, and every essay that touches each one.

BoutonCounterexampleCriterionExhaustive searchGrundy valueMexMoores-nimNimSelective compoundSprague–GrundySubstitutionSubtraction game