Impartial games

Sixty-four codes, eleven sequences

Put a free split in front of every two-digit octal code and match each one against all 4,096 ordinary codes with up to four digits. Sixty-four codes give eleven Grundy sequences. Two are ordinary games one counter over — Kayles, and ·777 — because a heap of one is dead. Seven are short periodic patterns dozens of ordinary codes share. Two are new, and for one of them a heap of three proves it.

Assumes: The formula is a limit · Naming a game with a number

The formula is a limit found Kayles hiding in an unexpected place. Write a take-and-break code with a 4 before the point and a heap may be split in two at no cost; the rule 4.4 adds one more move, take a counter and split what is left, and on a heap of n + 1 it is Kayles on a row of n, move for move. That essay closed on the question the identity raises:

It would be worth knowing how many of the other right-hand cells are ordinary octal games in disguise — shifted, or relabelled, or with dominated moves removed — because every such identity moves a code from the unexplored column into the explored family.

The question has a direct answer, and it is less flattering to the column than the Kayles identity suggests. Most of the sixty-four codes are ordinary codes in some sense. Only two of the sequences they produce are ordinary games in disguise; seven more are coincidences of small numbers; and two are not ordinary at all.

Kayles, one counter over. The Grundy sequence of Kayles on a row of n pins beside the sequence of the take-and-break code 4.4 on a heap of n + 1 counters. They are the same sequence, because splitting a heap into two parts is knocking down one pin between two rows, and each part is a row one pin longer than it looks.
Fig. 1 The identity the question started from: the rule 4.4 on a heap of n + 1 has Kayles’ value on a row of n, at every n checked.

The match

The column is every code 4.d₁d₂, sixty-four of them, and each digit is read the usual way: for removing k counters, bit 1 allows leaving nothing, bit 2 leaving one heap, bit 4 leaving two. The 4 before the point allows a heap to be split into two non-empty heaps without removing anything. Each code’s Grundy sequence is computed to a heap of six hundred.

The comparison set is every ordinary code with up to four digits after the point — 0.d₁d₂d₃d₄, 4,096 of them, the family the octal game survey draws from — each computed to the same length. Two codes are said to match when one’s Grundy sequence equals the other’s, heap for heap, over the whole window — the same comparison a chess problem that turned out to be an octal game used to find Dawson’s chess inside ·137. The split code may be shifted by up to three counters first, since the Kayles identity is a shift of one.

Equality of Grundy sequences is the right notion of disguise for a reason the subject makes precise. Two games with the same Grundy value at every heap are interchangeable in every disjunctive sum, so a player cannot tell them apart and neither can any theorem about sums. Whether the moves look alike is beside the point; what the Sprague–Grundy theory sees is the sequence. But a match over a window is evidence about the window, and that distinction is the whole of what follows.

Which split codes are ordinary codes in disguise. An eight-by-eight grid of the take-and-break codes 4.d₁d₂, each marked by whether its Grundy sequence over six hundred heaps is an ordinary octal code's shifted by one counter, the same as several ordinary codes', or like no ordinary code with up to four digits.
Fig. 2 The sixty-four codes 4.d₁d₂, each marked by what its sequence matches among the ordinary codes. K: an ordinary code one counter over. =: the same sequence as several ordinary codes, unshifted. new: no ordinary code at all.

The grid sorts the column into three kinds. Sixteen codes — the whole of rows 4 and 6 — match ordinary codes at a shift of one counter and at no other. Forty-two match ordinary codes unshifted, each one sharing its sequence with at least four ordinary codes and most with dozens. Six match nothing at any shift: 4.12 and 4.13, and 4.72, 4.73, 4.76 and 4.77.

Sixty-four codes, eleven sequences

Before reading the three kinds, the column has a feature the grid hides: it is far less varied than sixty-four cells suggest.

The eleven sequences behind sixty-four codes. The sixty-four take-and-break codes with a free split, grouped by Grundy sequence. They fall into eleven groups: two shifted copies of ordinary codes, two found among no ordinary code, and seven short periodic sequences each shared with many ordinary codes.
Fig. 3 The sixty-four codes grouped by Grundy sequence, with each group’s first values, its period and how many ordinary codes share it.

There are eleven distinct sequences among the sixty-four codes. Every one of them is shared by at least two codes and most by four or eight, and the grouping has a visible shape: codes that differ only in bit 1 of the second digit, or only in bit 2 of the first, usually land together. The column is not sixty-four games. It is eleven, each written several ways.

The reason is a fact about one small heap. In every code whose first digit lacks bit 1, a heap of a single counter has no move: it cannot be split, and nothing allows removing one counter to leave nothing. A dead heap of one is worth nought, and that makes several moves interchangeable. Taking a counter and leaving one heap of m − 1 reaches the same value as taking a counter and splitting the rest into a heap of one and a heap of m − 2, because the heap of one adds nothing to the nim-sum. Taking two counters from a heap of two to leave nothing reaches nought, and so does splitting the heap of two into one and one. Each code that adds such a move to a simpler code has added a duplicate, and its sequence cannot change.

The two genuine disguises

The sixteen codes that match only at a shift of one are where the Kayles identity lives, and they turn out to be exactly two games.

A dead counter, and the moves it makes redundant. The moves that distinguish the sixteen codes 4.4x and 4.6x from 4.4 and 4.44, each paired with a move those two already have. Every one is redundant because a heap of one counter has no move in any of these codes.
Fig. 4 The moves that separate the sixteen codes 4.4x and 4.6x from the two codes 4.4 and 4.44, each matched with a move those two already have.

Rows 4 and 6 of the grid hold codes whose first digit is 4 or 6, and in all of them a heap of one is dead. The 6 adds take one, leave one heap, which duplicates take one and split off a dead counter. In the second digit, bit 1 duplicates the split of two into one and one, and bit 2 duplicates take one and split off a dead counter one counter further on. All of that is checked heap by heap to three hundred: the sixteen codes reduce to 4.4 and 4.44, and the only digit that matters is bit 4 of the second, which adds take two and split the rest.

4.4 is Kayles, written ·77, one counter over. 4.44 is new to these essays and the same argument names it. Read a heap of m as a row of m − 1 pins, as before. Taking two counters and splitting the remaining m − 2 into two non-empty heaps leaves rows of a − 1 and b − 1 pins, which together hold m − 4 — three fewer than the row of m − 1, with three adjacent pins gone and the rest in two possibly-empty rows. That is the move take three, leave nothing, one heap or two, which is a third digit of 7. So 4.44 is ·777, one counter over — the game in which up to three adjacent pins may be knocked down — and the match says so: its sequence equals that of ·777 and of the ordinary codes ·776 and ·7761 that agree with it.

That moves a code from the unexplored column into the explored family, which is the kind of result the question asked for. It also moves an unsettled code: neither 4.44 nor ·777 shows a period within six hundred heaps, and the sequence reaches a value of 61 there. The identity says nothing about whether it ever settles. It only says that whoever settles one has settled both.

Forty-two coincidences

The unshifted matches are a different kind of thing, and the third column of the families table shows why. Every one of those seven sequences is a short pattern that starts repeating at heap one or two: period 1, 2 or 4, values no higher than 3. A sequence like 0, 1, 1, 1, 1, … or 0, 0, 1, 0, 1, 0, 1, … has very few ways to be produced by a mex, and dozens of ordinary codes produce each of them — forty-five share the first group’s sequence, fifty-two the second’s, fifty the last’s.

A match of that kind is a coincidence of small numbers rather than a disguise. The two games have the same values, so for a player they are the same game, and that is a real statement; but no ordinary code is the code the split code is hiding, because forty others are just as good a match. The identity carries no information the sequence did not already have, and it gives nothing to anybody hoping to learn about the split code from the literature on its twin, since the twin is one of a crowd.

The match is also weakest exactly here as evidence. A long irregular sequence that agrees over six hundred heaps is unlikely to part company at heap six hundred and one. A short periodic one is a pattern both codes might follow for a while for different reasons. In the cases here the reasons are not hard to find — a code whose only moves reach heaps of value nought and one cannot go higher, and a parity argument settles it — but none of that is a theorem about the column as a whole, and the forty-two are best read as forty-two small games with small answers, each of which happens to have been written down before.

The two that are new

Six codes match no ordinary code with up to four digits, at any shift up to three. They are two sequences: 4.12 and 4.13 share one, period seven from heap six; 4.72, 4.73, 4.76 and 4.77 share the other, which is the strangest sequence in the column. From heap one it runs 1, 2, 4, 1, 2, 4, 1, 2, 4, … and never takes the value 3 at all.

Where the split codes leave the ordinary family. Every move from a heap of three under the rule 4.72, with what it leaves and what that is worth. The split into one and two, which no ordinary code allows, reaches the value three, so the heap is worth four — a value no ordinary octal code can give a heap of three.
Fig. 5 Every move from a heap of three in 4.72, with the value of what it leaves. The split into one and two, taking nothing, reaches the value three; no ordinary code allows that move.

For that sequence there is a proof that no ordinary code of any length can match it unshifted, and it fits in the table above. In an ordinary octal code every move removes at least one counter, so a heap of three can only become heaps that add up to two or fewer: nothing, a single heap of one or two, or two heaps of one. Those are worth at most nought, one, two and nought. So a heap of three in any ordinary code is worth at most three — the figure checks that across all 4,096 codes with up to four digits, and the argument covers every longer one.

In 4.72 a heap of three can be split, taking nothing, into one and two. Those are worth 1 and 2, so the split is worth 1 ⊕ 2 = 3, and with the other moves reaching 0, 1 and 2 the heap is worth 4. The free split reaches a value no removal can, because it is the only move that leaves as many counters as it started with. That is the precise sense in which the column with a split digit is a different family: not that splitting is unusual — ordinary codes split all the time — but that splitting without taking is the one move ordinary codes never have, and the first heap where it matters is three.

The pair 4.12 and 4.13 has no argument of that kind here. Its sequence takes only values up to four and could in principle come from a long enough ordinary code. Within four digits it does not, and the sequence is the only evidence on the page that it is new.

What a disguise is worth

Three kinds of match, and they are worth very different amounts.

A shift that follows from the moves is a theorem. The 4.4 and 4.44 identities are proved by reading heaps as rows, and the sixteen codes reduce to them by the dead-counter argument; nothing about the window is needed. Every fact anybody learns about Kayles or ·777 is a fact about eight codes each in the split column, and this is the only kind of match that does what the question hoped — transfers knowledge.

A coincidence of small periodic sequences is a true statement that transfers nothing. It is useful as a classification, because it says forty-two codes in the column are already as understood as games get, and useless as a bridge, because the other end of the bridge is a crowd of codes, none of them better known than the split code itself.

And no match at all is a boundary. The four codes 4.7x with take one, leave one heap and a free split are outside the ordinary family for a reason that can be stated in one heap. That is the most informative result of the three and the one the question did not anticipate: the column is not the ordinary family plus a few disguised members, it is a family that overlaps the ordinary one along sixteen codes by translation and forty-two by coincidence, and parts company with it where a heap can be broken without being diminished.

Why ·777 and not something else

The shift that turns 4.44 into ·777 is worth one more look, because it explains why the split column contains the sevens and nothing in between. Reading a heap of m as a row of m − 1 pins turns each move of the split code into a move that knocks down a run of adjacent pins: a free split knocks down one, take one and split knocks down two, take two and split knocks down three. The pins on either side of the gap become two rows, either of which may be empty. That is exactly a digit of 7 — leave nothing, one row or two — at each length, and nothing else can arise, because a split always produces two heaps and two heaps always read as two rows.

So every code in the column that translates at all translates to a code made of sevens: 4 to ·7, 4.4 to ·77, 4.44 to ·777, and a 4.444 would give ·7777. Kayles is the second of those and Dawson’s Kayles, ·07, is not among them, since it knocks down two pins but never one. The translation is a bijection between one corner of the split column and the run-knocking games, and every other member of the column either reduces to that corner by the dead-counter argument or leaves the ordinary family altogether.

How the earlier grid reads now

Sixty-four codes, with a split and without. Two eight-by-eight grids of take-and-break codes: rows are the first digit after the point, columns the second. The left grid is the ordinary codes 0.d₁d₂ and the right the same codes with a split into two heaps allowed at no cost, 4.d₁d₂. Each cell holds the period found within two thousand heaps, or a question mark where none was found.
Fig. 6 The periods of the sixty-four codes with a split digit and without, from the first survey of the column. Fifty-six settle with the split and forty-seven without.

The survey that first put these sixty-four codes side by side counted fifty-six of them settling within two thousand heaps, against forty-seven of the same codes without the split, and called the split digit a settling influence. The match puts that in proportion. Forty-two of the fifty-six settle the way a sequence of small values settles — immediately, with a period of four or less. Eight are Kayles one counter over, settling at heap seventy-two. Six are the two new sequences, both periodic early. The settling influence is real, and most of it is the dead heap of one making small games smaller.

The eight question marks on the right of that grid are 4.44 through 4.47 and 4.64 through 4.67, and they are all one sequence: ·777 one counter over. That turns eight open cells into one open problem, and four of them were counted against the split digit — 4.44 to 4.47 settle without it — when what the split does to them is turn them into a different, older game.

The convention, named

Normal play; impartial; the take-and-break notation in which digit k after the point governs removing k counters and its bits 1, 2 and 4 allow leaving nothing, one heap and two heaps, and a 4 before the point allows splitting a heap into two non-empty heaps with nothing removed. Two codes match when their Grundy sequences agree heap for heap over six hundred heaps, after the split code is shifted by up to three counters. Trailing zeros are dropped, so the 4,096 ordinary codes are those with at most four digits after the point.

What the match cannot show

That a coincidence lasts. Six hundred heaps is a long window for a short periodic sequence and a proof of nothing. The shifted identities do not need the window; the coincidences do.

That the new sequences are new to all codes. The heap-three argument rules out every ordinary code for the 4.7x sequence at a shift of nought, and the match rules out ordinary codes with four digits or fewer at shifts up to three. A five-digit code shifted by two is not excluded by anything here.

And what relabelling would find. The question named relabelling as a third kind of disguise — two sequences equal after the values are permuted. That is a weaker identity than equality and does not make two games interchangeable in sums, so it is left out; it would merge some of the eleven sequences, and it would do so without any game-theoretic meaning.

Still open: whether a free split ever needs more than one heap

The new sequence for 4.7x comes from one move at one heap: a split of three into one and two that no removal can match. That suggests a narrower family worth surveying. If the free split only ever matters at small heaps, then a code with the split allowed only below some size — split a heap only when it is three or fewer, say — would produce the same sequence, and the split column would be the ordinary family plus a finite amount of extra structure. If the split matters at every size, the column is a genuinely larger family and its unsettled members, ·777 among them in disguise, are part of a bigger problem than the ordinary survey. One split is enough asked which splits Lasker’s Nim needs and found it needs very few; the same question asked of the 4.7x codes, by capping the size at which the free split is allowed and watching where the sequence first changes, would say which of those two pictures is right. And the heap is not the position is the reminder that a code is a description of moves, and that two descriptions which look nothing alike can be the same game — which is what row 4 of the grid has been all along.

Part 5 of 8

One argument about Lasker. 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.

CounterexampleDominated optionEquivalenceEventual periodicityExhaustive searchGrundy valueImpartialKaylesMexOctal codeOctal gameTake-and-break