Temperature

What is at stake

Some positions both players are desperate to move in, and some neither player wants to touch. The difference is a number — how much the move is worth — and it turns out to be the most useful single quantity for deciding where to play.

Two positions sit on a board. In the first, whoever moves gains a great deal and whoever waits loses it. In the second, moving gains nothing and there is no hurry at all.

The difference is not about who wins either position. It is about how much is at stake, and it has a number.

The thermograph of {5 | 1}Temperature runs up the page and value across it. Each wall is where a player is willing to move once a tax of that much is charged per move; above the temperature at which they meet, neither wants to move and the position is worth its mean value. The height of the meeting point is what is at stake.012345601234valuetemperaturetemperature 2mean 3Left's wallRight's wall{5 | 1} — mean 3, temperature 2
Fig. 1 A position where Left can reach five and Right can reach one. Its mean is three and its temperature is two, and both are read off the walls of this diagram rather than estimated.

Switches

The simplest hot position is {51}\{5 \mid 1\}: Left moves to a position worth five, Right to one worth one.

Both options are numbers, so the simplicity rule is the obvious tool — and it does not apply, because it requires Left’s option to be below Right’s, and here it is above. That failure is the definition of a hot position.

What happens instead is that both players want to move. Left moving gains: the position becomes five rather than whatever it would have been. Right moving gains equally in the other direction. So the position is worth fighting over, and its worth splits into two parts:

The mean, 5+12=3\tfrac{5+1}{2} = 3, which is roughly what the position is worth if the move is shared fairly.

The temperature, 512=2\tfrac{5-1}{2} = 2, which is how much moving there gains.

Written together, {51}=3±2\{5 \mid 1\} = 3 \pm 2: a value of three, plus or minus two depending on who moves. Such positions are called switches, and they are the basic hot object.

Cold positions

A number is the opposite. 34\tfrac34 is a position where Left’s options are all below 34\tfrac34 and Right’s all above it, so moving in it loses ground for whoever moves.

That is the number-avoidance theorem in its practical form: moving in a number is never necessary and usually a mistake. In a sum containing a number and something else, there is always a move at least as good outside the number.

So numbers are cold — settled, worth what they are worth, not worth touching. Their temperature is negative, and by convention the temperature of a number xx is 1-1 or lower depending on the convention chosen; what matters is that it is below zero and below every hot position.

The vocabulary is from Go, where “big” and “urgent” moves are distinguished and where the settled parts of the board are exactly the cold ones.

The picture is the numeralBlue-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.1blue2blue blue1/2blue red3/4blue red blue1/4blue red red3/8blue red red blueeach string is worth a number, and the string spells itblue is Left · red is Right · the ground is what holds it up
Fig. 2 Positions worth numbers. Every one of these is cold: whoever moves in it gives ground, so on a board containing anything else these are the last places to play.

The definition of temperature

The informal version above works for switches. The general definition is a cooling operation.

Cooling a game GG by tt, written GtG_t, is the game in which every move costs a tax of tt:

Gt={GtLtGtR+t}G_t = \{\, G^L_t - t \mid G^R_t + t \,\}

with the proviso that once the result is a number, further cooling leaves it alone.

As tt increases, the tax makes moving less attractive, and eventually it makes moving pointless — the cooled game becomes a number and stays one. The temperature of GG is the smallest tt at which that happens, and the number it becomes is the mean value.

For {51}\{5 \mid 1\}: cooling by tt gives {5t1+t}\{5 - t \mid 1 + t\}, which is still hot while 5t>1+t5 - t > 1 + t, that is while t<2t < 2. At t=2t = 2 both options equal three and the simplicity rule applies, giving the number three. So temperature two, mean three, matching the informal computation.

The general definition is worth having because most positions are not switches. It applies to any finite game and always terminates.

Why one number is enough to choose a move

The practical claim is this: on a board of several independent components, play in the hottest one.

The reasoning is an exchange argument. Each move in a hot component gains roughly its temperature. If a player takes a cooler component while a hotter one is available, the opponent takes the hotter one, and the difference between the two temperatures is lost. Repeating the comparison across the whole sequence of moves shows that playing hottest-first is optimal up to a bounded error.

That is not a theorem in the strong sense — the rule is not exactly optimal — but the error is small and bounded, and the rule is dramatically better than anything else available for large boards. It is the reason temperature theory is used in practice where exact evaluation is out of reach.

Move where it is hottestFour independent components of one position, ordered by temperature. The temperature is how much a player loses by moving somewhere else instead, so the hottest component is the one to take — and a component that is already a number has no temperature at all, because nobody gains by moving in it.{6 | 0}t = 3a big fight{2 | 0}t = 1a smaller one{1 | 0}t = 1/2small change{0 | 1}no temperaturesettled — a numbercomponenthow much is at stakethe whole position is worth {{{19/2 | 17/2} | {15/2 | 13/2}} | {{7/2 | 5/2} | {3/2 | 1/2}}}and the first move goes in the hottest part, which is a theorem up to a small error rather than a rule of thumb
Fig. 3 Several components with their temperatures. The rule is to play in the hottest, and the ordering of temperatures is the ordering of urgency on the board.

The two questions temperature separates

The reason this quantity is useful is that it disentangles two things that are otherwise confused.

How much is this component worth? The mean value. It is a number, it adds like a number, and it says what the component contributes if the moves in it are shared.

How urgent is it? The temperature. It says how much the next move there gains, which is what decides where to play now.

A component can have a large mean and low temperature — a big settled advantage that nobody needs to touch. Or a small mean and high temperature — a nearly balanced fight where the next move swings a lot. The first can be ignored; the second cannot, and no single number that mixed the two would say so.

Go players have names for both and have had them for centuries: the size of a move and its urgency. Temperature theory is the formalisation, and the correspondence is exact enough that the theory made contributions back to Go endgame practice.

Sente and gote

Two Go terms deserve importing, because temperature explains them and they explain temperature.

A move is sente when the opponent must answer it — playing elsewhere would cost more than answering. A move is gote when the opponent is free to ignore it and play elsewhere.

In temperature terms: a sente move is one whose follow-up is hotter than anything else on the board, so leaving it unanswered concedes a large gain. A gote move is one whose follow-up is not.

The consequence is that sente moves are close to free — they are made, answered, and the initiative returns — while gote moves cost the turn. So a player wants to play sente moves first and save gote moves, which is exactly the ordering the play-the-hottest rule produces when the follow-up temperatures are accounted for.

What temperature adds to the traditional vocabulary is that sente and gote are not properties of a move in isolation. They depend on what else is on the board: a move is sente when its follow-up beats the current board temperature, so the same local position can be sente early and gote late. Go players know this and describe it as a move “becoming gote”; the theory says precisely when.

Move where it is hottestFour independent components of one position, ordered by temperature. The temperature is how much a player loses by moving somewhere else instead, so the hottest component is the one to take — and a component that is already a number has no temperature at all, because nobody gains by moving in it.{6 | 0}t = 3a big fight{2 | 0}t = 1a smaller one{1 | 0}t = 1/2small change{0 | 1}no temperaturesettled — a numbercomponenthow much is at stakethe whole position is worth {{{19/2 | 17/2} | {15/2 | 13/2}} | {{7/2 | 5/2} | {3/2 | 1/2}}}and the first move goes in the hottest part, which is a theorem up to a small error rather than a rule of thumb
Fig. 4 Components ordered by temperature. Which of these is sente depends on the temperatures of the others, which is why the property belongs to the board rather than to the move.

Reading a switch

The switch notation compresses a common shape and is worth unpacking once.

G=m±tG = m \pm t

means G={m+tmt}G = \{m + t \mid m - t\}: Left moves to m+tm+t, Right to mtm-t, the mean is mm and the temperature is tt.

{51}=3±2\{5 \mid 1\} = 3 \pm 2. {10}=12±12\{1 \mid 0\} = \tfrac12 \pm \tfrac12. {00}\{0 \mid 0\} would be 0±00 \pm 0, except that the position is \ast and its temperature is zero — a position where the move is worth having and gains nothing, which is the boundary case between hot and cold.

Switches add in a limited way. (m1±t1)+(m2±t2)(\,m_1 \pm t_1\,) + (\,m_2 \pm t_2\,) has mean m1+m2m_1 + m_2 — the means add exactly — and its temperature is not t1+t2t_1 + t_2, nor max(t1,t2)\max(t_1, t_2), nor anything so tidy. The sum is generally not a switch at all: it is a position with four options and a thermograph with more vertices than either part had.

That is the concrete form of the asymmetry below, and the reason switches are a starting point rather than a normal form.

Not every hot position is a switch

The switches are the easy case and they are not typical.

A switch has exactly one option each way, both numbers. A general hot position has options that are themselves hot, so moving in it leads to another fight rather than to a settled number. Those follow-ups are what make Go endgames intricate and what makes the thermograph a diagram rather than two numbers.

{{42}0}\{\{4 \mid 2\} \mid 0\} is such a position. Left’s move leads to a switch, not a number, so evaluating it means evaluating that switch first and then asking what the outer position is worth given the inner one. The thermograph handles this automatically — the walls of the outer position are built from the walls of the inner — and it is where the diagram earns its complexity.

The thermograph of {4 | 2}Temperature runs up the page and value across it. Each wall is where a player is willing to move once a tax of that much is charged per move; above the temperature at which they meet, neither wants to move and the position is worth its mean value. The height of the meeting point is what is at stake.1234501234valuetemperaturetemperature 1mean 3Left's wallRight's wall{4 | 2} — mean 3, temperature 1
Fig. 5 A narrower switch. The walls meet lower because less is at stake, and the whole diagram is one node inside the thermograph of any position that has this as an option.

What the solver computed

thermograph(g, tMax) in lib/cgt.js builds the left and right walls of the diagram by evaluating the cooled game at a series of temperatures and recording where each player’s best option lies.

The walls are exact piecewise-linear functions rather than sampled curves. Each is computed from the cooled options recursively, so a vertex in the wall is a point where the best option changes, and the site’s rule is that the temperature is read off as the height at which the two walls meet — a computed intersection, not a place where two drawn curves appear to cross.

For {51}\{5 \mid 1\} the code returns mean three and temperature two. That was checked by hand against the switch formula before any figure was drawn, and assertValue re-checks it on every build. For {20}\{2 \mid 0\} it returns mean one, temperature one. For {10}\{1 \mid 0\}, which is not hot — Left’s option exceeds Right’s, so it is a switch — mean 12\tfrac12, temperature 12\tfrac12.

The case that matters for the code’s correctness is a cold one. For the number 12\tfrac12 the two walls coincide from the bottom of the diagram upwards, and the temperature comes back negative — the code reporting a settled position, rather than failing to find a crossing and returning something arbitrary.

The temperature of the small values

The values that decide close games sit at the bottom of the temperature scale, and their temperatures are worth knowing.

\ast has temperature zero. Moving in it gains nothing — both options lead to zero — but the move is worth having, since whoever moves wins it alone. Temperature zero is exactly this boundary: nothing at stake, and the tempo still matters.

\uparrow has temperature zero as well, and so does every infinitesimal. They are not hot; there is nothing to fight over in them.

Every number has negative temperature, and by the number-avoidance theorem nobody wants to move there.

So the scale is: hot positions above zero, ordered by how much is at stake; the infinitesimals and nimbers exactly at zero; numbers below. And a game passes down that scale as it ends — the hot fights get resolved first, then the temperature-zero residue decides the outcome.

That is the sense in which infinitesimals decide close games. They are what is left when the temperature reaches zero, and if the numbers have cancelled by then they are all that is left.

Where mean values do and do not add

A caution that catches people, and that is the main limitation of the whole approach.

Mean values do add: the mean of a sum is the sum of the means. That is what makes them worth computing.

Temperatures do not. The temperature of a sum is not the sum, maximum or any other simple function of the component temperatures. A sum of two components at temperature two is not at temperature four, and usually not at temperature two either.

That asymmetry is why the play-the-hottest rule is a heuristic rather than a theorem. The means compose exactly and give the right answer about who is ahead; the temperatures do not compose and give an ordering of moves that is approximately right. Everything useful and everything approximate about temperature theory descends from that one fact.

What a deeper position does to the shapeTwo thermographs. The first is a simple switch and its walls are straight; the second has an option that is itself a fight, and the wall bends where that inner fight cools out. Every bend in a thermograph is a decision changing hands.24012345{4 | 0}temperature 2 · mean 224012345{4 | {2|0}}temperature 3/2 · mean 5/2
Fig. 6 Two positions and their thermographs side by side. The means add exactly; the temperatures do not, which is why the diagrams are read separately rather than combined.

Where it came from

Temperature theory came out of Go, and specifically out of the observation that skilled players evaluate endgame moves by size and play them in order.

The mathematical development is Conway’s — cooling and heating appear in On Numbers and Games — and the applied development is Elwyn Berlekamp’s, from the 1980s onwards. Berlekamp and David Wolfe’s Mathematical Go (1994) analyses real Go endgames by these methods and produced positions in which the theory outplayed professional players, which is a rare and rather satisfying outcome for a piece of combinatorial theory.

The “thermograph” name and the diagram are Conway’s, and the vertical axis being temperature with the walls converging upward is his convention, which every subsequent treatment has kept.

Two numbers, two uses

The summary worth carrying away is that temperature theory replaces one hard object with two easy ones, and they are used for different things.

The mean is for adding up. It composes exactly, and the sum of the means over a decomposed board says who is ahead.

The temperature is for choosing. It does not compose, and its only use is comparative: this component is hotter than that one, so play here first.

Confusing the two produces the standard error of quoting a mean as though it were a position’s worth to a player about to move. A position with mean three and temperature two is worth five to whoever moves and one to whoever does not, and the mean is neither of those numbers — it is what the position contributes when the moves in it are shared, which is a statement about sums and not about play.

The compression is worth what it costs. An exact value is a tree and is unusable at the board; two numbers per component can be held in mind across a dozen components, which is the scale a real endgame has. That trade — exactness for usability, with the error stated — is the same one atomic weight makes at the cold end of the scale, and the two together cover most of what a player needs.

Where the model stops

Temperatures do not add. As above, and this is the central limitation.

The rule is approximate. Playing the hottest component is not always optimal. The error is bounded but real, and constructed counterexamples exist.

It requires decomposition. Temperature is a property of a component, and a board that has not broken into independent regions has no components to compare. This is why the theory is an endgame theory.

Cooling is a computation, and an expensive one. Building a thermograph means evaluating cooled games at many temperatures, and exact evaluation has a low ceiling. The thermographs on this site are of positions small enough to compute exactly.

Normal play. As everywhere here.

The ladder from here

Next: reading a thermograph, which is the diagram taken apart properly, and playing the hottest, which is the rule and its failure cases.

Beyond: cooling and heating as inverse operations; orthodox accounting in Go endgames; the sente and gote distinction and what temperature says about it; and thermographic addition, which is the closest thing to a rule for combining temperatures and is not one.