I've been thinking about scoring again, and pondering the mysteries of Territory and Area Scoring. Alas, most of these discussions simplify the situation by assuming no isolated passes in the middle of the game and no handicap. Since I'm building a game reporting system for the automated gobans in Second Life, I needed to think this all through with full details. In particular, in an attempt to be neutral, the gobans in Second Life, at the end of the game, report both the territory score and the area score. Of course, these don't agree in all games. So here is my odyssey in thinking about this stuff.
Note: I'm not afraid to use simple algebra. If that confuses you, this isn't the page for you!
At the end of the game, we have these quantities:
Ws, Bs :: stones on the board for White and Black Wt, Bt :: territory on board for White and Black Nt :: non-scoring territory S :: number of points on a board edge Wp, Bp :: White and Black prisoners Wz, Bz :: number of passes by White and Black H :: number of handicap stones played by Black save first K :: komi P :: 1 if Black passed last, 0 if White passed last
All of these values are positive or zero. Different rule sets may assign different values to these quantities even for the same final board position. For example, points in seki may be considered Nt or Wt, Bt depending on the rule set.
(Wt + Ws) + (Bt + Bs) + Nt = S*S
The parity of the board depends on the size, and the number of non-scoring points:
(Wt + Ws) + (Bt + Bs) = S*S - Nt
The difference between two terms on the left above has the same parity:
if (S*S - Nt) is odd: then (Wt + Ws) - (Bt + Bs) is odd " is even: " is even
This is because if a+b is odd, then a-b is odd, and similarly if a+b is even, then a-b is even.
In area scoring (see below), Nt is 0 (except when there are odd points in seki), and so possible scores can only be odd, and thus differ by multiples of two.
The number of moves made by each player is equal to the number of stones on the board (adjusted for handicap), the number of prisoners, and the number of passes.
Wm, Bm :: moves made by White and Black
Wm = Ws + Wp + Wz Bm = Bs + Bp + Bz - H
Since the game has strict alteration, Black starting, if the games ends with White's pass, players have made the same number of moves. If the game ends on Black's pass, Black has made one more move than White:
Bm - P = Wm Bm - P - Wm = 0
The mathematical score is defined as a single value:
Positive values mean a win for Black. Negative values mean a win for White. Zero is a jigo.
Territory (Japanese) scoring, scores territory less prisoners for each player:
Sj = (Bt - Bp) - (Wt - Wp) - K
Area (Chinese) scoring, scores territory plus stones for each player:
Sc = (Bt + Bs) - (Wt + Ws) - K
Note these definitions are the "common" ones, and don't correspond to any particular rule sets. They correspond to how people generally count the score. It will be shown that AGA rules define a score that differs from both, but is easily computed via either counting method.
For any given game, these two versions of the score will differ by the sum of three values related to the handicap, 'excess' passes, and who played last:
Sc - Sj = ((Bt + Bs) - (Wt + Ws) - K) - ((Bt - Bp) - (Wt - Wp) - K) = (Bt + Bs) - (Wt + Ws) - K - (Bt - Bp) + (Wt - Wp) + K = (Bt + Bs) - (Bt - Bp) - (Wt + Ws) + (Wt - Wp) = (Bs + Bp) - (Ws + Wp)
= (Bs + Bp + Bz - H - Bz + H) - (Ws + Wp + Wz - Wz) = (Bm - Bz + H) - (Wm - Wz) = (Bm - Wm) - Bz + H + Wz = (Bm - P - Wm + P) - Bz + H + Wz = (Bm - P - Wm) + P + H + (Wz - Bz) = P + H + (Wz - Bz)
Looking at how these two scores for a game differ, it is important to keep a neutral point of view. When the two scores differ, we just compute by how much they differ, and then show which one favors White vs. which one favors Black.
In an even game, where the only passes were the final two, ending with White, Then all three of these quantities is zero and the two scores are the same:
if H = 0 Wz = Bz = 1 P = 0 then Sc = Sj
W <------+-------> B Sj&Sc
If the passes ended with Black, the scores differ by one point, with territory scoring favoring White, and area scoring favoring Black:
if H = 0 Wz = Bz = 1 P = 1 then Sc = Sj + 1
1 W <------+---+-------> B Sj Sc
In an n+1 stone handicap game where the only passes end the game, the scores differ by n, with territory scoring favoring White, and area scoring favoring Black:
if H = n Wz = Bz = 1 P = 0 then Sc = Sj + n
n W <------+---+ ... +---+-------> B Sj Sc
This implies to me that a difference in one handicap will be bigger in communities that use area scoring, vs. those that use territory scoring. Though note, if the area scorers add compensation (as the AGA rules do), then the rank difference will be the same as territory scorers. I have never seen this pointed out anywhere and wonder if it is known.
In an even game White passing last, the scores differ by the number of passes one side has in excess of the other. Territory scoring favors the excessive passer, and area scoring the other player.
if if H = 0 H = 0 Wz = z Wz = z + wx Bz = z + bx Bz = z P = 0 P = 0 then then Sc = Sj - bx Sc = Sj + wx
bx W <------+---+ ... +---+-------> B Sc Sj
wx W <------+---+ ... +---+-------> B Sj Sc
The AGA defines the score in such a way that it comes out the same whether one counts via territory or area. The rules stipulate that White must pass last, that pass stones are used (increases the prisoners by passes), and that, if counting via area, handicap compensation is used:
P = 0
Saj = (Bt - Bp - Bz) - (Wt - Wp - Wz) + K = (Bt - Bp) - Bz - (Wt - Wp) + Wz - + K = (Bt - Bp) - (Wt - Wp) + K + (Wz - Bz) = Sj + (Wz - Bz)
Sac = (Bt + Bs) - (Wt + Ws) + K - H Sc - H
These can be shown to be equal:
Sac = Saj Sc - H = Sj + (Wz - Bz) Sc = H + Sj + (Wz - Bz) Sc - Sj = H + (Wz - Bz) Sc - Sj = P + H + (Wz - Bz) -- which is true from above
I hope this helps someone besides just me. I didn't think this material developed enough for a main page, though perhaps it is related to (or extends) LogicalProofOfTheEquivalenceOfTerritoryAndAreaScoring. I invite discussion, clarifications, corrections, etc...
Okay - I admit it - this edit is just to see if I can get this page to finally show up on the RecentChanges list!
Herman Hiddema: It did ;-) One thing I might add is that Chinese rules compensate for handicap too. AGA rules compensate by 1 point for every stone after the first (N-1 for handicap N), while Chinese compensate by one point for every stone (N for handicap N). Ing, New Zealand and Tromp-Taylor rules do not compensate for handicap at all.
MtnViewMark: Do you have a reference to Chinese rules that talk about the handicap compensation? I went searching a long time ago, and as noted on TerritoryScoringVersusAreaScoring in the Handicap section, I didn't find any mention of handicap. If you look at my definition of H, you'll see that it is the n-1 variety, because that is the difference between the Sc and Sj 'common' counts. If you compute an area score with full n compensation, you'd find that that score would favor White even more than the territory score does! With the math here, you can see why the AGA used n-1, as they were trying to bring the two counting methods into alignment. Lastly, if you compensate n, then a "Handicap 1" game (black moves first, komi of 0.5) looks a little odd to give White another point.
Herman Hiddema: It came up recently in this discussion http://senseis.xmp.net/?topic=1322 and the reference used there is
http://www.britgo.org/rules/compare.html from the BGA.
I agree that it is strange, and that N-1 is more logical, but these seem to be the facts. I am not sure, but as far as I am aware, handicap 1 (black starts) is not considered a handicap, and so white receives no compensation, meaning that compensation jumps from 0 to 2 immediately.