Out in the world

Four boxes for every chain after the first

Nimstring answers who is forced to open and says nothing about the score. The margin has a formula: the controller nets the total less four boxes for every long chain after the first — two surrendered and two not taken, each time control is kept. Checked against the solver on 175 endgames it is exact on 172, never too generous, and exact wherever it promises the controller anything at all. The three it misses are the three where it promises nothing.

Assumes: A thousand positions and no exception · The chains decide it before the boxes do

Everything measured here since the chains decide it answers one question: which player ends up having to open. That is the Nimstring question and it is the question the scoring game keeps asking, and it is not the question a player is playing.

A player is counting boxes. Knowing who is forced to open says who is ahead and not by how much, and the margin has a formula.

What control is worth, to a box. The margin the player who does not have to open nets, beside the formula that predicts it: the total less four boxes for every long chain after the first. Computed against the solver on every endgame of long chains in range.
Fig. 1 The margin the player who does not have to open nets, beside the formula that predicts it: the total less four boxes for every long chain after the first. Computed against the solver on every endgame of long chains in range.

Where the four comes from

The whole of it is one comparison, made once per chain.

An opened long chain offers its taker two branches, and they are the two the earlier essay prices. Take the lot: pocket every box in it, and then be obliged to cut again — which means opening the next component. Decline the tail: take all but the last two boxes, cutting so that the opponent can complete those two, and the opponent is then obliged to open the next thing.

The difference between the branches is four boxes. The decliner gives up two they could have taken, and the opponent gains those same two, so the margin swings by twice the fee. What the decliner buys with it is the obligation to open, handed back.

So a player keeping control pays four boxes for each chain they decline, and declines every chain but the last. The last one they take whole, because there is nothing left to be forced to open. Total, less four for every chain after the first.

3 + 3 boxes, and the choice that decides them. A Dots and Boxes endgame as a row of chains, with the two replies to an opened chain drawn side by side. Taking the whole chain wins those boxes and forces the taker to open the next one; declining the last two surrenders them and hands the obligation to open back. Both totals are computed by playing the rest of the position out, and the better branch is the one shaded.
Fig. 2 Two long chains, the smallest position where control costs anything. The opener nets minus two: the other player declines the first chain, giving up two boxes to force the opener into the second, and then takes all three of those. Six boxes, one decline, four paid.

One consequence of that arithmetic is worth extracting before the counts, because it is the thing a player would use. The fee does not depend on the chain’s length. Declining a chain of three costs four and declining a chain of twelve costs four, because the two boxes surrendered are the last two either way. So a long chain is worth its length to whoever takes it and costs a flat four to whoever declines it, which means the controller wants the chains they decline to be short and the one they take to be long.

That is the opposite of the instinct a player brings. The chain everybody wants to be handed is the biggest one, and the formula says the biggest one should be left until last rather than taken first — because taking it is free and declining it costs the same four as declining a small one. The order is the strategy and the total is unaffected by it, which is why the formula has no order in it at all.

What the formula gets right

Over 175 endgames of long chains inside a budget of twenty-four boxes, the formula is exact on 172.

More usefully, it is exact in a describable place. It is never too generous — it never promises the controller more than the solver gives — and it is exact wherever it promises anything at all. Every position on which it predicts a positive margin, the solver agrees to the box.

Two chains of five: total ten, one decline, margin six. Three chains of four: total twelve, two declines, margin four. A single chain of seven: no declines at all, margin seven, because with one component there is nothing to be forced into and the whole thing is taken.

5 + 5 boxes, and the choice that decides them. A Dots and Boxes endgame as a row of chains, with the two replies to an opened chain drawn side by side. Taking the whole chain wins those boxes and forces the taker to open the next one; declining the last two surrenders them and hands the obligation to open back. Both totals are computed by playing the rest of the position out, and the better branch is the one shaded.
Fig. 3 Two chains of five. Ten boxes, one decline, and a margin of six to the player who does not have to open — which is what the formula says and what the solver gives.

What a wrong formula would have looked like

A formula tested against a solver on 175 positions is worth something only if it could have come out otherwise, and the two ways it could have are worth naming.

Too generous somewhere. A formula that over-predicts is a formula promising boxes that are not there, and a player using it would be steering into positions worse than they thought. That is the dangerous direction and it does not happen once: on all 175 positions the solver gives the controller at least what the formula says.

Wrong in both directions. A formula wrong sometimes high and sometimes low is not a floor and not a ceiling; it is an approximation with an error bar, and the only honest use of it is with the error bar attached. That would have made this essay a report of an error distribution rather than a statement about a bound.

What actually happened is the third and best case: wrong in one direction, on a describable set, and exact everywhere else. That is the shape of a result rather than of a measurement, and it is why the three failures are worth more than the 172 agreements.

The three it misses

All three failures are the same shape and the direction is the interesting part.

Where the formula stops being the answer. The endgames on which the controlled-value formula is wrong, with what it predicts beside what the solver gives. All of them are positions where the formula promises the controller nothing, and on all of them the controller does better than it says.
Fig. 4 The endgames on which the formula is wrong, with what it predicts beside what the solver gives. All of them are positions where the formula promises the controller nothing, and on all of them the controller does better than it says.

Four chains of three: the formula says twelve less twelve, which is nothing, and the solver gives two. Five chains of three: the formula says minus one and the solver gives one. Four chains of three with a four: nothing against two.

In every case the formula predicts a margin of nought or less and the truth is larger. A formula that is never too high and sometimes too low is a floor rather than a value, and the place it stops being tight is exactly the place it stops promising anything.

The reason is not subtle once the failures are lined up. Keeping control costs four a chain, and a position of many short-ish long chains does not have four a chain to spend. When the bill exceeds the boxes, the controller stops paying it: they take a chain whole somewhere, give up the obligation, and settle for a smaller kind of advantage. The formula assumes control is kept throughout and that assumption is what fails.

3 + 3 + 3 boxes, and the choice that decides them. A Dots and Boxes endgame as a row of chains, with the two replies to an opened chain drawn side by side. Taking the whole chain wins those boxes and forces the taker to open the next one; declining the last two surrenders them and hands the obligation to open back. Both totals are computed by playing the rest of the position out, and the better branch is the one shaded.
Fig. 5 Three chains of three, the largest position of its family where the formula is still exact. Nine boxes, two declines, eight paid, and a margin of one — with the bill almost exactly consuming the boxes.

Three chains of three is where it is tightest: nine boxes, two declines, eight paid, a margin of one. Add a fourth chain of three and the bill is twelve against twelve, and the controller walks away.

Why the parity and the margin are independent

The two numbers this sequence of essays produces are answers to different questions and it is worth showing that they really are independent rather than two readings of one thing.

Take three chains of four and three chains of five. Both have three long components and no short chains, so the parity law gives them the same verdict: the opener loses. Their margins are four and seven.

Now take two chains of three and two chains of three with a one-box chain added. The margins differ by the extra box, and the verdict inverts — the one-chain is a short chain, the parity flips, and the player who was losing is now winning.

So a box added to a position can change the winner without changing the margin much, and a box added elsewhere can change the margin without touching the winner. The short chains carry the parity and the long chains carry the price, and a player wanting to know both has to count two different things.

That is an unusual arrangement. In most of this collection a single value answers both questions at once: a game’s value gives its outcome class by its sign and its size by its magnitude. Here the scoring game has been split into a normal-play skeleton that answers who and an arithmetic that answers how much, and neither derives from the other.

What the formula is a formula for

It is worth separating two quantities that both get called the value of the endgame.

The controlled value is what the formula computes: the margin assuming control is kept to the end. It is a strategy’s payoff rather than the position’s value, and it is exactly right when that strategy is the right one.

The value is what the solver computes: the margin under best play by both. It equals the controlled value wherever control is worth keeping and exceeds it where it is not.

That relationship — the value is the larger of the controlled value and what abandoning control gives — is the shape a great many endgame results in this subject have. It is the reason the formula is worth having despite failing: a floor that is tight over most of its range and known to be a floor is a much better object than an approximation that could be wrong either way.

And it is a floor with a visible boundary. A player does not need the solver to know which side they are on; they need only compute the total, subtract four a chain, and see whether the answer is positive.

What it does not cover

The sweep is over long chains and nothing else, and both exclusions are deliberate.

Short chains are left out because they are not declined — a chain of one or two cannot be opened in a way that leaves the opponent a profitable decline, so the four-box comparison never arises. A short chain is tempo rather than territory, and its contribution is to the parity rather than to the margin. The law that decides the winner is about exactly those, and this formula is about exactly the others.

Loops are left out because their fee is different: four boxes surrendered rather than two, so declining a loop costs eight rather than four. The formula would become a sum of two coefficients, which is a straightforward extension and is not measured here.

So the two halves of the endgame answer two different questions with two different vocabularies. The short chains say who wins; the long chains say by how much. A position’s short chains are its parity and its long chains are its price, and neither count helps with the other’s question.

The boundary, drawn as a rule of thumb

The formula and its failure together give a player something short enough to use at the board.

Count the boxes in the long chains. Subtract four for every long chain after the first. If the answer is positive, that is the margin and control is worth keeping. If it is nought or less, control is not worth keeping and the position is close — the solver’s answer on all three failures is a margin of one or two, which is as close as a Dots and Boxes endgame gets.

3 + 3 + 3 + 3 boxes, and the choice that decides them. A Dots and Boxes endgame as a row of chains, with the two replies to an opened chain drawn side by side. Taking the whole chain wins those boxes and forces the taker to open the next one; declining the last two surrenders them and hands the obligation to open back. Both totals are computed by playing the rest of the position out, and the better branch is the one shaded.
Fig. 6 Four chains of three, where the bill first exceeds the boxes. Twelve boxes and three declines at four apiece: the formula promises nothing, and the solver gives the controller two, because at that price control stops being bought.

So the rule of thumb is not compute the margin; it is compute the margin and notice whether it is positive. A negative answer is not a prediction of a loss — it is the formula announcing that its own assumption has failed, which is a more useful thing for a floor to do than to be quietly wrong.

There is a cleaner way to say when that happens. The bill is four per chain after the first and the boxes are the total, so control is worth keeping exactly when the chains average more than four boxes each, near enough. Four chains of three average three and the formula collapses; four chains of five average five and it does not.

A long chain pays for itself when it is longer than the fee. That is one sentence and it is the whole boundary.

Boxes rather than the last cut

Dots and Boxes rather than Nimstring: the score is kept and the margin is in boxes. Everything else is the usual arrangement — a cut that frees a coin obliges another cut, the game ends when the last string is cut, and both players play to maximise their own boxes.

Three conventions of the measurement.

The margin is stated to the player who does not have to open, so a positive number is that player being ahead. The solver computes the opener’s net and it is negated once, here, rather than in every sentence.

A long chain is three boxes or more. That is the threshold at which declining becomes possible and profitable, and it is the same threshold the parity law uses and the same one that decides which forks are worth nothing.

And the budget is twenty-four boxes over at most five chains. The failures all sit at four and five chains of three, which is the corner of the range where the bill first exceeds the boxes, so the sweep is dense exactly where the interesting thing happens.

Three counterexamples, and what they are not

Nothing about where the chains came from. The theory only reaches a position once it has fallen into chains and loops, and most of a game happens before that. The formula prices an endgame that has already arrived. What it costs to arrange one endgame rather than another is the whole of the rest of the game and it is not here.

Nor does it say what a player should do. A margin of six says the controller ends six boxes ahead under best play; it does not say which string to cut, and the branch to take on an opened chain is the decision the number is downstream of.

The sweep is over chains of equal or increasing length only, since the arms of a multiset are written in one order. That is the right unit — a bag of components has no order — but it means the sweep never distinguishes two positions that differ only in which chain a player happens to look at first.

And the three failures are three. A formula wrong on three of 175 is a formula with three counterexamples, and the account of why — the bill exceeding the boxes — is a reading of those three rather than a derivation. A larger sweep might find a failure of a different shape, and nothing here rules one out.

What this adds to the two rules everybody is taught

The game in every exercise book measures both pieces of folklore against a solver: take every box available, which costs nothing on the boards children draw and a great deal on endgames, and whoever opens the first long chain loses, which is nearly right.

The formula says what the first rule costs in the currency a player is actually counting. A greedy player takes every opened chain whole, so they never decline, so they never pay four — and they never buy the obligation either. On a chain of six beside a chain of three, the player who does not have to open nets plus five playing properly and minus three obliged to take everything: nine boxes on the table and a swing of eight between the two ways of playing them.

So the four boxes a decline costs are not a cost at all in the end; they are the price of not being the one who runs out. The rule everybody is taught refuses to pay it, which is why it loses endgames by margins that look large.

That also explains why the rule survives on small boards. A board of four boxes has no chain long enough to decline — a chain needs three boxes before the two-box tail is worth surrendering — so the fee never comes due and the greedy player never pays it or fails to. The folklore is exactly right on the boards it was learned on.

Still open: the loop coefficient

The obvious extension is the one the sweep leaves out, and it is cheap.

Declining a loop surrenders four boxes rather than two, so the same comparison should give a fee of eight rather than four, and the formula should become the total less four for every long chain after the first and eight for every loop. That is a prediction with two coefficients in it and it can be checked the same way.

What makes it more than arithmetic is the order. With chains and loops together, the controller chooses which components to decline and in what order, and a loop declined early costs eight while a loop taken last costs nothing. So the formula is no longer total less a fee per component; it is a minimisation over which component is left until the end, and whether the answer is always leave a chain last is exactly the kind of claim that survives on a small sweep and fails on a larger one.

Part 7 of 8

One argument about Dots and Boxes. 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.

ComponentCountingDecompositionDots and BoxesEndgameExhaustive searchGreedy playHeuristicLoonyScoring gameStrings and coinsTempo