Forums

Number of Possible Chess Configurations

Sort:
pacfish

I'm going to necro this thread because of reasons.

Each piece can be represented by a binary number and it's positional data stored in the same number.

Pawns - pain in the ass, they can become knights, queens, rooks, and bishops. But let's be real. There are only really 2 options after the queen became a super piece. A knight and a queen. But for the sake of legality, 4 pieces. They can also be pawns! And the total number of promoted pieces can be 22 (4 promoted / pawns need to be captured to get by and they need to be on alternating files)

Positional data can be represented by a number ranging from 0b00_0000 to 0b11_1111.

We also need to indicate that a piece is present on the board. So we'll need a bit for that as well since 0 is a valid spot. We also need to indicate if the piece belongs to white or black. So another bit is used here. I'm up to 8 bits for all non pawns.

Pawns on the other hand do have some extra data that can be leveraged. 5 leaves room to grow with being able to store information about if it's alive by the fact that "is a pawn", "is a queen", "is a rook", "is a knight", "is a bishop", "is dead". That's 3 bits. I wish I had a solution on how to include the player information but nothing really works here. So 1 more bit for a total of 4 bits on top of positional data. Funny enough if we got rid of those two unused promotions we would only need 3 extra bits.

Now the counting...

Math is going to be a little off here... I mean we have unused data. 32 pieces, 16 with 8 bits of information, 16 with 10* bits of information. That's a total 288 bits of information used to store with all 32 pieces in every possible combination. A lot of these are not legal setups... in fact here's some examples of some that will popup: All 32 pieces on a1, A completely blank board, Pawns on last rank and first rank, no kings, a king checked by 2 light square bishops, mirrored positions... etc

This number is 4.9e86.

If you were to take the question at face value and exclude promotions, this number drops to 1.15e77 (2^256).

The lowest I've reduced down to is 2^192. Which can be written with the 64 positional notations. 0's indicate if a space is empty. There are 12 unique pieces which take up 4 bits, and leaves 4 left to indicate a pawn promotion (but only 2 per player... only 2 that matter amirite?) This places the largest possible number (depending on how you label the pieces) somewhere in the range of

0b1_1111_1_1110_1_1101_1_1100_1_1011_1_1011_1_... you can actually just type in 0b1111111110 followed by 182 0's and that would be a pretty good estimate. But again we could choose to number things starting at 0 since it's a fixed length of data. This makes the total amount of playable variants even smaller. than other's have mentioned. Oh and this number can be compressed because there are at least 32 empty spaces, the numbers are sequential in nature and as long as no data is lost and the numbering scheme is the absolute smallest that can be made, you'll have your answer!

Side note: I think "Even boards with overlapping pieces would be OK..." means I answered the question fully while missing the bonus.

 

So now the quest begins to beat 10^50. And maybe even the strange 10^47. (currently at sitting around 4e57).

So there's some information we aren't using (12-15) and really can't be used in any reasonable way. So instead we have to try and subtract these numbers out. This gets a little confusing in binary. But basically going to take 2^192 and subtract a very abstract number... it's all unreachable points of data. It's not a huge difference but everything helps. Gonna need some help trying to explain this but basically subtraction gets the number down to around 6e55. Almost there.

 

I'll come back later after I figure out some new tricks to remove more data points of a different way to represent the board.

 

Who cares about Shannon's number when each board state is only a single move game (going backwards)!

 

Time to address the combination answer:

63! / (33! * 8! * 7! * (2!)^6) removes is all the combinations when a piece is in a square specifically a pawn in one of the illegal squares. If you were still here you might agree with me that we first need to find all legal permutations before reducing it to combinations since if we tread down this path, we've already removed any combination with a pawn on that square and would end up say doing 62! / (34! * 8! * 6! * (2!) ^ 6). that's not to say it can't be done. Just challenging.

pacfish

New idea: still has overlapping pieces: 21^4 * 26^4 * 32^8 * 32^4 * 64^10 * 64^2

Pawns a,h: 21 possible locations. requires something to be off the board to reach anything greater than 6.

     b,g: 26 possible locations, requires something to be off the board to reach anything greater than 6.

     c-f: 32 possible locations, requires something to be off the board to reach anything greater than 6.

bishops: 32 possible locations, kings do not need to occupy. However, if both bishops are present, at least one of them will be blocked by king and that space can be reserved for if the bishop is not present.

all other pieces: 2 kings, therefore only 63 possible locations (1 off the board).

king: 64 locations total though this number has an exact number associated with it.

10^50 or 2^168. And all the pieces are unique and can be on the some can even be on the same square (like pawns and kings, pawns and promoted pieces, promoted pieces and bishops).

johntromp

My chess page at view-source:https://tromp.github.io/chess/chess.html

proves an upper bound of about 4.5e46 on the number of positions.

I plan to prove a much sharper bound below 8e45 later this year.

Arisktotle

What's a real task is to exclude the illegal ones - in an orthodox chess game - which is likely the overwhelming majority wink.png

danLODM

I worked on the number of chess diagrams without promotion and found an upper bound of approximately 4 e 37 : https://arxiv.org/pdf/2112.09386.pdf

tygxc

Great job!

Duck

Wow

zlinder93

Ive heard its more than the atoms in the observable universe

Arisktotle
zlinder93 wrote:

Ive heard its more than the atoms in the observable universe

Certainly not but it's one of those numbers to boast on the complexity of chess. Also, what is the observable universe? We can't even see the far (dark) side of the moon wink

DarkAmbient_Darkness

In how many ways can you place 32 chess pieces on a standard (8x8) chessboard???????????????????

In how many ways can you place 32 chess pieces on a standard (8x8) chessboard? This does not have to comply with the rules of the game.

My answer is:

We place the pieces as though they all are distinguishable, i.e.

64!32!64!32!

but we cannot distinguish between eight white pawns, two white knights, two white rooks, two white bishops and the same with the black ones. So the final answer is

64!32!⋅18!22!22!22!264!32!⋅18!22!22!22!2

Is my reasoning correct?

..........................................................................................................................................................

Since you have 3232 chess pieces and 6464 (8×8)(8×8) squares, you first need to choose 3232 squares to use.

This can be done in (6432)=64!32!×32!(6432)=64!32!×32! ways. Now, for each of these ways, you can have 32!32! ways of arranging the pieces (if all pieces were different). So you have to multiply (6432)(6432) with 32!32!.

But all pieces aren't different, as you mentioned there are 88 pawns and hence 8!8! ways of arranging them. So, you were over counting initially - by a factor of 8!8!, because all those 8!8! arrangements were essentially the same.

This reasoning would apply to all pieces that are identical and hence you would have to divide (6432)∗32!(6432)∗32! by (8!×2!×2!×2!)2(8!×2!×2!×2!)2.

Final answer: 64!32!×(8!×2!×2!×2!)2=463472669558780964119204598232328567040000064!32!×(8!×2!×2!×2!)2=4634726695587809641192045982323285670400000

Fun fact: 1.46966×10351.46966×1035 years would contain these many seconds.