Author: KarinsDad
Date: 00:19:33 05/15/99
Go up one level in this thread
On May 15, 1999 at 01:52:39, Eugene Nalimov wrote: >Simple example: imagine that you have 2 different values, each in the range >0..21. If you'll try to encode each of them separately, you'll end up with 2 >5-bit values, so total will be 10 bits. Now, encode them as (value1)*22 + >value2. You'll end up with value that is in the range 0..483, and you'll need 9 >bits to encode it. > >Back to the original problem: there are 3812 legal placements of both king on >the board. Now, if we can find other term that use not full interval [0..power >of 2-1], maybe we can combine them and use less bits for that combination than >sum of bits necessary for storing each of them separately. (I myself see that >the phrase is not English, but cannot formulate it better). Now I got you. I can see a way for this to work. 1 bit is used to determine if the white king is an edge or non-edge king edge king = 28 locations (including corners) opposing king has up to 59 locations (in the case of a corner), hence 27*28+59=815 or 10 bits for a total of 11 bits non-edge king = 36 locations opposing king has up to 55 locations, hence 35*36+55=1315 or 11 bits for a total of 12 bits So, everytime the white king is at the edge of the board (half of time in most games), you use 11 bits. Everytime it is away from the edge, you use 12 bits. You can even add 64 (instead of a max 59 or 55) to each of these in order to make it simple to calculate the black king. Well done! (it's amazing that I can get excited over 1 bit, but I like this) If you think about it, this is a different (and better) way of doing my quadrant idea (dropping the quadrant and making it the edge instead), but combining it with your multiplication idea. Excellent! > >For example, counter that is necessary for 50 moves rule is in the range >[0..99]. Not enough to save whole bit. Third value is necessary. I do not understand what you mean by this. KarinsDad :) > >Eugene > [snip]
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.