Author: KarinsDad
Date: 12:18:26 08/19/99
Go up one level in this thread
On August 19, 1999 at 14:03:01, David Eppstein wrote: >On August 18, 1999 at 20:25:06, KarinsDad wrote: >>Doesn't 2 * 2^162 + 16 * 2^161 > 2^165? >>>So even ignoring the cases you can't handle, you still have 166 bits required. >>>Why do you say the maximum required is 162? >> >>The cases are not part of the same position, but rather templates of given >>position types. For example, you could split positions into 17 cases: ones with >>16 pawns, one with 15 pawns, ..., ones with zero pawns. > >Perhaps you misunderstood my question. Any count of the number of bits required >to store a position has to include the number of bits used to tell which case >you are in. Otherwise I could just divide into 2^180 cases and say that I store >the position in 0 bits. It seems that when you are saying you require at most >162 bits (except for the cases you can't handle) that you are not counting this >part of the representation. I do not need information as to which case I am in. That information is obtained from the information contained in the structure. For example, let's take the case of all 16 pawns on the board and all 16 pieces on the board. What information can I obtain from this case (in order to shorten the structure) and how many bits can it be stored within? 12 bits kings and castling info 1 bit side to move 1 bit en passant 62 bits location bitboard (64 squares - 2 squares for the known king locations) 30 bits piece or pawn bit (16 pawns, 14 pieces) 28 bits piece type (14 pieces - 4 different piece types or 2 bits each) 14 bits piece color 148 bits total You'll note that once I have the piece or pawn bit information, I know exactly how many pawns and pieces are on the board. From that, I know that all of the pawns are arranged in a white/black configuration. So, I do not need to specify the color of the pawns since the pawn color is forced (no captures or promotions have been made in this case). If the pawn color could not be derived, then using the schema above would fail for the 16 pawn / 16 piece case since I would need 16 bits for the pawn colors and that would raise the total to 164 bits. So, for this case, I need 148 bits. The case of 16 pawns and 15 pieces requires more bits. For the case of zero pawns, I need 161 bits. But the case information is derived from the data. It is not added to the data. And granted, the above is a simplified version of what I am doing. There is a LOT more to it due to the promotion special cases. KarinsDad :)
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.