Skip to content

Statistics and Transpositions

November 13, 2013

I am working on a standard feature for a chess GUI/database. Given a chess position, the program can generate a list of games in the database that feature the position (obviously). Just a little more sophisticated is a statistical breakdown. Consider the standard opening position after the moves 1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Nf3. When I enter this position, I get a list of 64749 games (from a test database of about 4.5 million games). The statistical breakdown I generate in this position looks like this;

Be7: 25497 games, white scores 60.5% +10154 -4822 =10514
c6: 14532 games, white scores 56.1% +5653 -3878 =4994
Nbd7: 7930 games, white scores 59.5% +3406 -1907 =2617
Bb4: 7580 games, white scores 56.4% +2838 -1871 =2867
c5: 4491 games, white scores 60.0% +1789 -891 =1810
dxc4: 3072 games, white scores 52.7% +911 -746 =1411
b6: 557 games, white scores 67.8% +317 -119 =121
Nc6: 479 games, white scores 74.5% +310 -75 =94
a6: 262 games, white scores 63.2% +132 -63 =67
h6: 167 games, white scores 68.6% +99 -37 =31
g6: 61 games, white scores 73.8% +40 -11 =10
Bd6: 56 games, white scores 75.0% +39 -11 =6
Ne4: 27 games, white scores 81.5% +19 -2 =6
Bd7: 19 games, white scores 73.7% +13 -4 =2
a5: 1 games, white scores 100.0% +1 -0 =0
Na6: 1 game, white scores 50.0% +0 -0 =1

Interesting enough, but just routine stuff for a chess database right ? Yes right. But here’s the interesting thing. As a consequence of the method I am using to compress moves in the database, I found myself needing to generate a list of transposition possibilities leading to a given position. Before reading on, take a guess at how many different transpositions occur in my test database for the position above. I must admit without thinking too much I assumed maybe 5 or 10.

The actual answer is, 61. Yes that’s right 61. Here’s the breakdown (warning wordpress is fighting me a little with this);

1.d4 Nf6 2.c4 e6 3.Nf3 d5 4.Nc3 : 13660 occurences
1.d4 d5 2.c4 e6 3.Nc3 Nf6 4.Nf3 : 7848 occurences
1.d4 d5 2.Nf3 Nf6 3.c4 e6 4.Nc3 : 7596 occurences
1.d4 d5 2.c4 e6 3.Nf3 Nf6 4.Nc3 : 7178 occurences
1.d4 Nf6 2.Nf3 d5 3.c4 e6 4.Nc3 : 3788 occurences
1.d4 Nf6 2.c4 e6 3.Nc3 d5 4.Nf3 : 3604 occurences
1.Nf3 d5 2.d4 Nf6 3.c4 e6 4.Nc3 : 3446 occurences
1.Nf3 Nf6 2.c4 e6 3.Nc3 d5 4.d4 : 3304 occurences
1.d4 Nf6 2.Nf3 e6 3.c4 d5 4.Nc3 : 3017 occurences
1.c4 Nf6 2.Nc3 e6 3.Nf3 d5 4.d4 : 1383 occurences
1.d4 d5 2.Nf3 e6 3.c4 Nf6 4.Nc3 : 906 occurences
1.Nf3 d5 2.c4 e6 3.d4 Nf6 4.Nc3 : 788 occurences
1.c4 e6 2.Nc3 d5 3.d4 Nf6 4.Nf3 : 768 occurences
1.d4 e6 2.c4 Nf6 3.Nf3 d5 4.Nc3 : 735 occurences
1.Nf3 Nf6 2.c4 e6 3.d4 d5 4.Nc3 : 626 occurences
1.Nf3 Nf6 2.d4 d5 3.c4 e6 4.Nc3 : 610 occurences
1.c4 e6 2.Nf3 d5 3.d4 Nf6 4.Nc3 : 593 occurences
1.d4 e6 2.Nf3 d5 3.c4 Nf6 4.Nc3 : 413 occurences
1.Nf3 d5 2.d4 e6 3.c4 Nf6 4.Nc3 : 395 occurences
1.d4 e6 2.c4 d5 3.Nc3 Nf6 4.Nf3 : 388 occurences
1.d4 e6 2.c4 d5 3.Nf3 Nf6 4.Nc3 : 376 occurences
1.c4 e6 2.Nf3 Nf6 3.Nc3 d5 4.d4 : 320 occurences
1.d4 d5 2.c4 Nf6 3.Nc3 e6 4.Nf3 : 316 occurences
1.d4 e6 2.Nf3 Nf6 3.c4 d5 4.Nc3 : 304 occurences
1.c4 Nf6 2.Nf3 e6 3.Nc3 d5 4.d4 : 280 occurences
1.Nf3 Nf6 2.d4 e6 3.c4 d5 4.Nc3 : 220 occurences
1.c4 Nf6 2.Nc3 e6 3.d4 d5 4.Nf3 : 220 occurences
1.d4 e6 2.c4 Nf6 3.Nc3 d5 4.Nf3 : 208 occurences
1.c4 e6 2.d4 d5 3.Nf3 Nf6 4.Nc3 : 136 occurences
1.c4 e6 2.Nc3 Nf6 3.Nf3 d5 4.d4 : 132 occurences
1.c4 Nf6 2.d4 e6 3.Nf3 d5 4.Nc3 : 118 occurences
1.c4 e6 2.d4 d5 3.Nc3 Nf6 4.Nf3 : 117 occurences
1.c4 Nf6 2.Nf3 e6 3.d4 d5 4.Nc3 : 116 occurences
1.c4 e6 2.d4 Nf6 3.Nf3 d5 4.Nc3 : 101 occurences
1.Nf3 e6 2.c4 Nf6 3.Nc3 d5 4.d4 : 99 occurences
1.c4 e6 2.Nf3 Nf6 3.d4 d5 4.Nc3 : 93 occurences
1.d4 Nf6 2.c4 d5 3.Nc3 e6 4.Nf3 : 86 occurences
1.Nf3 e6 2.c4 d5 3.d4 Nf6 4.Nc3 : 80 occurences
1.d4 d5 2.c4 Nf6 3.Nf3 e6 4.Nc3 : 65 occurences
1.c4 Nf6 2.d4 e6 3.Nc3 d5 4.Nf3 : 59 occurences
1.Nf3 e6 2.d4 d5 3.c4 Nf6 4.Nc3 : 36 occurences
1.c4 Nf6 2.Nc3 d5 3.d4 e6 4.Nf3 : 32 occurences
1.c4 e6 2.d4 Nf6 3.Nc3 d5 4.Nf3 : 26 occurences
1.d4 Nf6 2.c4 d5 3.Nf3 e6 4.Nc3 : 25 occurences
1.c4 e6 2.Nc3 Nf6 3.d4 d5 4.Nf3 : 24 occurences
1.Nf3 d5 2.c4 Nf6 3.d4 e6 4.Nc3 : 18 occurences
1.Nf3 Nf6 2.c4 d5 3.d4 e6 4.Nc3 : 15 occurences
1.Nf3 e6 2.c4 Nf6 3.d4 d5 4.Nc3 : 15 occurences
1.Nf3 e6 2.d4 Nf6 3.c4 d5 4.Nc3 : 14 occurences
1.c4 e6 2.Nc3 d5 3.Nf3 Nf6 4.d4 : 12 occurences
1.Nf3 d5 2.c4 e6 3.Nc3 Nf6 4.d4 : 11 occurences
1.c4 Nf6 2.d4 d5 3.Nc3 e6 4.Nf3 : 6 occurences
1.c4 d5 2.d4 e6 3.Nf3 Nf6 4.Nc3 : 3 occurences
1.c4 d5 2.d4 e6 3.Nc3 Nf6 4.Nf3 : 2 occurences
1.c4 e6 2.Nf3 d5 3.Nc3 Nf6 4.d4 : 2 occurences
1.Nf3 d5 2.c4 Nf6 3.Nc3 e6 4.d4 : 2 occurences
1.c4 Nf6 2.d4 d5 3.Nf3 e6 4.Nc3 : 1 occurence
1.c4 d5 2.d4 Nf6 3.Nc3 e6 4.Nf3 : 1 occurence
1.Nf3 Nf6 2.c4 d5 3.Nc3 e6 4.d4 : 1 occurence
1.c4 Nf6 2.Nf3 d5 3.d4 e6 4.Nc3 : 1 occurence
1.c4 d5 2.Nc3 e6 3.d4 Nf6 4.Nf3 : 1 occurence

As a chess player, I found this information pretty interesting. As I mentioned initially I only obtained this information as a side-effect, calculated for internal, programmatic reasons. But having seen this example, I think I will make this “transpositions found” information available to the end user of the program.

One final point I’ll make is that there were a further 5 paths to the same position with White to move! In these cases Black had played both …d6 and …d5. I’d actually like a database with less games from very weak players, but that’s a topic for another day.

 

 

 

 

 

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: