Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Is it possible to show all legal 32 piece board positions in 100 bits?

Author: blass uri

Date: 14:16:24 05/28/99

Go up one level in this thread



On May 28, 1999 at 16:02:20, KarinsDad wrote:

>On May 27, 1999 at 18:02:10, blass uri wrote:
>
>>
>>On May 27, 1999 at 15:56:07, Dann Corbit wrote:
>>
>>>On May 27, 1999 at 15:10:44, J. Wesley Cleveland wrote:
>>>[snip]
>>>>I did some calculations. You can use 12 bits to represent kings and castling,
>>>>one bit for side on move, one bit for e.p., (if there is an e.p., you get back
>>>>the four bits from the pawn representations), 15^8 for the pawns, and
>>>>46!/(32!*2^6) for the pieces (this is from the number of combinations of 14
>>>>peices in the 46 remaining squares divided by two for each of the pieces there
>>>>are two of). If I calculated correctly, this takes 114 bits. Many, if not most
>>>>of these positions are legal (the exceptions are kings in check, and pieces that
>>>>could not move to squares because the pawns have not moved and they are
>>>>blocked).
>>>Could you spell out your method formally and in detail?
>>>If it works, it proves that there are less than 2.1e34 possible chess positions.
>>>In fact, the exact number would be less than:
>>>20,769,187,434,139,310,514,121,985,316,880,384
>>>{around 20 decillion}
>>
>>No it does not prove it and it only prove that there are less than
>>20,769,187,434,139,310,514,121,985,316,880,384 positions with 32 pieces in the
>>board.
>>
>>My point is that it is impossible to represent even a subset of the legal
>>positions
>>(positions with exactly 32 pieces on the board) by 100 bits even if you ignore
>>the right to castle and e.p.
>>
>>The idea is that there are 15 possibilities for pawns at every file.
>>
>>For example for the a file you must choose 2 squares from the 6 squares
>>a2,a3,a4,a5,a6,a7 and there are 15 options to choose 2 out of 6
>>If you choose a2,a4 then it is clear that a2 is white pawn and a4 is black pawn
>>and not the opposite.
>>
>>the number of possibilites for pawns at all the files is 15^8
>
>Well done Uri!!!
>
>But when we make it more accurate, it gets a lot closer to 100 bits.
>
>Since bishops can only be on one color, you can figure out approximately how
>many pawns AND bishop possibilities there are:
>
>Each white square bishop can be on one of 32 squares (same for black square
>bishops). Hence:
>
>32 x 31 x 32 x 31 takes care of all bishops.
>
>However, this limits (i.e. conflicts with) the pawns. So, the bishops get broken
>up into:
>
>8 squares where they do not affect the pawns, 24 squares where they do.
>
>And there are 5 cases: 0 bishops can affect pawn placement (i.e. all 4 bishops
>are somewhere on the back rank), 1 bishop can affect pawn placement, ..., all 4
>bishops can affect pawn placements.
>
>So:
>
>0 bishops = 15^8 * 8 (white squared white bishop) * 7 (white squared black
>bishop) * 8 (black squared white bishop) * 7 (black squared black bishop) =
>8,037,225,000,000
>
>1 bishop = 15^7*10 (10 = number of pawn pairs on a file if one bishop is on the
>same file, instead of 15) * 8 (different files the bishop can be on) * 8 * 7 * 8
>* 4 (different bishops) = 24,494,400,000,000

There are 48 squares for the bishop and not only 8 different files.

We do not know the square of the bishop by the file of the bishop and the kind
of the bishop out of 4 cases.

It is not easy to do this calculation and I used the estimate that if we do not
look first at the squares of the bishops then we discover that close to 1/4 of
the cases are legal
The probability of white bishop to be in white square is 1/2  and the
probability of the second bishop to be in white square is 1/2 so if all the
events are independent then the probabilty of white bishops to be in squares
with different colour is  1/2.

This assumption is not correct but it is close to be correct.

It is possible to prove it practically by doing the experiment of generating
random positions and find the number of cases when there is a bishop problem.
I did not try to follow the rest of your calculation but it is not logical that
the numbers drops when you have 2 bishops that can affect pawns placement.

You can simply look at it like this:
First put the pawns so no bishops can affect pawns placement.
After it you have 16 squares that could affect pawns placement and
48 squares that cannot affect pawns placement

I expect that in most of the cases there will be at least 2 bishops out of 4 in
the 48 squares.

Uri



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.