 Chess960 starting position

Chess960 is a chess variant in which the arrangement of pieces on the first rank is randomly generated. There are 960 possible starting positions, hence the name. The starting position can be generated before the game either by a computer program or using dice, coin, cards etc.
Contents
Rules
The starting position for Chess960 must meet the following rules:
 White pawns are placed on their orthodox home squares.
 All remaining white pieces are placed on the first rank.
 The white king is placed somewhere between the two white rooks.
 The white bishops are placed on oppositecolored squares.
 The black pieces are placed equalandopposite to the white pieces. For example, if the white king is placed on b1, then the black king is placed on b8.
Note that the king never starts on file a or h, because there would be no room for a rook.
Methods for creating the starting position
There are many procedures for creating the starting position for a game of Chess960. The methods that are presented below fall into two general categories:
 There is a separate randomization event for each placement of a piece, or at least most of them. The die and coins methods fall into this category. The main problems are the placements of the king and rooks. Analysis of the 960 starting positions shows that the knights, bishops and queen are spread evenly across the eight files; however, the king should stand on the files b through g with the respective probabilities 9/80, 14/80, 17/80, 17/80, 14/80, 9/80, and the rook's probabilities for the files a through h are, respectively, 30/80, 21/80, 16/80, 13/80, 13/80, 16/80, 21/80, 30/80. It is very doubtful that any simple method can achieve these numbers unless the king and rooks are placed last (when there is only one choice) and proper balance is maintained for the previous placements of the knights, bishops and queen.
 There is a single randomization event for the placement of all eight pieces. The cards and drawing methods are in this category. The difficulty here is how to cope when the bishops start out on squares of the same color. There are 5040 distinct arrangements of the pieces. Of the positions, 2880 of them have the bishops on squares of different colors, and 2160 of these have bishops on squares of the same color. Thus it is impossible to get a proper balance by linking each of the latter arrangements to its own single arrangement with the bishops on different colored squares. Some further randomization is needed. David Wheeler's suggestion of having a randomly selected bishop move to a randomly selected square of the opposite color is a very handy way to do this. It involves an eightway choice, and gives equal probabilities to all 2880 positions.
Bodlaender's dicerolling method
Hans L. Bodlaender has proposed the following procedure using one sixsided die to create an initial position:
 Roll the die, and place a white bishop on the black square indicated by the die, counting from the left. Thus "1" indicates the first black square from the left (a1 in algebraic notation), "2" indicates the second black square from the left (c1), "3" indicates the third (e1), and "4" indicates the fourth (g1). Since there are no fifth or sixth positions, reroll 5 or 6 until another number shows.
 Roll the die, and place a white bishop on the white square indicated (1 indicates b1, 2 indicates d1, and so on). Reroll 5 or 6.
 Roll the die, and place a queen on the first empty position indicated (always skipping filled positions). Thus, a 1 places the queen on the first (leftmost) empty position, while a 6 places the queen on the sixth (rightmost) empty position.
 Roll the die, and place a knight on the empty position indicated. Reroll a 6.
 Roll the die, and place a knight on the empty position indicated. Reroll a 5 or 6.
 This leaves three empty squares. Place a white rook on the first empty square of the first rank, the white king on the second empty square of the first rank, and the remaining white rook on the third empty square of the first rank.
 Place all white and black pawns on their usual squares, and place Black's pieces to exactly mirror White's (so Black should have on a8 exactly the same type of piece that White has on a1, except that bishops would be on opposite colors).
This procedure generates any of the 960 possible initial positions with an equal chance; on average, this particular procedure uses 6.7 die rolls  an optimal procedure would use on average log(960)/log(6)=3.83 die rolls. Note that one of these initial positions is the standard chess position, at which point a standard chess game begins.
It is also possible to use this procedure to see why there are exactly 960 possible initial positions. Each bishop can take one of four positions, the queen one of six, and the two knights can have five or four possible positions, respectively. (That leaves three open squares and the king must occupy the middle of those three squares, with rooks taking the last two squares, with no choice.) This means that there are 4×4×6×5×4 = 1920 possible positions if the two knights were different in some way. However, the two knights are indistinguishable during play; if they were swapped, there would be no difference. This means that the number of distinguishable positions is half of 1920, or 1920/2 = 960 possible distinguishable positions.
Rovida's dicerolling method
Roberto Rovida's method is more complicated than Bodlaender's and does not give equal probabilities, but uses fewer die rolls (56). When each piece is placed, there will be one, two, three, or six possible spaces for it. If one, there is no need to roll a die; if two, assign them the ranges 13 and 46; if three, assign them the ranges 12, 34, and 56.
 Place the king on a square that isn't a corner (1 roll).
 Place a rook on the side the king is closer to (0 or 1 roll).
 Place the queen on an empty square (1 roll).
 If the king, rook, and queen are all on the same color, place the bishop on the fourth square of that color, then place the other rook (1 roll) and then the other bishop (1 roll). If not, place one bishop (1 roll), then the other bishop (1 roll), then the other rook (0 or 1 roll).
 Place both knights on the remaining two squares.
 Place the opponent's pieces symmetrically and place all pawns.
This method does not give equal probabilities to the starting positions. For example, there are 108 starting positions with the king on b1, so the totality of these positions should have probability 108/960 = 9/80. This method, however, gives probability 1/6 to the totality of these positions.
Cointossing methods
The two coins method does not produce all legal starting positions with equal probability. The positions that arise when the king occupies the center two of the four possibilities are two thirds as likely as the others.
Edward Northam has developed the following approach for creating initial positions using only two distinguishable coins.
First, two coins (small and large) are used to randomly generate numbers with equal probability. He suggests doing this by declaring that tails on the smaller coin counts as 0, tails on the larger coin counts as 1, and heads on either coin counts as 2. To create numbers in the range 1 through 4, toss both coins and add their values together. To create numbers in the range 1 through 3, do the same but retoss whenever 4 is the result. To create numbers in the range 1 through 2, just toss the larger coin (tails is 1, heads is 2).
Any other technique that randomly generates numbers from 1 to 4 (or at least 12) will work as well, such as the selection of a closed hand that may hold a white or black Pawn.
As with a die, the coin tosses can build a starting position one piece at a time. Before each toss there will be at most four vacant squares available to the piece at hand, and they can be numbered counting from the aside (as with the die procedure described above). Place the white pieces on white's back rank as follows:
 Place a bishop on one of the four light squares.
 Place a bishop on one of the four dark squares.
 Place the king. There six vacant squares, but only the middle four are available to the king, since there must be room for a rook on each side of the king.
 Place a rook on the aside of the king.
 Place a rook on the hside of the king.
 Place the queen on one of the three vacant squares that remain.
 Place knights on the two squares that are left.
The average number of tosses needed to complete the process is 6.
There is a way of using coins and making all starting positions equally likely. It uses a third coin for which tails counts for 0, and heads counts for 4. Tossing all three coins makes the numbers 1 through 8 equally likely. The method follows the piece placements used for a die. Two coins are used for the bishops as before. Then six squares are available for the queen. All three coins are tossed and retossed until a number in the range 1...6 comes up. Then five squares are available for the first knight. Now the three coins should be tossed and retossed until a number in the range 1...5 shows up. For the second knight, only a four way choice is needed, so a single toss of two coins will do the job. The average number of tosses needed for this method is 5 + 14/15.
A similar cointossing method uses one coin to generate all starting positions with equal probability. Toss the coin four times and record the results. If the four coin tosses are all tails, start again. Otherwise toss the coin an additional six times and record the results. Then convert the sequence into a binary number counting heads as 0, tails as 1. The resulting number is a number between 0 and 959 that can then be converted into a starting position using the Chess960 numbering scheme. For example, if the tosses are T, H, T, T, H, H, H, H, T, T this converts into the binary number 1011000011, or 707 which in the Chess960 numbering scheme is the starting position BRKQNNRB.
Drawing methods
The Coffin and Scharnagl methods below do not give equal probabilities to all 960 starting positions.
David J. Coffin suggests the following procedure, which has the advantage of not requiring computers, dice, or lookup tables:
 Place the eight white pieces in a bag. Draw them one by one and place them on squares a1, b1, ... h1.
 If the bishops are on the same color, look at the following pairs: a1b1, c1d1, and e1f1. Swap the leftmost pair that contains a bishop.
 If the king is not between his rooks, swap the king with the closer rook.
However, while all positions can be generated this way, not all positions have the same probability to be generated. Mathematical analysis shows that positions with the bishops on a pair a1b1, c1d1, e1f1, or g1h1 actually have half the probability to be generated of the other positions.
R. Scharnagl also has a method for correcting same color bishop positions when the pieces are drawn from a bag. He acknowledges that it does not produce all positions with equal probability, but makes the point that this is not necessary to achieve the main objective of Chess960. See the external reference.
In order to move a randomly selected bishop to a randomly selected square of the opposite color, as suggested in the Introduction, a choice involving a white Pawn and a black Pawn could be used to select the aside or hside bishop, which would be removed from the board. Then the black pieces could be put in the bag and mixed up. One would be drawn out, and the numbering of the square of opposite color could, for example, be given by R=1, N=2, B=3, K, Q=4.
A much quicker method is to simply gather the eight pieces into a circle on the table, then squash the circle flat into a line. If the bishops would be on the same colour, gather the pieces and try again. Once the bishops are right, swap the king and rook (as above), and start the game.
Eight cards method
This method produces all legal starting positions with equal probability.^{[citation needed]}
This method makes use of eight cards marked with the numbers 1 through 8. These numbers are associated with piece names according to the starting position in standard chess, i.e. 1,8=R, 2,7=N, 3,6=B, 4=Q, 5=K. After the cards are shuffled and dealt in a row, the white pieces should be placed on the back rank as designated by the piece labels. If the bishops are on squares of the same color, the Coffin or Scharnagl bishop adjustments of the previous section could correct this immediately, but there is a very easy way to move a randomly selected bishop to a randomly selected square of the opposite color. The cards should be put face down, mixed up, and one selected at random. A number in the range 1...4 indicates that the aside bishop should move to the indicated square of the opposite color. A number in the range 5...8 should be diminished by 4 and the hside bishop should be moved to the indicated square of the opposite color.
After the bishops are on squares of different colors, attention is given to the king and rooks. If the king is not between the rooks, it must trade places with the nearest rook.
OR
This method does not produce all legal starting positions with equal probabilities. The problem is discussed in the Introduction.
Using a deck of playing cards, the king, queen, two jacks, two aces, and two tens can be selected. It is decided which pieces are represented by which cards (as the king and queen are obvious.) The deck is shuffled, cut, and dealt. Care must be taken as to keep the bishops on opposite colors, and the king between the rooks. To deal with a card that would be illegal, just hold that piece to the side until it is legal to place. When a legal square opens, place the held piece. Sometimes, two pieces are held but it is not confusing and quite a speedy and random method.
Multisided dice
This method produces all starting positions with equal probability.
If one has polyhedral dice shaped like each of the Platonic solids, one never needs to reroll any dice.
 Roll the dice.
 Place a white bishop on one of the eight squares as indicated by the octahedron (d8).
 Place the other white bishop on one of the four squares of opposite colour as indicated by the tetrahedron (d4).
 Place the white queen on the one of the remaining six squares indicated by the cube (d6).
 Take the number of the icosahedron (d20). Divide by five and add one to both the quotient and remainder. These results determine the positions of each of the knights on the remaining five squares (if the quotient and remainder end up identical, as it is the case if 6, 12, 18 is rolled, replace one of the final square position by "5").
 Place the white rooks and the white king between the rooks. If desired, use the dodecahedron to decide who plays white (even numbers for one player, odd for the other).
 Place the white pawns and mirror the position for black.
A special chess timer
There is a special chess timer on the market that can determine a random Chess960 starting position, with, it is claimed, an equal probability of each position, by the push of a button.
Starting position IDs in Chess960
Main article: Chess960 numbering schemeFor years, Reinhard Scharnagl has championed the desirability of giving each of the Chess960 starting positions (SP) a unique identification number (idn) in the range 0959 or, perhaps, 1960. He has presented his methods on the internet and in books. See the external references. As an application, a random number generator could make one probe into the range at hand for a random number, and produce a random SP. Late in 2005, the program Fritz9 became available. It has a Chess960 option, but, for some unexplained reason, it assigns idns to SPs in a different way. Rather than requiring a giant table with 960 entries, both methods can use some smaller tables and some arithmetic.
Preliminaries
Both methods take account of the positions of the bishops first, and ignore the distinction between the king and rooks. Once the positions of the bishops, knights and queen are known, there is only one possibility for the remaining three squares. In the places where division of whole numbers is done, it is always done giving a quotient (designated q1,q2,..) and a remainder (designated r1,r2 ..).
There are 16 ways to put two bishops on opposite colored squares. These are shown and numbered in the small table below. The entries actually can be calculated using simple arithmetic, but the table method seems less error prone. For the standard SP the bishop's code is 6.
Scharnagl's Bishop's Table  0 BB 4 BB 8 BB 12 BB 1 BB 5 BB 9 BB 13 BB 2 BB 6 BB 10 BB 14 BB 3 BB 7 BB 11 BB 15 BB
In any SP, when looking at the arrangement of the other pieces around the bishops, it is helpful to write down the NQskeleton for that SP. This is done by ignoring the bishops and replacing the "K" and "R" by a common symbol, say "". The NQskeleton for the standard SP is NQN. The sections below showing Scharnagl's Methods and the Fritz9 Methods are independent, and may be read in any order.
Scharnagl's methods
The methods described below are appropriate for the idn range 0959. For the idn range 1960, he recommends conversion by dividing by 960 and working with the remainder. This has the effect of assigning to idn 0 the SP that was at idn 960, and leaving the other idn SP matchups unchanged. If this calculation is applied in the idn range 0959, nothing is changed.
For any SP, after skipping over the bishop's, the queen may occupy any one of six possible squares, and they are numbered from left to right (from White's perspective) 0,1,2,3,4,5. The two knights, then, can appear in any of the remaining five squares (skipping over bishops and queen) in 10 ways. These are shown and numbered in the N5N table below.
Scharnagl's N5N Table  0 NN 2 NN 4 NN—6 NN 8 NN 1 NN 3 NN 5 NN 7 NN 9 NN
For any SP, both the queens position and the N5N configuration are immediately available from the NQskeleton. The queen's position is the number of characters to the left of the "Q" , giving 2 for the standard SP. The N5N configuration is obtained by omitting the "Q", giving NN for the standard SP, so its N5N code is 5. In general
idn = (bishop's code) + 16* (queen's position) + 96* (N5N code)
For the standard SP, idn = 6 + 16*2 + 96*5 = 518
Going the other way, starting with an idn, divide it by 16 and get
idn = q1*16 + r1. r1 gives the bishop's code, so put the bishops on the board. Then divide q1 by 6.
q1 = q2*6 + r2. r2 gives the queen's position, so put it on the board.
q2 gives the N5N code, so put the knights on the board (of course skipping over the bishops and queen).
Starting with idn = 518, we get 518 = 32*16 + 6, and 32 = 5*6 + 2 so the bishop's code is 6, the queen's position is 2 and the N5N code is 5 with configuration NN. If asterisks denote blank squares, the first rank fills up as: **B**B** **BQ*B** *NBQ*BN*
All of the multiplication and division can be eliminated by using the NQskeleton table below. It contains all of the 60 possible NQskeletons, and directly refers to all of the SPs with bishop's code 0, i.e. with bishops on a1 and b1.
Scharnagl's NQskeleton Table  0 QNN 192 QN—N 384 QNN—576 QNN 768 QNN 16 NQN 208 NQ—N 400 QNN—592 QN—N 784 QNN 32 NNQ 224 NQN 416 NQN—608 NQ—N 800—QNN 48 NNQ 240 NQN 432 NNQ—624 NQN 816—NQN 64 NN—Q 256 NNQ 448 NNQ 640 NQN 832—NQN 80 NNQ 272 NNQ 464 NN—Q 656 NNQ 848—NNQ  96 QNN 286 QNN 480 QNN 672 QNN 864 QNN 112 NQN 304 NQN 496 QNN 688 QNN 880 QNN 128 NQN—320 NQN 512 NQN 704—QNN 896—QNN 144 NNQ—336 NQN 528 NQN 720—NQN 912 QNN 160 NNQ 352 NQN 544 NNQ 736—NNQ 928 NQN 176 NNQ 368 NNQ 560 NNQ 752—NNQ 944 NNQ
Given an SP, extract the bishop's code, the NQskeleton and its N5N configuration. The six skeletons in each of the 10 blocks in the table all have the same N5N configuration, and the blocks are arranged according to the N5N table above. It is easy, then, to find the appropriate block, and look inside for the entry with the "Q" in the desired place, say at No. M. Then idn = (bishop's code) + M. For the standard SP, we extract 6 NQN and NN. The desired block is the middle one in the second row, and the desired skeleton is at No. 512. We get idn = 6 + 512 = 518.
Going the other way, given an idn, locate, in the table, the largest number, say M, that is less than or equal to idn. Then idn  M gives the bishop's code, and the skeleton at M shows how to fill in the rest of the pieces. Given idn = 518 we locate 512, with NQskeleton NQN, in the table, and get bishops code = 518  512 = 6.
Fritz9 methods
Upon entry to Chess960, Fritz9 prompts the user to enter a position idn or to "Draw Lots". If the user wishes to choose the first rank configuration of pieces, he/she must know how to get at the idn, but, unfortunately, Fritz9 does not use the standard method described above. The table below shows a quick way to get the Fritz9 idn for any SP.
For any SP, after ignoring the bishops, attention is given first to the knights (rather than to the queen). After taking account of the arrangement of the two knights in six squares (skipping over bishops), the queen is left with four possibilities: 0,1,2,3 (counting from the aside of the board and skipping over bishops and knights). The queen's position is the number of hyphens to the left of the "Q" in the NQskeleton for the SP.
In the table below, the columns correspond to the queen's position, and, in each column, the ordering is alphabetic with "" last.
Given an SP, extract the bishop's code, the NQskeleton and its queen's position. Then, locate, in the appropriate column, the NQskeleton at hand, say at No. M. The Fritz9 idn = (bishop's code) + M. For the standard SP, we extract 6 NQN and 1 and get Fritz9 idn = 6 + 353 = 359.
Fritz9 NQskeleton Table  1 NNQ 241 NNQ 481 NN—Q 721 NNQ 17 NQN 257 NNQ—497 NNQ 737 NNQ 33 NQN 273 NQN—513 NNQ 753 NNQ 49 NQ—N 289 NQN 529 NQN 769 NNQ 65 NQN 305 NQN 545 NQN 785 NQN 81 QNN 321 NNQ—561 NNQ 801 NN—Q 97 QNN 337 NQN—577 NNQ 817 NNQ 113 QN—N 353 NQN 593 NQN 833 NNQ 129 QNN 369 NQ—N 609 NQN 849 NQN 145 QNN—385 QNN—625—NNQ 865—NNQ 161 QNN 401 QNN 641—NQN 881—NNQ 177 QNN 417 QN—N 657—NQN 897—NQN 193 QNN 433 QNN 673—QNN 913 NNQ 209 QNN 449 QNN 689—QNN 929 NQN 225 QNN 465 QNN 705—QNN 945 QNN
Anyone with Fritz9 can verify this table by entering in the idns. It directly refers to just those SPs with bishop's code 0 i.e. with the bishops on a1 and b1.
External links
 Fischer Chess960 generator
 Fischer Chess960 generator using Bodlaender dice rolling method  including Delphi and Java source
Categories: Chess variants
Wikimedia Foundation. 2010.
Look at other dictionaries:
Chess960 — a b c d e f g h … Wikipedia
Chess960 numbering scheme — The game Chess960, played with conventional chess pieces and rules, starts with a random selection of one of 960 positions for the pieces. Arrangements of the pieces are restricted so that the king is between the rooks and the bishops are on… … Wikipedia
Chess960 Enumbering Scheme — The game Chess960, played with conventional chess pieces and rules, starts with a random selection of one of 960 positions for the pieces. Arrangements of the pieces are restricted so that the king is between the rooks and the bishops are on… … Wikipedia
Index of chess articles — Contents 1 Books 2 General articles 2.1 0–9 2.2 A … Wikipedia
Chess variant — Gliński s hexagonal chess – one of many chess variants A chess variant is a game related to, derived from or inspired by chess.[1] The difference from chess might include one or more of the following: different board (larger or smaller, non… … Wikipedia
Glossary of chess — See also: Outline of chess and Glossary of chess problems This page explains commonly used terms in chess in alphabetical order. Some of these have their own pages, like fork and pin. For a list of unorthodox chess pieces, see fairy chess… … Wikipedia
Transcendental chess — a b c d e f g h … Wikipedia
ForsythEdwards Notation — (FEN) is a standard notation for describing a particular board position of a Chess game. The purpose of FEN is to provide all the necessary information to restart a game from a particular position.FEN is based on a system developed by the… … Wikipedia
Outline of chess — A game of chess, in the starting position. See also: Glossary of chess and Index of chess articles The following outline is provided as an overview of and topical guide to chess: Chess – two player board game played on a chessboard, a square … Wikipedia
XFEN — is an extension of Forsyth Edwards Notation (FEN).The traditional Forsyth Edwards Notation is not sufficient to represent all possible positions in 8x8 Chess960 (aka Fischer Random Chess) or 10x8 Capablanca random chess (CRC). Consequently, an… … Wikipedia