Impartial games

A game that never climbs is Nim in other units

In Nim no move can raise a heap's Grundy value, and in every other game on the list where Bouton's argument was checked, some move can. No finite set of takes avoids it — a two-line argument from the mex rule, and in a sweep of 1,023 sets the latest first climb is at heap 2m. Forbid a finite set of takes instead and 874 of 4,096 games never climb; every one of them is Nim with its heaps counted in units of k + 1, and a test on the forbidden takes alone says which.

Assumes: The picture Bouton's proof leaves behind · Grundy sequences, and where they stop being predictable

A Grundy value can go up. The essay that carried Bouton’s closure argument across to every value counted the chances and found that in a subtraction game a move from a heap worth nought to a heap worth two is ordinary — ninety-nine times in 444 chances over five games — and that in Nim it never happens at all. The mex rule guarantees every smaller value among a position’s options and forbids its own; about larger values it says nothing, and in most games they are there to be moved to.

That left a conjecture and a question. The conjecture was that a game climbs nowhere exactly when its Grundy sequence never decreases. The question was whether any game other than Nim has such a sequence — whether never climbing is a property of Nim, or of a family Nim happens to belong to.

Both have answers, and the answers are sharper than the question. No game with a finite list of takes can avoid climbing, by an argument two lines long. Among the games that forbid a finite list of takes instead, many never climb — and every one of them is Nim with its heaps counted in a larger unit. The family exists, and it is Nim’s own.

Which take-away games climb. Grundy values of heaps 0 to 23 in 4 take-away games — Nim: any take; any take but 1; any take but 1, 2; any take but 2 — with a mark under every heap from which a legal move reaches a higher value. Nim: any take and any take but 1 and any take but 1, 2 never climb; the others do.
Fig. 1 Four take-away games, heaps 0 to 23. Nim’s values are the heap sizes and nothing climbs. Forbid taking one counter and every value appears twice; forbid one and two and every value appears three times — and neither climbs. Forbid only two and the sequence falls back every fourth heap, and from each of those heaps a move reaches a larger value.

The two words, made exact

A climb is a legal move from a heap of Grundy value vv to a heap of value greater than vv. A game never climbs when no heap, at any size, has such a move. The test is per heap rather than per position, because a heap is the component the Sprague–Grundy theorem reads, and a sum of heaps climbs exactly when one of its heaps does.

The mex rule makes one half of never climbing free. A position’s own value is never among its options, so every option is either below or above. Never climbing is therefore the statement that every option is strictly below — every legal move lowers the value.

That restatement does most of the work in what follows, because “strictly lower after every move” is a strong thing to ask of a number.

Why a finite set of takes has to climb

Take a subtraction game with a finite set of takes, the largest of them mm. Its Grundy values are bounded: a heap has at most as many options as there are takes, and the mex of a set of size tt is at most tt. Every such sequence is eventually periodic, which is another way of saying it is bounded.

Now suppose such a game never climbed. Then every move lowers the value strictly. Start at any heap and keep taking the smallest take: the values fall at every step, and they fall through a bounded range of non-negative integers. That is fine for a few steps. But run it the other way — a heap of nn, a heap of n+sn + s, a heap of n+2sn + 2s, each one a move above the last — and the values must rise strictly at every step, for ever, through a bounded set. They cannot.

So every finite set of takes climbs somewhere. It is the same fact as the bound on the values, read from the other side: a sequence that lives in a finite range cannot be strictly increasing along every chain of moves.

Every finite set of takes climbs. For every subtraction set whose largest take is from one to ten, the first heap from which a move can raise the Grundy value. All 1,023 sets climb; the latest first climb is at heap 2m and belongs to the set containing only m.
Fig. 2 Every finite set of takes whose largest is one to ten, with the first heap from which a move raises the value. None of the 1,023 avoids climbing, and the latest first climb belongs to the set holding a single take, at twice its size.

The argument says somewhere. The sweep says soon. Over every set whose largest take is between one and ten — 1,023 of them — the first climb arrives by heap 2m2m, and the only sets that hold out that long are the ones with a single take. The set {m}\{m\} gives values 00 below mm, 11 from mm to 2m−12m - 1, and 00 again at 2m2m, from which the one legal move reaches a 11. A typical set climbs far earlier: the mean first climb for m=10m = 10 is at heap 6.59.

Where the values can grow, the argument stops

The argument above used exactly one fact about the game, that its values are bounded. So the place to look for another never-climbing game is a family whose values are not.

Subtraction games with infinitely many takes are such a family, and the most natural corner of it is the games that allow every take except a finite list. Call the forbidden list FF. Nim is the case F=∅F = \varnothing. Forbid taking one counter and the game becomes “take two or more”; forbid one and two and it is “take three or more”; forbid only two and a player may take one, three, four, five and so on.

These are not invented for the purpose. Games with a finite excluded set have a literature of their own, and the general result there is that their sequences are arithmetic-periodic — they repeat with a constant added, which is the behaviour a few hexadecimal codes were found to have and the reason they belong beside them. An arithmetic-periodic sequence grows without bound, so the obstruction that sank every finite set does not apply.

Four properties that turn out to be one

Take every forbidden list FF inside {1,…,12}\{1, \dots, 12\} — 4,096 games — compute each to heap 200, and ask four separate questions of each.

  1. Does the game never climb?
  2. Does its Grundy sequence never fall?
  3. Is its sequence exactly ⌊n/(k+1)⌋\lfloor n/(k+1) \rfloor, where kk is the number of consecutive small takes 1,2,…,k1, 2, \dots, k that FF forbids before its first gap?
  4. Does FF pass a test that looks only at FF: no k+1k + 1 consecutive forbidden takes above k+1k + 1?
Never climbing, four ways. For every finite set of excluded takes inside one to six, eight, ten and twelve: how many games never climb, and whether that agrees with the sequence never falling, with the sequence being n divided by k + 1 rounded down, and with a test on the excluded set alone. All four agree on every set.
Fig. 3 Every excluded set inside one to six, eight, ten and twelve. The four columns are four different questions — about play, about the sequence’s shape, about its formula and about the list of forbidden takes — and on every one of the 4,096 games to twelve they give the same answer.

On every one of the 4,096 games, the four answers agree. 874 games have all four properties and the other 3,222 have none of them. The conjecture left by the closure argument — never climbing exactly when the sequence never falls — holds on the whole sweep, and it holds for a reason that is more specific than the conjecture: a sequence that never falls, in this family, is always the same sequence.

What the never-climbing games are

The third column is the surprise, and it is worth reading slowly. A never-climbing game with kk small takes forbidden has value ⌊n/(k+1)⌋\lfloor n/(k+1) \rfloor at heap nn. That is a Nim heap, counted in units of k+1k + 1.

Forbid taking one counter and every value appears twice: heaps 0 and 1 are worth 0, heaps 2 and 3 are worth 1, heaps 4 and 5 worth 2. Forbid one and two and every value appears three times. Then add more forbidden takes higher up — forbid 1, 4 and 6 — and nothing changes: the sequence is still 0,0,1,1,2,2,…0, 0, 1, 1, 2, 2, \dots, because the takes that carry each value are still there.

The never-climbing games, by unit. The 874 excluded-take games inside one to twelve that never climb, grouped by the length k of the run of small takes they forbid. Each is Nim with its heaps counted in units of k + 1; Nim itself is the only one with k = 0.
Fig. 4 The 874 never-climbing games to twelve, grouped by the run of small takes they forbid. Each group is Nim in one unit; Nim itself is the only game with no small take forbidden, and the group with one forbidden has a Fibonacci count.

So the family Nim belongs to is real and large, and it is Nim’s family in the most literal sense: a game in it is Nim played with counters glued into blocks of k+1k + 1, where a block partly removed counts as removed. Of the 874 to twelve, 144 count in pairs, 274 in threes, 208 in fours, and the counts halve from there; one game — Nim — counts in units of one.

The pairs give a small piece of arithmetic away. With k=1k = 1 the test asks that no two forbidden takes above two be neighbours. Counting subsets of a line with no two neighbours is the oldest exercise that produces the Fibonacci numbers, and the counts at ranges 6, 8, 10 and 12 are 8, 21, 55 and 144.

Why neighbours in the forbidden list break it

The test on FF is not a curve fitted to the sweep. Half of it is a proof, and the proof is a picture of which takes each value needs.

Suppose the sequence is ⌊n/(k+1)⌋\lfloor n/(k+1) \rfloor. Every legal take is at least k+1k + 1, because 11 to kk are forbidden, and a take of k+1k + 1 or more lowers ⌊n/(k+1)⌋\lfloor n/(k+1) \rfloor by at least one. So nothing climbs — that half is immediate. What has to be checked is the mex: heap nn needs every value jj below ⌊n/(k+1)⌋\lfloor n/(k+1) \rfloor among its options. Value jj is carried by the block of k+1k + 1 heaps from (k+1)j(k+1)j to (k+1)j+k(k+1)j + k, and those are reached by a block of k+1k + 1 consecutive takes. The value is missing only if every take in that block is forbidden.

The block of takes a value needs. Heap 5 in two games that both forbid taking one counter. Each smaller value is carried by two neighbouring heaps, reached by two neighbouring takes. Forbidding 4 and 6 leaves every block reachable and heap 5 is worth 2; forbidding 4 and 5 closes the block carrying 0, and heap 5 is worth 0.
Fig. 5 Heap 5 in two games that forbid taking one counter. Value 0 is carried by heaps 0 and 1, reached by taking 5 or 4. Forbid 4 and 6 and the block stays open, so heap 5 is worth 2; forbid 4 and 5 and both takes into it are gone, and heap 5 falls to 0.

So the pattern survives exactly as long as FF never covers a whole block of k+1k + 1 consecutive takes, and the smallest block that could be covered starts above k+1k + 1 — the take k+1k + 1 itself is allowed, by the definition of kk. That is the run rule, and it shows that every game passing it never climbs.

The converse — that every game failing it does climb — is measured rather than proved here. It holds on all 3,222 failing games, and it holds in the tightest way available: in every one of them, the first climb is at the very heap where the value first falls. In the game that forbids 1, 4 and 5, heap 5 is worth 0 and a take of 2 reaches heap 3, worth 1. A sequence’s first fall is, in every game swept, a heap from which a move goes up.

What the games that climb do instead

A game that fails the run rule does not lose its growth. Its sequence still rises without bound — the values of an excluded-set game always do — but it rises with a stutter, and every stutter is a climb.

Which take-away games climb. Grundy values of heaps 0 to 29 in 4 take-away games — any take but 1, 4, 6; any take but 1, 4, 5; any take but 3; any take but 2 — with a mark under every heap from which a legal move reaches a higher value. any take but 1, 4, 6 never climbs; the others do.
Fig. 6 Two games forbidding one counter and one forbidding three, with the game forbidding only two for comparison. The first passes the run rule and is Nim counted in pairs. The others repeat a short pattern with a constant added each time round, and every place the pattern steps back is marked as a climb.

Read the second row. Forbid 1, 4 and 5 and the values run 0,0,1,1,20, 0, 1, 1, 2 and then fall to 00 at heap 5 — the block closed in the table above. From there the sequence picks up again, 3,1,2,2,3,3,4,4,5,5,63, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, and falls again at heap 17, to 44. The pattern is the same twelve heaps each time with four added: an arithmetic period of twelve and a constant of four. Forbid only three and the values come in runs of 0,1,20, 1, 2 then 3,4,53, 4, 5, a period of six with three added, falling back at heaps 3, 9, 15 and so on.

Every one of those falls is a climb, and the pairing is not a coincidence of these rows. In every one of the 3,222 failing games to twelve, the first heap whose value is lower than its predecessor’s is also the first heap from which a move reaches a larger value. The fall and the climb are one event seen from two sides: in every case swept, a heap whose value has dropped below its neighbour’s has a legal take to a heap worth more.

That gives the climbing games a shape worth naming. The never-climbing games are arithmetic-periodic too — period k+1k + 1, constant one — and they are the special case in which the pattern inside each period never steps back, so that adding the constant never has to undo anything. The growth rates even differ: Nim in pairs gains one every two heaps, the game forbidding 1, 4 and 5 gains four every twelve. Closing a block of takes costs the game not only its monotonicity but part of its rate.

Bouton’s test, in units of k + 1

If these games are Nim in another unit, then Bouton’s 1901 criterion ought to work on them after one division. Divide each heap by k+1k + 1, round down, and call the position lost when the results exclusive-or to nought.

The 1901 criterion in units of k + 1. Bouton's Nim criterion with each heap first divided by k + 1, checked against a search of every three-heap position up to eighteen counters in eight excluded-take games. It is exact on the five games that never climb and wrong on the three that do.
Fig. 7 The 1901 criterion with every heap first divided by k + 1, against a search of all 1,330 positions of three heaps up to eighteen. Exact on the five games that never climb; wrong on between 4% and 11% of positions in the three that do.

It does, and the check is made against play rather than against the theorem. Every position of three heaps up to eighteen counters is searched directly — a position is lost when every move leads to a won one — with no Grundy values involved. On the five never-climbing games tried, the divided criterion is right on all 1,330 positions. On the three games that climb it is wrong on 57 to 149 of them.

That is the transplanted criterion story told from the far side. Bouton’s test, moved to another game unchanged, called losses wins. Here it moves with one change, and the change is not the substitution of Grundy values that took until 1935; it is a change of unit that a reader of the 1901 paper could have made in an afternoon. The games where that suffices are precisely the games that never climb.

A climb is what a game has instead of a unit

The four-way agreement can be read as one sentence: a take-away game never climbs exactly when it is Nim in some unit. Everything else in the family — and everything with finitely many takes — climbs.

That makes the observation about Bouton’s picture more exact than it could be with five games in hand. Nim did not “happen” to be the one game that never climbed. Never climbing is the shadow of a strong structural property — values that are a monotone function of the heap — and in the take-away games that property forces the function to be division by a constant. A game whose values are a monotone function of its heaps is a game whose heaps are, at a coarser scale, Nim heaps.

It also explains why the descending picture Bouton’s proof leaves behind was so persuasive. In Nim the value is a measure of how much is left. In a never-climbing game it still is, in coarser units. In any other game the value is a label the mex rule assigns, and a label has no reason to shrink as the heap does — which is the content of a climb.

What the sweep cannot see

The range is twelve. The four properties agree on every forbidden list inside {1,…,12}\{1, \dots, 12\}, with values computed to heap 200. A list containing larger takes is not covered, and the run rule’s converse — that failing it forces a climb — is not proved for any range. The half that is proved is the half that matters for the title: every game passing the rule is Nim in units of k+1k + 1 and never climbs.

The values are computed to heap 200, not for ever. For the games that pass the rule this does not matter, because the proof covers every heap. For the games that fail, a climb is found within the range in every case and is a fact about all larger heaps too — one climb is enough.

Take-away games only. The games here remove counters from one heap and never split it. An octal game whose moves break heaps has options that are sums, and a sum’s value is an exclusive-or that can exceed both parts; whether any take-and-break game never climbs is a different question with a different shape, and nothing here touches it.

And the picture shows values, not play. A climb is available, not chosen; a winning player never makes one, because the winning move always goes to nought. What the strips show is the shape of the game tree, which the winning line visits only thinly.

The convention the count depends on

Normal play throughout: the player who cannot move loses. A heap’s value is computed by the mex rule over every legal take, and a game with forbidden list FF allows every take from one up to the heap’s size except those in FF.

A climb is counted per heap: a heap climbs if some legal move from it reaches a larger value. Counting moves rather than heaps would weight heaps with more options and measure branching. And the integer kk is defined by the forbidden list alone — the length of its initial run 1,2,…,k1, 2, \dots, k — so a game’s unit is read off the rules before anything is computed.

Still open: whether a take-and-break game can never climb

The take-away games are settled to range twelve: never climbing is being Nim in a unit. Games that break heaps are the natural next family, and there the obstacle is the exclusive-or itself. A move that splits a heap of value vv into two parts produces an option worth their exclusive-or, and an exclusive-or can be larger than either part — so a split can climb even when every part is small.

Lasker’s Nim shows how quickly that bites. It allows any take or a split into two heaps, and its values are the heap sizes with each pair 4k + 3, 4k + 4 swapped. That swap is a climb: a heap of four is worth three, and taking one counter leaves a heap of three, worth four. The one change that made the splitting game differ from Nim is, read as a picture, a step upwards.

So the question for take-and-break games is sharper than the one answered here. Never climbing would require every option of every heap — every take and every split — to land strictly below the heap’s own value, which constrains how the values of small heaps combine under exclusive-or as well as how fast they grow. The measurement is the per-heap count run over options that are sums, swept over the octal codes that name the whole family. If the only codes that pass are those whose values are the heap sizes or a division of them, never climbing is Nim’s property in the larger family too; if some other code passes, there is a sequence that is monotone, survives exclusive-or, and is not a unit of Nim — and nothing on the list of solved octal games looks like one.

Part 4 of 4

One argument about Grundy sequences. The parts either side of it:

What links here

Essays that reach for this one mid-argument — the half of a link its own author cannot write down.

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.

BoutonCounterexampleCriterionEventual periodicityExhaustive searchGrundy valueInvariantMexNimSubtraction game