Total possible chess positions?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Total possible chess positions?

Post by ZirconiumX »

In the solving chess kickstarter topic I posted a rough figure for the total possible (not necessarily legal) chess positions, that of 3.837824955509396e+78 possible positions.

A friend of mine got the figure of 1.9605347643076107e+71 by doing 13^64 (each square of the board can be in one of 13 different states - 6 white pieces, 6 black pieces and being empty).

Since my maths are evidently off, what is the actual figure?

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Total possible chess positions?

Post by hgm »

Your math was off because of several reasons. One was that you did not take account of permutation of the pieces. With one piece you have 6 types, but with two pieces you don't have 6*6 combinations, but only 21, since BN would be the same as NB, etc.

13^54 obviously also is a huge over-estimate, as you don't have 64 pieces.

For an accurate estimate you would have to take account of the fact that Pawns cannot be on 1st or 8th rank, and that many Pawn structures are unreachable. (E.g. eight white Pawns on a7-h7, eight black Pawns on a2-h2.) Without worrying about the reachability, the number of Pawn structures (with all Pawns) would be 48*47*46*...*33/(2*3*4*5*6*7*8 * 2*3*4*5*6*7*8), where the denominators take care of the fact that when you exchange Pawns of the same color, you won't get a different position.
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Total possible chess positions?

Post by Gerd Isenberg »

Shirish Chinchalkar has determined a state-space complexity of 10^46 as upper bound for the number of reachable chess positions

Shirish Chinchalkar (1996). An Upper Bound for the Number of Reachable Positions. ICCA Journal, Vol. 19, No. 3, pp. 181-183

https://chessprogramming.wikispaces.com ... s%20Maxima
AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Total possible chess positions?

Post by AlvaroBegue »

John Tromp claims to have a tighter bound of around 10^45.888 : http://homepages.cwi.nl/~tromp/chess/chess.html
Gerd Isenberg
Posts: 2250
Joined: Wed Mar 08, 2006 8:47 pm
Location: Hattingen, Germany

Re: Total possible chess positions?

Post by Gerd Isenberg »

Ahh, thanks Álvaro - will soon update it.
User avatar
SMIRF
Posts: 91
Joined: Wed Mar 26, 2014 4:29 pm
Location: Buettelborn/Hessen/Germany

Re: Total possible chess positions?

Post by SMIRF »

There also has been a simplified estimation, based on a Huffman coding approach: http://www.10x8.net/chess/Zahlen.html

Image
Angrim
Posts: 97
Joined: Mon Jun 25, 2012 10:16 pm
Location: Forks, WA
Full name: Ben Nye

Re: Total possible chess positions?

Post by Angrim »

ZirconiumX wrote:In the solving chess kickstarter topic I posted a rough figure for the total possible (not necessarily legal) chess positions, that of 3.837824955509396e+78 possible positions.

A friend of mine got the figure of 1.9605347643076107e+71 by doing 13^64 (each square of the board can be in one of 13 different states - 6 white pieces, 6 black pieces and being empty).

Since my maths are evidently off, what is the actual figure?

Matthew:out
I don't have a complete answer, but some additional considerations. If you are just looking at the positions of the pieces we can reduce the
number greatly from your friend's estimate, since most of the squares are empty. Start with a bitmap of which squares are empty(64 bits, no more than 2^64 possible values)
then for the non-empty squares you have at most 48 squares that have something on them for 12^48 possible values. so 2^64 * 12^48 possible positions.
You can reduce it a lot further using facts such as there are no more than 16 pieces of each color, and only 1 king on each side.
But then there is the fact that a chess position is more than just the position of the pieces, the history also matters. 50 move rule and
triple repetition both depend on it. When you take those into account, the number of unique positions gets a whole lot larger.