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.

Assumes: Reading a thermograph · Playing the hottest

An endgame is a sum. The board has broken into regions that no longer interact, each region is worth something on average and has something at stake, and the game is the process of taking them one at a time in some order.

If the order were forced, the arithmetic would be trivial. It is not forced — each player chooses — and the choice turns out to be almost forced anyway, which is what makes an account possible.

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.
Fig. 1 Three independent regions, each a fight between two settled numbers. The account adds what each is worth on average, then adds the biggest amount at stake, subtracts the next, and adds the third. The exact value of the whole position is computed alongside it and the two are printed together.

The account

Order the regions by what is at stake — hottest first. Write down the sum of their mean values, which is what the position is worth once everything has settled. Then correct for who gets what.

Left, moving first, takes the hottest region and gains its temperature over the settled value. Right then takes the next and gains theirs, which counts against Left. Left takes the third, and so on down, alternating.

Left’s score  =  imi  +  t1t2+t3t4+\text{Left's score} \;=\; \sum_i m_i \;+\; t_1 - t_2 + t_3 - t_4 + \ldots

with the temperatures in decreasing order. That is the orthodox account, and it is the working formula of endgame analysis.

For the three regions in the figure — {40}\{4\mid0\}, {31}\{3\mid1\}, {20}\{2\mid0\} — the means are 22, 22 and 11, summing to 55; the temperatures are 22, 11 and 11, alternating to 22. The account predicts 77.

The recursion, asked what Left really gets moving first in the sum of those three games, returns 77.

Why it works

The argument has two halves and both are short.

Hottest first is right. If a player takes a smaller region while a larger one is available, the opponent takes the larger, and the difference between the two temperatures is lost. That is the practical content of temperature, and against simple switches it is exact rather than approximate.

The alternation is forced. Once a region has been taken it is settled and contributes only its (now determined) value; the next player faces the same problem with one fewer region. So the sequence of moves is: hottest, next, next, down to nothing, with the players alternating throughout.

Put the two together and the score is the settled total plus an alternating sum of what each player gained by moving when they did. Nothing else is available to either of them.

The alternation is easiest to watch on the smallest board that has one, where the correction is a single pair of terms and they are the same size.

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.
Fig. 2 Two regions of equal stake. Each settles at 1 and each is worth 1 to move in, so the account writes +1+1 for the region Left takes and 1-1 for the one Right takes, and the correction cancels exactly: the board is worth its settled total of 2 and no more. The recursion agrees. A board of paired-off fights is a board on which moving first is worth nothing at all.

Where it fails

The account is exact for sums of simple switches and it is not exact in general. The failure is specific enough to construct, and constructing it is more use than describing it. Two regions are enough — the smallest board on which the two numbers come apart.

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.
Fig. 3 The smallest failure there is. One plain fight and one whose Right option is itself a fight: the means come to 112\tfrac{11}{2} and the alternating stakes to 12\tfrac12, so the account predicts 6, and the recursion says Left moving first gets 7. Nothing here is crowded or delicate; the second region is simply not finished after one move.

Putting the same region on the essay’s running board changes nothing about the size of the error, which is the point of drawing it twice.

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.
Fig. 4 The same three regions with a fourth added — one whose Right option is itself a fight rather than a settled number. The account predicts nine; the recursion says ten. The difference is one point, exactly as on the two-region board, and it is not a rounding error.

The added region is {5{31}}\{5 \mid \{3 \mid 1\}\}. Left may take it and get 55. Right may move in it, and what Right’s move produces is not a number — it is another fight, worth {31}\{3\mid1\}, which somebody still has to resolve.

That is the structure the account cannot see. Its whole model is “each region is taken once and then it is settled”, and this region is not settled after one move. A player who takes it has not finished with it; there is a second move in there, and the second move happens at a different temperature from the first.

Formally: the region’s thermograph has a bend. Its temperature — the height at which the walls finally meet — is one number, and the height at which its inner fight cools out is another, and the account records only the first.

The two shapes are worth holding in mind side by side. A simple switch has straight walls and one temperature; a position with a fight inside it has a wall that bends where the inner fight finishes cooling, and the bend is that follow-up’s own temperature rather than anything about the region as a whole. Both heights are things a player has to know, and a region deep enough to bend twice carries three of them. The account has room for one.

Following the line of play

The account is a formula, and a formula is easier to trust after the play it summarises has been walked through once.

Start from the three simple regions. Left moves first.

Left takes {40}\{4\mid0\}, the hottest, and it becomes 44. The board is now 4+{31}+{20}4 + \{3\mid1\} + \{2\mid0\}.

Right takes {31}\{3\mid1\}, the hottest remaining, and holds it to 11. The board is 4+1+{20}4 + 1 + \{2\mid0\}.

Left takes {20}\{2\mid0\} and it becomes 22. The board is 4+1+2=74 + 1 + 2 = 7.

Seven, which is what both the account and the recursion said. And the arithmetic of the account is visible in the walk: the settled total 2+2+1=52+2+1 = 5 is what the regions would have come to if every fight had been split down the middle, and the corrections +2+2, 1-1, +1+1 are what each player gained by being the one to resolve their region.

The order matters and can be checked by departing from it. If Left opens by taking {20}\{2\mid0\} instead, Right takes {40}\{4\mid0\} and holds it to 00, Left takes {31}\{3\mid1\} and gets 33, and the total is 2+0+3=52 + 0 + 3 = 5. Two points worse, which is exactly the difference between the temperatures of the region Left should have taken and the one Left did.

Which part to move in. A sum, and every move one player has in it. Each row is a component, the option taken in it, and what the whole position becomes. The values of the parts say who wins; they do not say where to play, and the winning move here is in the component worth the least.
Fig. 5 Every move Left has in the same three regions, with the outcome of the whole position after each. The account says which one to take; this listing says which ones win, and on a position of simple fights the two agree — which is the claim the account is making and is not entitled to assume.

The precondition is visible in the picture

The account’s two limitations — it is exact on simple switches, and it cannot handle sente — are listed separately, one in the body and one at the end. They are the same limitation, and saying so gives the formula a precondition a reader can check without computing anything.

A wall bends where an option is itself contested. A region with two settled options has straight walls; a region whose option is a fight has a wall with a corner in it, and the corner is the follow-up.

A region with no follow-up can never be sente. There is nothing below it for an answer to be worth, so no ambient temperature makes a reply forced — the exchange is one move and the account’s model of one move per region is exactly right.

So the three conditions are one: straight walls, no follow-up, never sente. The account is exact where they hold and out by a point in the essay’s own counterexample, which is the smallest region that breaks all three at once.

That turns the caveat into a test. Draw the regions’ thermographs and look for a corner. No corners, and the alternating sum is the answer; a corner anywhere, and the account has used one temperature for a region that needs two. It is a check a player can make on a picture, and it is a good deal more useful than “beware of sente”, which requires knowing what sente is before knowing whether it applies.

The correction is the same alternating sum as the guarantee

The other half of the formula is worth recognising too, because this site has met it elsewhere under a different name.

t1t2+t3t4+t_1 - t_2 + t_3 - t_4 + \cdots

is an alternating sum of a decreasing sequence, and such a sum is at most its first term. So the account’s whole correction — everything beyond the settled total — is bounded by t1t_1, the largest temperature on the board.

That is exactly the guarantee playing the hottest carries: never more than the largest temperature away from the mean. The two are not analogous statements; they are the same arithmetic, computed and bounded.

The relationship between them is worth stating precisely. The greedy rule bounds the correction without evaluating it — it says the total is within t1t_1 of the settled sum, whatever the regions are, including ones with bends. The account evaluates the correction exactly, and pays for the exactness with a precondition. One is a guarantee that always holds and says little; the other is an answer that says everything and holds sometimes.

And it explains why the failure above is small. The account is not wrong in kind when a region bends; it has computed the right alternating sum with one term slightly off, and the term is a temperature, so the error inherits the same ceiling. A point out of ten is what a mistake in one term of a bounded alternating sum looks like — not a collapse, and not something a larger board makes worse in proportion.

Which is the reason the account survives in practice despite being provably incomplete. Go endgames are mostly plain fights with a few follow-ups; the precondition fails on a minority of regions; and where it fails, the alternating sum’s own shape keeps the damage inside the bound the greedy rule would have given anyway. The account is a sharpening of a guarantee rather than a replacement for one, and the sharpening is exact on the regions that have nothing hidden inside them.

What the solver computed, and how

Both numbers in every account figure come from the same machinery, by different routes, and the figure prints them together precisely so that they can disagree in public.

The predicted number is arithmetic on thermograph outputs. Each region’s thermograph is computed; its mean and temperature are read off; the regions are sorted by temperature; the alternating sum is formed.

The actual number is not arithmetic at all. The regions are added with add into a single game, that game’s thermograph is computed from scratch, and Left’s wall is evaluated at zero tax — which is precisely “what Left gets moving first”, by the definition of the wall.

The two computations share the thermograph recursion and nothing else. One of them never forms the sum; the other never looks at an individual region.

The site’s gate requires the first arrangement to agree exactly and the second to disagree. A check that only demanded agreement would pass just as well if the alternating sum were replaced by something that happened to be right on one example, and a check that only demanded disagreement would pass on a broken thermograph. Requiring both, on the same machinery, is what makes either worth anything.

The same discipline governs where the account’s inputs come from. A temperature quoted here is not half the gap between two options — that formula is only right for a simple switch, and the whole point of the second figure is a region where it is not right. Every temperature is the height at which the two walls of a computed thermograph meet, found by solving for the crossing on the interval where the sign of their difference changes. For a simple switch the two agree, and the agreement is a consequence rather than an assumption.

Where the model stops

Sente and gote. The largest omission in the account as stated is the distinction between a move that demands an answer and one that does not. A sente move is one whose threat is so large that the opponent must reply locally, so the mover keeps the initiative and effectively moves twice. The alternating sum assumes strict alternation and does not model that at all, and every serious treatment of Go endgames spends most of its length on it.

Regions with several bends. The failure above is the smallest case. A region whose thermograph bends twice needs the account applied twice at different heights, and the general version of that is considerably more involved than an alternating sum.

Ties in temperature. When two regions have equal temperature the ordering is not determined, and the account gives the same answer either way — but the play may differ, and which one is taken first can matter through an infinitesimal that the temperatures cannot see.

The decomposition has to be real. Every region must be genuinely independent. In a real board the regions are separated by walls that are themselves part of the position, and deciding whether two regions interact is not something the account can do — in some games the separation only arrives partway through the play.

Normal play, and no chance. As everywhere here.

The regions the account is comfortable with are easy to state and easy to recognise: each is a fight between two settled numbers, with one mean, one temperature, one move, and then it is over. The account is exact on any collection of those and on nothing more complicated, which is a precondition a player can check region by region rather than a caveat to be remembered.

How large the error can be

The failure above cost one point. The useful question is whether it can cost more, and the answer is the reason the account is used at all despite being wrong.

The error is bounded by the largest temperature in the position. Whatever the internal structure of the regions, a player following hottest-first finishes within t1t_1 of optimal, and usually far closer. On an endgame with one large fight and a dozen small ones, that bound is a small fraction of the total; on an endgame that has come down to two regions of equal size, the bound is the whole of what is left.

So the account is a good approximation exactly when the temperatures are spread out and a poor one when they are bunched — which is a statement a player can act on, and is the same shape as the observation that knowing the values does not settle where to move. A position with one clearly biggest move is easy and the theory says so; a position with three moves of equal size is hard and the theory says that too.

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.
Fig. 6 An endgame with the temperatures well separated: one large fight and two small ones. The account is exact here, and would remain a good estimate even if a region had structure the account could not see, because the error a single bend can introduce is small relative to the leading term.

What the account is not saying

Three misreadings are easy and all three change the claim substantially.

It is not saying the score is the sum of the means. That is the first term only, and the alternating correction is not a small adjustment to it — in the worked example it is two points out of seven. A player who counts territory and stops has computed the settled total and omitted the entire question of who moves.

It is not saying that the biggest move is the most valuable. Temperature is what is at stake in a region relative to its own settled value. A region with temperature 11 and mean 2020 contributes twenty points to the total and one point to the fight, and the fight is what the ordering is about. Confusing the two produces the common error of playing where the points are rather than where the decision is.

It is not a claim about a specific board. The account takes a decomposition as given. Everything in this essay is arithmetic on regions that have already been identified, evaluated and confirmed independent, and none of those three steps is what the account does.

The step that comes before the account is not part of it: several components have to be identified on a real board, evaluated one at a time, and confirmed independent, and the total is then computed by adding the games rather than the labels. Producing that decomposition is the work; the account is what happens afterwards.

The third misreading is the expensive one in practice, because identifying the regions of a real position is where a strong player’s judgement goes and the theory has nothing to offer there. What the theory offers is a guarantee about what happens after the identification, and the guarantee is exact on simple fights and bounded otherwise.

The generalisation

The correct general object is not a number but a thermograph, and the correct general operation is not an alternating sum but thermographic addition.

The thermograph of a sum can be computed from the thermographs of the parts, in a way that respects the bends — this is the content of the sum theorem for thermographs, and it holds under a condition on the components. Where the condition holds, the whole apparatus becomes exact and the alternating sum is what it degenerates to when every component is a simple switch.

Berlekamp’s endgame theory is largely the work of making that exactness available on real Go positions, and it needed two further ideas: a way to handle sente, and a way to handle the infinitesimals that decide the last few moves. Neither is visible in the account this essay describes, and both are necessary.

The pattern is by now familiar. The simple version is exact on the simple case, the general version is exact and heavy, and the space between them is where a stated error bound lives.

Who found it, and when

The account is folklore among strong Go players in a qualitative form — count the big points, take the biggest, alternate — and has been for centuries. Japanese endgame manuals from the Edo period contain move-value tables that are recognisably the same arithmetic.

The formalisation is Conway and Berlekamp’s, from around 1970, and the thing it added was the bound: not merely that hottest-first is a good idea but that it is within a stated amount of optimal, and that the amount is the largest temperature.

Berlekamp’s later work with students turned the theory into a practical system, and its most-cited result is a series of constructed Go endgames in which the method reliably beat professional players who were using judgement. The professionals were not making mistakes in the ordinary sense; they were using an accounting that could not see the last point, and the method could.

The ladder from here

This anchor began with reading a thermograph — one position, two walls, two numbers. This rung spends those numbers on a whole board and finds the exact conditions under which the spending is legitimate.

Later rungs: sente and gote, and what a move that demands an answer does to the alternation. The sum theorem for thermographs and the condition it needs. Multiple bends, and the account applied at several heights. The infinitesimal endgame, where every temperature is zero and the ups decide. And the practical question of recognising a decomposition on a real board, which the theory does not address and a player cannot avoid.

The thing to carry is the discipline of printing both numbers. An estimate that is never compared with the exact answer is not an estimate; it is a claim, and the two figures on this page differ by one point precisely because both were computed.

Part 2 of 8

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

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.

Alternating sumDecompositionEndgameError termOrthodox accountingSenteSwitchTemperatureThermograph