Go endgame values with area counting: part 1, gote
Prerequisites
None of this will make much sense unless you play Go/baduk/weiqi and already have some familiarity with endgame move value. I’ll put some references at the very end of the series.
Thanks to the folks on the BeginnerGo Discord server for helping me work through some of these ideas, especially @Taran who had come up with most of the same concepts independently.
Counting by territory
Everything that I’ve seen about counting endgame move values in Go assumes that you’re using territory (Japanese-style) counting. But it can be a big pain keeping track of four different territories (Black and White in two variations), for me at least, and I always wondered whether using area (Chinese-style) counting could be a simpler way to compute move values.
Take this classic $6$-point (swing) gote situation.
To determine the size of a move here, we compare the result of Black going first (the triangled stones are a fair average of what ensues after moves $1$ through $3$ are played) with the result of White going first:
With the traditional approach, we now squint and imagine the difference in territories between the positions at the end of each variation. In Diag. 1d below, the triangles are the points that would be Black territory only if Black went first, and the squares are the points that would be White territory only if White went first. Computing these regions requires us to keep track of four distinct types of points (territory and stones of both colors) in two variations, not to mention that there may be prisoners to track.
Switching from Black going first to White going first is a total of $6$ points difference ($3$ fewer for Black, $3$ more for White), so making the first move in this area is $6$ points in gote.
If you’re bad at doing big geometrical diffs in your head like I am, you can try to simplify this a bit by calculating values like “how much territory does Black have if they go first?” But this usually means picking some arbitrary reference point for where their relevant territory starts (how much relevant territory does Black have in Diag. 1b? $5$?) which is very easy to lose track of.
Counting by area
Using area counting instead of territory counting makes things simpler, at least as far as keeping track of things on the board goes: we just look at how the boundary between Black and White areas changes between the two variations. The triangles in Diag. 1e below are the points that switch ownership between Black and White when comparing Diags. 1b and 1c. We don’t have to distinguish between stones and territory, just the boundary between areas.
To compute the size of playing here, we take double the number of those points and then subtract two, giving us a gote value of $2 \cdot 4 - 2 = 6$. I’ll explain why soon, but intuitively, the doubling is because switching an intersection from being White to being Black is a difference of two points, and $2$ is the “local tally difference”, the difference in number of local stones played in the two variations (one more Black move vs. one more White move).
Here’s another example that should really drive home the difference between the two approaches. White has just played a ko threat against Black’s corner. How big is it to respond?
Doing it by territory: if Black responds, they have $4$ points ($2$ from the dead stone and $2$ from empty spaces) and White has none. If White finishes the kill, they have $14$ points ($2 \cdot 6$ from dead stones and $2$ from empty spaces; don’t forget that they have already placed two stones inside) and Black has none. So it’s $14 + 4 = 18$ points in gote.
Doing it by area: $10$ intersections are at stake. $2 \cdot 10 - 2 = 18$. The end.
Is this always more convenient?
No, not really. Here’s an example that’s trivial to calculate using the territory method:
Calculating by territory, capturing two stones or not is obviously $4$ points. We could do this the area way and say that $3$ intersections are at stake, so the swing value is $2 \cdot 3 - 2 = 4$, but it’s overkill. Not by a ton, though!
Dame
Because dame are worth points in area counting, you have to take them into account here too. Often they even out, but you may have to count them as half a point for each player. Here’s a simple example:
By territory, either player might gain one point by playing A, and no one cares about the leftover dame, so it’s $2$ points in gote.
By area, Black will own $2 \frac12$ of the points at stake if they go first, and just $\frac12$ if they go second (because the remaining dame point will be up for grabs in either case), for a difference of $2$, and $2 \cdot 2 - 2 = 2$. You could just say “there are $2$ points at stake and the dame will even out”, but it’s a little sloppy.
Here’s a case where they don’t even out:
Black will own either $2 \frac12$ or $0$ points; $2\cdot 2\frac12 - 2 = 3$. You might have found it weird that we don’t care about the capture, but it’s the usual area-vs-territory thing: White gets credit for the live stone when they save it, rather than a penalty for the prisoner when they don’t.
Yes, this is another way in which area can be more annoying than territory. It’s nice to have both techniques in your pocket. And once you get used to counting by area, the above calculation does not feel like much extra work at all.
The gnarly details
Why does this formula work? The short answer is that it works for the same sort of reason that area and territory counting are practically equivalent when scoring the board as a whole. But if you demand proof, here it is. If it makes your eyes glaze over, skip it.
I’m going to define eight sorts of points that can exist in variations. $B_T^1$ is the amount of Black territory if Black goes first while $B_T^2$ is the amount of Black territory if White goes first. We also have $B_S$ variables for numbers of (living) Black stones on the board, as well as $W_T$ and $W_S$. This means that we can also define some helper variables for Black and White areas, $B_A = B_T + B_S$ and $W_A = W_T + W_S$.
The size of a gote move in territory counting is $V_T = (B_T^1 - B_T^2) - (W_T^1 - W_T^2)$, Black’s gain by going first minus White’s gain by going first.
With area counting, our formula is $V_A = 2 \cdot (B_A^1 - B_A^2) - 2 = 2 \cdot ((B_T^1 + B_S^1) - (B_T^2 + B_S^2)) - 2$. We don’t need to look at White’s values because we only care how much Black’s area expanded; White’s area contracted by the same amount. It’s more work, but we could write this out the long way as $V_A = ((B_T^1 + B_S^1) - (B_T^2 + B_S^2)) - ((W_T^1 + W_S^1) - (W_T^2 + W_S^2)) - 2$, and that’s what I’ll do below when proving that $V_A = V_T$.
Now we need to prove that $V_T$ and $V_A$ are equal. First of all, note that $B_S^1 - W_S^1 = 1$ and $W_S^2 - B_S^2 = 1$, because we asserted that playing here is gote for both sides (Black played one more stone in variation 1 and White played one more stone in variation 2).
Then it’s just a question of substituting and cancelling, as usual with this stuff:
$$ \begin{aligned} V_A &= ((B_T^1 + B_S^1) - (B_T^2 + B_S^2)) - ((W_T^1 + W_S^1) - (W_T^2 + W_S^2)) - 2 \\ &= V_T + (B_S^1 - W_S^1) + (W_S^2 - B_S^2) - 2 \\ &= V_T \end{aligned} $$
Magic!
Next: sente.