Theme

The thread: The sum is the object

Real positions break into independent parts that are played at once, and adding them up is what the theory was built to do. The hard step is the splitting, not the addition.
Nim with heaps of 3, 5, 7. Heaps of counters; a move takes any number from one heap. The position is a loss for the player to move exactly when the binary digits of the heap sizes cancel in every column — the nim-sum — and that is the whole of the theory of Nim. Impartial games

Nim, and the nim-sum

Three heaps of counters, take as many as you like from one of them, and the player who takes the last counter wins. The winning condition is not a search, not a table, and not a heuristic — it is the bitwise exclusive-or of the heap sizes, and it was found in 1901.

A position is the sum of its parts. Four separate Hackenbush sprigs. A move is a move in one of them, so the position is their disjunctive sum, and its value is the sum of their values. Which part to play in is the entire decision, and the values are what makes it decidable. Sums and comparison

The sum is the object

Real positions come apart into independent regions, and a move happens in exactly one of them. That operation — the disjunctive sum — is what the whole theory is built to survive, and it is the reason values exist at all.

Comparing two positions is playing their difference. To decide whether one position is worth at least another, subtract and see who wins moving second. It is the only definition of comparison the subject has, and it produces a partial order — some pairs come out confused, which no comparison of numbers ever does. Sums and comparison

Comparing positions

One position is worth at least another when the second player wins their difference. That is the only definition there is, it is a computation rather than a judgement, and it produces an order in which some pairs are simply not comparable.

Every impartial position is a Nim heap. A heap in a subtraction game, its Grundy value, and the Nim heap it is equivalent to. The equivalence is exact: the two positions have the same options up to value, so they behave identically in any sum, which is the Sprague–Grundy theorem. Impartial games

Every impartial game is a Nim heap

Sprague and Grundy proved, independently and four years apart, that any position in any impartial game is equivalent to a single heap of counters. Not similar to one — equal to one, interchangeable with it inside any larger game.

The mex, and the rules that cannot replace it. Six candidate rules for the value of an impartial position, each a function of its options' values, run over the same subtraction game. The top strip is the truth. Every candidate but the mex assigns zero to a position somebody wins, or a non-zero value to a position somebody loses, and the circle marks the first heap where each one does it — which is why two people reaching for the same rule four years apart is evidence about the rule rather than about them. How it was found

Two people, four years apart, one theorem

Roland Sprague proved it in 1935 and Patrick Michael Grundy proved it in 1939, neither knowing of the other. That looks like coincidence until the alternatives are examined — and the rule they both reached turns out to be the only one that can work at all.

A board in pieces costs the sum, not the product. A Domineering board with squares blocked out, so that it falls into regions no domino can span. The number of positions in the whole board is exactly the product of the numbers in its regions — which is why evaluating the regions separately, and adding the values, is an exponential saving rather than a tidier way of writing the same search. What it costs

The board falls apart, and the arithmetic changes

A 4×5 Domineering board with a wall down the middle has 2,916 positions in it, and that number is exactly 54 × 54 — the product of its two halves. Solving the halves separately costs 108. Decomposition is the one saving in this subject that turns a product into a sum.

The endgame, accounted for. Several independent regions, each a fight with a settled value and a size. The account plays them hottest first: add up what each is worth on average, then add the largest amount at stake, subtract the next, and so on down. The exact value of the whole position is computed beside it, and the figure prints both. Temperature

The endgame, accounted for

Add up what each region is worth, then add the biggest thing at stake, subtract the next, and so on down. On a board of simple fights the result is exact — and the moment one region has a fight inside it, the account is out by a point.

Every position has an exact opposite. A position beside its negative, which is the same game with the players exchanged, and the sum of the two. The sum is worth zero every time — a second-player win — because the second player can answer each move with its mirror image. It is the fact that makes values a group, and it is what lets one position be subtracted from another. Sums and comparison

Turn the board through a right angle

A two-by-four Domineering board is worth something no number can express, and Right is ahead on it. Turn a second board through a right angle, put the two side by side, and the total is exactly zero. Every position has an exact opposite, and that single fact is what makes subtraction — and therefore comparison — possible at all.

Why nobody moves in the number. A hot position added to a number. Left wins the sum whoever moves — but only by moving in the fight. Spending the move on the number instead hands the position back as a first-player win, with Right to move, which throws the win away. The theorem says this is always so, and here it is happening. Values

Numbers avoid numbers

In a position with a number in it and anything else, the number is never the right move. That is a theorem rather than a heuristic, and it is the closest this subject comes to advice a player can carry into a real game.

Amazons, after the arrows have cut the board in 2. An amazon moves like a queen and then shoots an arrow, also like a queen, which burns the square it lands on. Late in a game the burnt squares cut the board into regions no amazon can cross — and from that moment the position is a sum of independent games, which is the shape the whole theory was built for, arrived at by the play rather than assumed. Particular games

Amazons, and when a position becomes a sum

Every technique on this site starts from a position already broken into independent parts. Amazons does not begin that way — the board is one fight until the arrows cut it, and the moment of cutting is something the play produces rather than the analyst assumes.

{2 | 0}, added to itself. The value of n copies of one position, for each n, beside n times its mean and the smallest distance between the two. The mean value theorem says that distance stays bounded however many copies are piled up — and the bound is the position's temperature, which is what makes the temperature a second genuine measurement rather than a diagram-reading convenience. Temperature

The same fight, eight times over

The mean is not roughly what a position is worth. It is the number that eight copies of the position stay close to — and the theorem is that the closeness does not decay as the copies pile up. The gap stops at the temperature, and stays there for ever.

on + off: what the backward analysis settles. A position graph in which the moves can lead back to where they started. The labels are the order in which a backward analysis settles each position, starting from the ones where a player has already run out of moves. Positions the analysis never reaches are drawn — and there is no test for that; being unreachable is what a draw is. Where it stops

One part that never ends

The game called `on` has one move and it is back to itself. Add anything to it — a star, a point, its own mirror image — and the whole board is drawn. So `off` is exactly the negative of `on` and their sum is not zero, which is the group law failing for a reason that has nothing to do with who is winning.

Three ways to add the same games. One list of components, added three different ways. Under the disjunctive rule a move is a move in exactly one part; under the conjunctive rule it is a move in every part at once, and play stops as soon as any part runs out; under the selective rule it is a move in any non-empty set of parts. The outcomes are computed by search from each rule's own definition. Sums and comparison

Three ways to add the same games

A move in exactly one component is a choice, not a law. Move in every component at once and the game is different; move in any set of them and it is different again. The same two positions, added three ways, give three different answers — and only one of the three has values that add.

Turning Turtles: a row of 12 coins. A row of coins, some heads and some tails. A move turns some of them over, and the rightmost coin turned must go from heads to tails — which is what makes the game end. The number under each place is what a lone head there is worth, and the row is worth the exclusive or of the places showing heads. Impartial games

A row of coins is already a sum

Everywhere else on this site a sum is several positions side by side. In a coin-turning game it is one row — each coin showing heads is a game in its own right, and the row is worth the exclusive or of them. The decomposition is inside a single picture.

a triangle on a stalk, worth ∗2. A Hackenbush position in which every edge is green, so either player may cut any of them and the position is impartial. Its value is a single Nim heap. Two principles find which one: fusion, which collapses every cycle to a point and leaves that many loops behind, and the colon principle, which replaces a branch by a stalk as long as the branch's own value. Particular games

Squash every loop to a point

Colour every Hackenbush edge green and the game becomes impartial, so the whole picture is worth a single Nim heap. Two principles find which one without playing anything — fuse the cycles, then run one pass up the tree — and a nine-vertex lattice that costs 1,283 positions to solve costs twelve steps to read.

A blocked file, and the tempo it holds. Files of a blocked pawn ending: a White pawn below, a Black pawn above, and a gap between them that either side may close one square at a time. Each file carries the value the game recursion gives it. With only single steps available a file is worth a star or nothing, by the parity of the gap, so the whole position is tempo and no material at all — which is what a chess player means by mutual zugzwang. Out in the world

A pawn ending is a sum

In a blocked pawn ending the material is level, the files never speak to each other, and whoever has to move is the one in trouble. Chess calls that mutual zugzwang; this site calls it a P-position; and the two vocabularies were built four decades and one subject apart to say the same thing.

Nim-multiplication below 16, and every field axiom checked. The nim-product, defined by taking the least value the product is not forced to be — the same manoeuvre as the mex rule, applied to a product rather than to a move. The result is that these values are not merely a group under nim-addition but a field: every axiom is checked over the whole table here, including an inverse for every non-zero value, and the sizes at which the axioms fail are reported rather than avoided. Impartial games

The nimbers multiply

Nim-addition is exclusive-or and everybody meets it first. There is also a multiplication, defined by the same take-the-least-value-not-forced manoeuvre as the mex — and it makes the nimbers below sixteen a field, with every axiom checked here and an inverse for every non-zero value.

A grid of coins, and a multiplication table. The Grundy values of a two-dimensional coin-turning game, computed from its own move rules by a mex at every cell. Down the left and across the top are the one-coin values of the two one-dimensional games it is built from. Every cell is the nimber product of its two edge values — the multiplication defined for the nimber field on algebraic grounds — and beside the grid are the three combining rules a reader would try first, each killed on a named cell. Impartial games

The tartan theorem

The nimbers are a field, with a multiplication defined by a mex-style rule that looks like an algebraist's amusement. Lay two coin-turning games on a grid and the Grundy value of each square is the nimber product of its two coordinates — which is the point at which the multiplication stops being a curiosity and starts computing answers.

Where the count and the value part company. Amazons endgames whose arrows have already cut the board into regions, with the territory count beside the computed value. Territory gives every empty square to whichever amazon can reach it in fewer moves, which is what Amazons programs compute. The positions drawn are the ones where that number gets the outcome wrong, and they have something in common: each is worth a switch, so there is no number for the count to have been right about. Out in the world

When a real board falls apart

Amazons is played competitively, and late in a game the arrows have cut the board into regions no piece can cross. From that moment the position is a disjunctive sum — arrived at by the play rather than assumed — and the territory count every program uses can be measured against what the sum is actually worth.

The picture is the numeral. Blue-red Hackenbush strings and their values. Left may cut a blue edge, Right a red one, and everything above the cut falls. The value of each string is a number, and reading the string from the ground upward gives the binary expansion of exactly that number. Sums and comparison

The other sum, the one that nests

A move in one part wipes the other out entirely. That is the ordinal sum, it is what a Hackenbush stalk actually is — 1 : (−1) is a half, and 1 : (−1) : 1 is three quarters — and it is not an operation on values at all: three positions all worth zero give three different answers under it.

Finding the parts costs the same whether there are any or not. Domineering boards of 4 squares by 5 with different squares blocked out, and what the decomposition is worth on each. The pass that finds the regions is a flood fill and visits every square once, so it costs the same on all of them. What it buys ranges from nothing — on the boards that do not decompose — to a saving of 2,808 positions, and it cannot tell which case it is in until it has run. What it costs

Finding the parts

Decomposition turns a product into a sum and is the largest saving in the subject. Nobody labels the regions. The pass that finds them costs the same on every board of a size — including the boards where there is nothing to find — and what it buys ranges from four orders of magnitude to nothing at all.

The values born by day three that are their own negatives. Every game satisfies G + (−G) = 0, so a game equal to its own negative satisfies G + G = 0 — it has order two. The nimbers do, and they are not the only ones: a switch symmetric about zero is unchanged by negation, and so is anything whose Left options are the negatives of its Right options. Each row carries the value, whether it is a nimber, and its outcome. Sums and comparison

The values that are their own negatives

Every game satisfies G + (−G) = 0, so a game equal to its own negative satisfies G + G = 0 — it has order two in a group whose elements otherwise have infinite order. The nimbers do. So does ±1, on sight. Over the 1,474 values born by day three there are 30 of them and only four are nimbers, every one of the 900 sums of two is another, and the equality test and a symmetry of the written form agree 1,474 times out of 1,474.

Every day-three value, moved by every quarter. Four claims counted over 3,000 translations — 120 values, each moved by every quarter from −3 to 3: that adding a number leaves the temperature alone, that it shifts both stops by exactly itself, that the interval between the negated stops is where the two players are confused, and that the only failures of the last are on its endpoints. Sums and comparison

What a number does to a fight

Adding a number to a position moves everything and changes nothing: over three thousand translations the temperature never once shifted and both stops moved by exactly the number added, every time. What the number decides is whether the fight is worth having — and the interval where the two players are confused is exactly the open interval between the negated stops, right in all 2,890 cases away from its endpoints and wrong in 110 that are all on them.

Cancellation, by exhaustion. The law checked on every triple of values born by day two, and then put to work: two Domineering regions compared directly and compared again inside a larger board. The comparison never changes, which is the licence every decomposition on this site is drawn under. Sums and comparison

What can be struck out

From G + X = H + X it follows that G = H, in one line, by adding −X to both sides. It is the shortest theorem here and the most used: it is what makes comparing two boards region by region legitimate. Over 10,648 triples the hypothesis fires 484 times and the conclusion holds 484 times — and the licence expires in three separate directions, each of which loses the same axiom in a different way.

All themes