Hagen wrote:I've always wondered whether the listing of FRC positions was arbitrary and or whether there's a mathematical reason why a Fischer Random chess position gets assigned a certain number. In case you're wondering, classical chess is number 518. But according to this site
http://frcec.chess960.info/FRC-StartingPositions.htm there's a math reason for the number assigned to that position.
But help me out here...when I try following the math equation to figure out the positions and compare them to the listing he gives...the numbers don't seem to add up right. Does anybody here know a better way of identifying the FRC position ID when a board is set up randomly and you want to input its ID into a chess program later to set it up by simply inputting its ID?
Thanks in advance.
I'll try my best.
The product 4 x 4 x 6 x 10 gives you 960, the total number of starting positions. The first 4 stands for the number of possible squares for the light-square Bishop (b, d, f & h), and the second 4 for the dark-square Bishop (a, c, e & g). The 6 stands for the number of squares available for the Queen, and the 10 for the number of KeRN codes (legal Fischer combinations of Knights, Rooks and the King). See the KeRN table below.
KeRN Codes:
0 N N R K R (Knight, Knight, Rook, King, Rook)
1 N R N K R (Knight, Rook, Knight, King, Rook)
2 N R K N R (and so on...)
3 N R K R N
4 R N N K R
5 R N K N R
6 R N K R N
7 R K N N R
8 R K N R N
9 R K R N N
Lets start by looking at
Position 518:
518 / 4 = 129 with Remainder 2
This first remainder is for white Bishop. The white Bishop has only four possible positions; file b, d, f, and h -- where b is 0, d is 1, f is 2, and h is 3. So we place White Bishop on file f.
129/4 = 32 with Remainder 1
The second remainder is for Black Bishop. The Black Bishop has only four possible positions; file a, c, e, and g -- where a is 0, c is 1, e is 2, and g is 3. So we place Black Bishop on file c.
32/6 = 5 Remainder 2
The third remainder gives position of the Queen. The only available files are a, b, d, e, g, h -- where a is 0, b is 1, d is 2, e is 3, g is 4, and h is 5. So we place the Queen on file d.
Our KeRN code is 5 from last division. From the table, we are given R N K N R. The remaining files are a, b, e, g, h. File a takes a Rook, b takes a Knight, e takes the King, g takes a Knight, and h takes a Rook.
Final Position: RNBQKBNR = (1x2) + (4x1) + (16x2) + (96x5) = 518
Position 259 for example:
259 / 4 = 64 with Remainder 3
This first remainder is for white Bishop. The white Bishop has only four possible positions; file b, d, f, and h -- where b is 0, d is 1, f is 2, and h is 3. So we place White Bishop on file h.
64/4 = 16 with Remainder 0
The second remainder is for Black Bishop. The Black Bishop has only four possible positions; file a, c, e, and g -- where a is 0, c is 1, e is 2, and g is 3. So we place Black Bishop on file a.
16/6 = 2 Remainder 4
The third remainder gives position of the Queen. The only available files are b, c, d, e, f, g -- where b is 0, c is 1, d is 2, e is 3, f is 4, and g is 5. So we place the Queen on file f.
Our KeRN code is 2 from last division. From the table, we are given N R K N R. The remaining files are b, c, d, e, g. File b takes a Knight, c takes a Rook, d takes the King, e takes a Knight, and g takes a Rook.
Final Position: BNRKNQRB = (1x3) + (4x0) + (16x4) + (96x2) = 259