- Blind mode tutorial
lichess.org
Donate

Mathematics in Chess - Combinatorics

ChessPuzzleChess variantStrategyAnalysis
Maths and chess are very interwoven, and there are several examples of this. Learn about one such example below.

Intro

Chess contains several variants apart from standard chess, and one of the most common of these variants is Fischer Random chess. This variant, also known as freestyle chess, is so common that there is an official World Championship status to it (currently held by GM Hikaru Nakamura), and through the support of GM Magnus Carlsen, this variant has been featured in several freestyle chess tournaments, as part of the Grand Slam tour.

In one of my previous blogs, I discussed the history and origins of Fischer Random Chess, named after the great Bobby Fischer. However, there is another name used to refer to this variant. This is because in Fischer Random/freestyle chess only the back home row of pieces are rearranged, and all other rules are kept the same. The more colloquial name is Chess960, because there are 960 different possible positions that can serve as the starting position of Freestyle chess. Tying this concept to maths, our goal in this blog is to find out why this number is 960. Before reading on, I encourage you to pause and try to come up with the solution yourself, and check your work. Or you can just 'enjoy the show' (shoutout to Agadmator) and read on.

The Combinatorics

Before we embark on the combinatorics, we must keep in mind three rules in Freestyle chess when considering the random arrangement of pieces. These are:

  1. The bishops must be on opposite coloured squares, i.e. there must exist a dark square bishop and a light squared bishop.
  2. The king must exist between the two rooks (to permit castling both sides)
  3. The arrangement of pieces must be the same for both white and black when mirrored (i.e. if there exists a knight of a1, there must exist a knight on a8).

The third of these rules does not have an impact on the calculation, so we need not worry about it. So, how should we start calculating?

Step 1: The Bishops

We of course start with an empty home row, and we will figure out how we can arrange the bishops. We should consider the two bishops separately, namely light-squared and dark-squared bishops. The light squared bishop has 4 possible choices (b1, d1, f1, h1), and after that the dark squared bishop has four possible choices of its own (a1, c1, e1, g1). As these squares are mutually exclusive (i.e. they do not overlap), for the two bishops there are 4 * 4 = 16 possibilities. Here is a sample arrangement, which I will be continuing off of. If you want to work along, you can always try this with the standard chess position, which is one of the 960 possibilities.

image.png

Step 2: The Queen

After the placement of the two bishops, the queen can be in any one of the 6 remaining squares, leaving 6 possibilities. I've put it on c1 for now, but once again if you are experimenting with the standard chess position d1 should be an availability.

image.png

Step 3: The Knights

Next we shall consider the placement of the two knights. There are two knights, and 5 remaining squares, so how does the calculation work?

Well remember, knights are not like bishops, in that the number of possible squares overlap. To clarify, either knight can occupy any of the 5 remaining squares, and two knights can be of the same colour in the starting position. Note that order is not of importance here, as a knight on b1 and a knight of g1 for example is the same exact thing as the first knight of g1 and the second knight of b1. Hence we must carry out the calculation 5C2 (we are finding the number of combinations for two knights out of a possible of 5 squares, without considering order). 5C2 is 5!/(3!2!) which is 120/(6*2) = 10. Hence there are 10 possibilities for the two knights.

image.png

Step 4: The King and Rooks

I've deliberately left this step for last, as we are dealing with a group. Because there are three pieces total, and the king must be between the two rooks, it is easiest to calculate this combination if only three squares remain. If we had not done this last, several complications would arise, as there would be several other combinations with the king and the rooks. But now, considering the previous image, it is clear that out of the remaining three squares, and noting that the king must be between the two rooks (rule #2), the king must be on d1, one rook must be on b1, and the other rook must be on g1. Remember that just like the knights, the order of the placement of the rooks does not matter, so this is in fact the only possibility for the combination of these three pieces. This results in one possibility for the placement of the king and the two rooks.
image.png

Step 5: The Final Calculation

The previous image is one possible combination of a chess960 starting position. Of course, if you had been following along with your own experimentation or with the starting position, you would have ended up with the standard chess position. Now, to obtain the final number, due to the nature of combinatorics, we will multiply all our individual possibilities. From steps 1-4, we have 16 * 6 * 10 * 1 = 960 possible starting positions.

Hence you can see how Freestyle chess is also known as Chess960. I hope this was a fun exercise for you, allowing you to see how maths and chess are so interconnected. Check back later for more interesting topics on maths and chess --- you do not want to miss them!