Author: Guido
Date: 05:55:43 09/24/99
Before all, I would thank Mr. Nalimov for the program tbgen, that I found very
fast and efficient.
I have developed (and continue to debug) a similar program for generating
tablebases. But the statistics I found are slightly different from the
correspondent statistics in tbgen.
To explain the problem, let us consider the simple case of KQK. I rewrite here
the file KQK.TBS with at right the values obtained by my program:
tbgen my program
wtm: Mate in 10: 1 1
wtm: Mate in 9: 375 335
wtm: Mate in 8: 1936 1877
wtm: Mate in 7: 4102 4016
wtm: Mate in 6: 4101 4010
wtm: Mate in 5: 3313 3273
wtm: Mate in 4: 2546 2499
wtm: Mate in 3: 1157 1135
wtm: Mate in 2: 649 629
wtm: Mate in 1: 312 306
wtm: Broken positions: 7137 > my index algorithm is not so good :-)
btm: Lost in 0: 46 46
btm: Lost in 1: 175 169
btm: Lost in 2: 397 372
btm: Lost in 3: 949 936
btm: Lost in 4: 1823 1773
btm: Lost in 5: 3230 3190
btm: Lost in 6: 5077 4997
btm: Lost in 7: 6883 6769
btm: Lost in 8: 5603 5483
btm: Lost in 9: 1500 1417
btm: Lost in 10: 8 8
btm: Draws: 2953 2896
As KQK.NBW (white moves) and KQK.NBB (black moves) occupy respectively 25,629
bytes and 28,644 bytes, we have that the correct number of different positions
of the two endings are:
KQK.NBW 25,629 - 7,137 = 18,492 my program gives a total of 18,081
KQK.NBB 28,644 - 0 = 28,644 my program gives a total of 28,056
Now, while computation of correct KQK.NBW positions is not easy because we have
to eliminate checking situations, for KQK.NBB this problem doesn't arise and I
try here to compute the positions.
K(white) has 10 different positions.
K(white) + K(black) has 462 different positions as I report here from a past
thread:
1 x 4 = 1 x 33 = 33 white king in a1
3 x 6 = 3 x 58 = 174 white king in b1, c1, d1
3 x 9 = 3 x 55 = 165 white king in c2, d2, d3
3 x 9 = 3 x 30 = 90 white king in b2, c3, d4
----------
Total 462 positions
Now we have to add the white queen. If the queen can be put in all the remaining
positions not occupied by kings, we obtain:
462 * 62 = 28,644 exactly the number given by tbgen.
But this is true only if the the two kings are not both on the diagonal a1-h8.
In these cases the squares available for the queen would be only 34, because the
other squares generate positions symmetrically equivalent. How many are these
situations?
For white king in a1 6 (black king in c3, d4, e5, f6, g7, h8)
For white king in b2 5 (black king in d4, e5, f6, g7, h8)
For white king in c3 5 (black king in a1, e5, f6, g7, h8)
For white king in d4 5 (black king in a1, b2, f6, g7, h8)
-----
Total 21
Therefore the correct computation for KQK.NBB should be as follows:
(462 - 21) * 62 = 27,342
21 * 34 = 714
-------
Total 28,056
IMHO the conclusion should be that in this case statistics of tbgen consider
28,644 - 28,056 = 588 duplicated positions.
Obviously this fact doesn't not affect the correctness of the tablebases, nor
the exceptional speed of the program and related algorithms (I am very far from
such speed).
I found analogous difference for all the other cases (3 & some 4-man endings for
now), while only KPK and KPPK give identical results.
Best regards
Guido
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.