MiaiCountingWithTrees

    Keywords: EndGame

Hopefully this page will someday be a complete description of how to calculate the Miai value of a move with trees. The main advantage to this method is that if you don't know whether a move is sente or gote, you can try it out.


Planned TOC:

  • Algorithm
  • simple Gote example
  • simple Sente example
  • more complex example (HaneTsugi perhaps?)

Algorithm and Notation

First, the tree notation. I attempt to follow BillSpight as closely as possible, for consistancy and because he outranks me :). A miai counting game tree is a binary tree where each node represents the board position after either black or white making a locally optimal play. A leaf node (one with no children or subtrees) represents a position where neither player can improve the local count. By convention, the left branch represents a black move, and the right branch represents a white move.

As our first example, consider a game tree with this structure:

    A
   / \
  B   C
     / \
    D   E

For a first example, each node can be associated with a board like so:


[Diagram]

Position A

[Diagram]

Position B

[Diagram]

Position C

[Diagram]

Position D

[Diagram]

Position E



Note that positions B, D, and E we can directly count the score for both players in the immediate area. In B, black has 4 points. In D, black has 3 points. In E, black has 2 points. Whenever we know the count for a position, we can fill it in for our tree:

    A
   / \
  4   C
     / \
    3   2

Now what about A and C? Here are the basic gote move formulas:

Temperature = (blackcount-Whitecount)/(blacktally-whitetally)

Count = blackcount - (blacktally * Temperature) OR Count = whitecount + (whitetally * Temperature)

Now we calculate the count for C. Using the formulas above, blacktally-whitetally is 2 - this is the move difference between D and E. This is also known as the local tally, based upon D and E. The difference between D and E's count is 1. Hence we obtain the temperature at C: 0.5 . The count for C is then equal to the count at D minus the tally difference between C and D times the temperature. This works out as 3 - ( 1 * 0.5 ) = 2.5. This can be recorded in the tree as follows.

    A
   / \
  4  2.5  (0.5)
     / \
    3   2

The same method is then applied to calculate A's count:

 (0.75)  3.25
       / \
      4  2.5  (0.5)
         / \
        3   2

The temperature is (4-2.5)/2 = 0.75, and the count is

blackcount - (blacktally * Temperature) = 4 - (1 * 0.75) = 3.25

Alternatively :

whitecount + (whitetally * Temperature) = 2.5 + (1 * 0.75) = 3.25

If temperature values either decrease or stay the same as you move down the tree, then you're done, and all the moves were gote. The position has a miai value of 3/4.

A sente example

Now let's change the board in position A to look like this:

[Diagram]

Position A



Otherwise, the tree is the same shape, and looks like this to begin:

    A
   / \
  4   C
     / \
    3   -17

The only change is that now if black tennukis twice, white captures the group and makes 17 points. Now we calculate the mean and temperature as before:

 (5.5)  -1.5
         / \
        4  -7  (10)
           / \
          3   -17

But this time the temperature has increased from 5.5 to 10. From this we can tell that W move C was sente. So we cut out the variation where white captures the stones:

 (1)      3
         / \
        4   C  ()
           /
          3

And the move has miai value of 1 point. Note we do (4-3)/1 since the local tally difference is 1 now, not two, and the Count is 4 - 1*1 = 3.


This is a copy of the living page "MiaiCountingWithTrees" at Sensei's Library.
(OC) 2009 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About