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.

Assumes: The sum is the object · Who moves last

Asking whether one position is better than another sounds like a matter of judgement. It is not. There is a definition, it is short, and it turns the question into a computation:

GH    Left wins GH moving second.G \ge H \iff \text{Left wins } G - H \text{ moving second.}

Everything else — equality, the ordering of values, dominated options, the whole apparatus — is built on that one line.

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.
Fig. 1 The comparison performed. Subtract, play the difference with the opponent moving first, and see who is left standing. Some pairs return an answer neither way.

Why subtraction

The definition looks indirect. Why not compare GG and HH directly, whatever that would mean?

Because the thing being asked is a statement about substitution. GHG \ge H should mean that anywhere HH appears, replacing it by GG is never worse for Left. That is a statement about all possible contexts, and contexts are sums.

The difference GHG - H is the smallest test that captures it. If Left can win GHG - H moving second, then in any context XX, Left playing G+XG + X can mirror the strategy from H+XH + X and use the surplus from GHG - H to cover the gap. The single test implies the universal claim, which is the theorem that makes the definition worth having.

And it must be moving second. Requiring Left to win moving first would be a weaker and useless condition, since first-move advantage is exactly what the theory is trying to factor out. Winning moving second is winning without the tempo, which is what “at least as good” has to mean if it is to survive being added to something.

The four relations

Applying the definition both ways gives four possible results, matching the four outcome classes of the difference.

G>HG > H — Left wins GHG - H whoever moves first.

G<HG < H — Right wins it whoever moves first.

G=HG = H — the second player wins it, whoever that is.

GHG \parallel H — the first player wins it, whoever that is. The two are confused.

The fourth is the one with no counterpart in arithmetic, and it is not an edge case. Confusion is common, it is what makes the order partial, and it carries real information: two confused positions are close enough that whoever gets to move decides between them.

Confusion, operationally

The word suggests an absence of information, which is wrong. Confusion is a positive statement.

GHG \parallel H means: from the difference, whoever moves first wins. Translated back, it means neither position is safely substitutable for the other — replacing HH by GG helps Left in some contexts and hurts in others, and which one depends on the tempo.

The standard example is \ast and 00. Neither is better; whoever moves first in 0=\ast - 0 = \ast wins. In a context where Left is desperate for a move, \ast is better than 00; in a context where Left would rather pass, it is worse.

That is genuinely what happens in games. A position that gives both players a move is not straightforwardly better or worse than one that gives neither — it depends on who has moves to spare, and the theory records the dependence as confusion rather than pretending it away.

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.
Fig. 2 The four relations, one row each, taken against nought — where the difference is the position itself and the verdict is its outcome class. One is above, nought is equal to itself, minus one is below, and ∗2 is none of the three — its difference with nought is itself, a first-player win. The fourth row is the one arithmetic has no counterpart for, and it took exactly the same computation as the other three.

A comparison, worked

The definition is easiest to trust after watching it decide something non-obvious.

Compare \uparrow with \ast. Which is worth more?

Build the difference. =-\ast = \ast, since a nimber is its own negative, so the difference is +\uparrow + \ast.

Left moves first. Left’s options are to move in \uparrow, reaching 0+=0 + \ast = \ast, or to move in \ast, reaching +0=\uparrow + 0 = \uparrow. The second is a Left win — >0\uparrow > 0 — so Left moving first wins.

Right moves first. Right’s options are to move in \uparrow, reaching +=0\ast + \ast = 0, or to move in \ast, reaching \uparrow. The first is a Right win, since 00 is a second-player win and Left is now to move. So Right moving first wins.

Both first players win, so the difference is class N, so \uparrow \parallel \ast. Neither is worth more; they are confused.

Now compare +\uparrow + \uparrow with \ast. The difference is ++\uparrow + \uparrow + \ast.

Right moves first. Right’s best is to move in a \uparrow, reaching ++=\ast + \uparrow + \ast = \uparrow, which is a Left win. Or to move in the \ast, reaching +\uparrow + \uparrow, also a Left win. Every Right first move loses.

So Left wins moving second, and +>\uparrow + \uparrow > \ast.

Two ups beat a star and one does not. That is not a fact anybody would guess, it is not visible in the notation, and it falls directly out of four short recursions.

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.
Fig. 3 The comparisons the paragraph above works through, with the two that make the point about size beneath them. One up is confused with star and two ups are strictly greater — so a quantity that is not a size can still accumulate until it crosses one. And both are below a thousandth, because being greater than star buys nothing at all against a number.

Why confusion is not indifference

The word invites a misreading worth heading off: that confused positions are somehow equivalent, or that the theory has declined to choose between them.

Confused positions are as far from equal as the theory can express. G=HG = H means the difference is a second-player win — neither player can extract anything from it. GHG \parallel H means the difference is a first-player win, so both players can extract something from it, and the one who moves does.

Operationally: if GG and HH are equal, a player offered the swap should be indifferent, and can accept or decline without consequence. If they are confused, the swap is worth exactly one tempo — accepting it when it is one player’s turn is a gain, and the same swap on the other turn is a loss.

So confusion is a statement that the difference between two positions is precisely the value of having the move. Nothing indifferent about it.

A green Hackenbush edge is the clearest source of them, because it is an edge either player may cut. A single green edge on the ground is worth \ast. Two stacked are worth 2\ast 2. A blue edge with a green one above it is worth 11\ast, and the same two edges the other way up are worth  ⁣\uparrow\!\ast.

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.
Fig. 4 Each of those values compared with what the same drawing would be worth without its green edge. Every difference is \ast or a nimber, every outcome is a first-player win, and every verdict is confused — including ∗2 against ∗, so two green edges are not “more” than one. What the green edge contributes is a move for whoever wants it, which is worth exactly a tempo and is not a quantity at all.

Comparison with zero

Setting H=0H = 0 recovers the outcome classes exactly, since G0=GG - 0 = G:

G>0G > 0 is class L, G<0G < 0 is class R, G=0G = 0 is class P, and G0G \parallel 0 is class N.

So the four outcomes are not a separate concept from the ordering; they are the ordering, evaluated against zero. That collapse is one of the tidier facts in the elementary theory, and it means an implementation only needs one routine: decide who wins a position, then compare by deciding who wins a difference.

The algorithm

The definition is directly executable.

To decide whether Left wins GG moving second: check that for every Right option GRG^R, Left wins GRG^R moving first. To decide whether Left wins GG moving first: check that for some Left option GLG^L, Left wins GLG^L moving second.

Two mutually recursive functions, terminating because every option is strictly smaller. Comparison is then: build GHG - H, ask the two questions, read off the relation.

That is what the site’s evaluator does. leftMovesFirstWins and rightMovesFirstWins are the two recursions, outcome combines them, and compare(g, h) builds the difference and classifies it.

The cost is the problem. The recursion visits every position reachable in the difference, which for a sum of two moderately sized games is the product of their state spaces. Comparison is the expensive primitive of the whole subject, and since canonicalisation calls it repeatedly, it is the bottleneck in every value computation on this site.

What the solver computed

Two implementation facts, both learned by getting it wrong.

Memoisation is mandatory, not an optimisation. The reductions in canonical compare each option against each sibling and against the whole position, and the same comparisons recur constantly. Without a cache keyed on the pair of game identities, canonicalising a position with six options does not finish.

The cache key must be an identity, not a structure. The first implementation generated a structural key by recursing over a game’s options and concatenating their keys. For 3+5\ast 3 + \ast 5 that key grew to megabytes, and building the key cost more than the comparison it was meant to avoid. Games are now interned on construction — each distinct game gets an integer, keyed on the sorted integers of its options — so a key is two small numbers and structurally identical games are the same object.

With that in place, comparison is fast enough to run on every figure before it is published. assertValue and assertOutcome both call it, and both throw rather than render a wrong label.

The relations quoted in these figures were computed, not recalled: >0\uparrow > 0 from the difference \uparrow; \uparrow \parallel \ast from the difference +\uparrow + \ast, which is a first-player win; +>\uparrow + \uparrow > \ast from the difference ++\uparrow + \uparrow + \ast, which Left wins moving second. Each is one call.

Comparison is not a value

A distinction worth keeping sharp.

Comparison answers a yes-or-no question about a pair. A value is an object attached to a single position that determines every comparison it could take part in.

The two are related — canonical form is the value, and it is computed using comparison — but they are not the same, and the direction of dependence matters. Comparison is primitive; values are derived. A theory could in principle stop at comparison and never build values, and it would be able to answer every specific question and would compose badly.

What values buy is reuse. Comparing two positions repeatedly is expensive; reducing each once to a canonical form and then comparing forms is cheap. The value is a comparison result cached against every possible opponent at once.

Two positions, one value. A Hackenbush sprig and an abstract game with the same value. Being equal means more than being worth the same in isolation: either can be substituted for the other inside any larger position, and nothing about who wins will change.
Fig. 5 Two positions from different games that compare equal. Equality here is a computed fact about their difference, and the consequence is that either may be substituted for the other in any position whatsoever.

The order is not total, and cannot be made so

A recurring hope is that some refinement would restore a total order — a tie-break, a secondary criterion, a numerical score.

It cannot be done, and the obstruction is not technical. The order has to be compatible with addition, because that is what makes it useful. A total order compatible with addition would place \ast definitively above or below 00. Suppose >0\ast > 0. Then +>0\ast + \ast > 0. But +=0\ast + \ast = 0, so 0>00 > 0. Contradiction, and the same for <0\ast < 0.

So confusion is forced by additivity. Any ordering that is total is incompatible with the sum, and any ordering compatible with the sum has confused pairs. The partial order is not a stage the theory has failed to get past; it is the only thing that could have been true.

That argument is the same one the failure of outcome classes makes from the other side. Two positions in one outcome class can sum to positions in different classes, which is why an outcome is not a value; and a relation that ordered every pair would have to survive addition, which is why the order is not total. Both are consequences of the same requirement, and the requirement is the one the whole subject is built to meet.

Transitivity, and what survives

The order is well behaved where it can be.

\ge is transitive, reflexive and antisymmetric with respect to equality. It is compatible with addition: GHG \ge H implies G+KH+KG + K \ge H + K. It reverses under negation: GHG \ge H implies GH-G \le -H.

What is not transitive is confusion. GHG \parallel H and HKH \parallel K say nothing about GG and KK. Confusion is a symmetric relation and nothing more, and treating it as an equivalence is a common early error.

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.
Fig. 6 The smallest counterexample, drawn as the three comparisons it takes. Nought is confused with star; star is confused with up; and nought is strictly below up. Chaining the first two relations would give confusion between nought and up, and the third row says the computation disagrees. Three differences, three searches, and no transitivity to be had.

Nor is the order a lattice in general. Two positions need not have a least upper bound, so there is no operation of “the best of both”.

The cost, and why it shapes the site

Comparison is the primitive, and it is the reason this site draws small positions.

Deciding a comparison means playing out a difference, and a difference is a sum whose state space is the product of its parts’. Two positions of a hundred states each give a difference of ten thousand, before any branching. Memoisation caps the work at the number of distinct reachable positions, which is still a product.

Then canonicalisation calls comparison once per pair of sibling options, per pass, per level. The costs compound, and the compounding is why exact evaluation stops at a few dozen moves of depth rather than a few hundred.

Every figure here stays inside that ceiling deliberately. Where a claim depends on a position being small enough to evaluate, the essay says so, and nothing on this site quotes a value the code did not actually produce. That policy is cheap to state and it is the reason the small positions keep recurring — they are not chosen for simplicity of exposition, they are the positions an exact answer exists for.

Who found it, and when

The definition by difference is Conway’s, from On Numbers and Games, 1976, and it is the first substantial definition in the book. Its placement is deliberate: the ordering comes before the numbers, because the numbers are defined by their position in the ordering.

The recognition that the order must be partial, and that confusion is a relation rather than a failure, was the conceptual step. Earlier treatments of specific games had noticed that some positions were hard to rank; the theory’s move was to make the difficulty a definition and prove things about it.

The notation \parallel, and the reading “fuzzy” as an alternative to “confused”, are from Winning Ways, 1982. “Fuzzy” has stuck in the impartial literature and “confused” in the partizan, which is a small unnecessary confusion of its own.

What the definition assumes

One hypothesis is buried in the definition and worth surfacing.

“Left wins GHG - H moving second” presumes the difference is a game that ends. If it does not, there is no winner and the relation is undefined — which is why loopy games need a different comparison entirely, built on fixed points rather than on play.

It also presumes the negation H-H is available, which it always is for short games and which is a substantive construction: swap the players at every level, recursively. For an impartial game that swap is the identity, so every impartial position is its own negative and G+G=0G + G = 0 — the fact that makes two equal Nim heaps a second-player win.

Why totality had to go rather than additivity

The order is partial, and it is worth being clear that this is a choice made under a constraint rather than a shortcoming to be apologised for. Two properties were available and they cannot both be had.

Additivity says that if GHG \ge H then G+XH+XG + X \ge H + X for every XX. That is what makes a value a value: it is the licence to replace a component by an equal one anywhere, which is the whole apparatus of sums, canonical forms and substitution.

Totality says that any two positions are comparable — one of the three familiar relations always applies, as it does for numbers.

Star and nought are enough to show that the two cannot coexist. If the order were total, \ast would be above, below or equal to nought. It is not equal, since \ast is a first-player win and nought is not. Suppose >0\ast > 0; then adding \ast to both sides gives +>\ast + \ast > \ast, and +\ast + \ast is nought, so 0>0 > \ast — a contradiction. The other direction is the same argument mirrored. So a total order that respects addition does not exist on these objects, and something had to be given up.

Giving up additivity would have produced a relation that orders every pair and says nothing about any sum, which is a relation about single positions in a subject about boards. Giving up totality produces exactly what this page describes: a relation that always tells the truth and sometimes declines to answer.

That is why the fourth relation is not an admission. It is the price of the property the theory is built to have, paid once, in the definition, and everything downstream is the return.

Where the model stops

Normal play, throughout. Under misère play the substitution theorem fails — winning the difference moving second no longer implies substitutability — and comparison stops being useful.

The comparison is exact and expensive. Every relation quoted on this site was computed on a position small enough to compute it. Large positions are beyond exact comparison, and no approximate version of the definition is available.

A comparison is not a move. Knowing G>HG > H does not say how to play either.

Confusion carries no magnitude. Two positions are confused or not; there is no measure of how confused. Approximate answers to that question are what temperature and atomic weight provide, and both are separate constructions rather than refinements of the order.

The ladder from here

comparison opens here with the relation itself: what it means for one position to be at least as good as another, and why the definition quantifies over every sum there is.

Comparison is a search says what that costs. There is no way to look at two games and see which is better — the question is answered by building GHG - H and asking who wins it — so the most basic operation in the theory is a decision problem, and every canonical form on this site is built out of thousands of them.

Confused is not the same as unknown takes the answer a reader is least prepared for. Two positions can be neither greater, nor smaller, nor equal; that is a fourth relation with its own symbol, it is a fact about the pair rather than a limit of the method, and it is what makes a game worth playing at all — a position is a first-player win exactly when it is confused with nought.

How rare it is to be bigger then counts how often each answer comes back, and the proportions run against everything a reader brings from the number line. On day two, 179 of 231 pairs are comparable and 13 of the 22 values compare with nought. One day out those shares fall to 60 per cent and 29, and the largest set of mutually incomparable values rises from four to at least twenty-three.

So the exceptional answer is the ordinary one, and it becomes more ordinary the deeper the construction goes. Comparison is the exception; confusion is what values normally do to one another, and the partial order introduced here is far more partial than its first day suggests.

Part 1 of 6

One argument about Comparison. 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 8 sharing most with it of 60.

What this makes readable

Essays that declare this one a prerequisite.

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.

AdditivityComparisonConfusionDifferenceEqualityPartial orderStar (∗)SubstitutionTempo