Sunday 6 January 2019

The Mathematics of Chess

I've already posted about Chess960, also known as Fischer Random Chess (originally Fischerandom), explaining how the 960 possible starting positions for this variant of chess are obtained. There's a lot more mathematics of course on the chess board than that. Today I turned 25480 days old and the first entry in OEIS for this number is:
A172200: number of ways to place 2 non-attacking amazons (superqueens) on an n X n board. The sequence begins: 0, 0, 0, 20, 92, 260, 580, 1120, 1960, 3192, 4920, 7260, 10340, 14300, 19292, 25480, ... and for the case of 25480, the value of n is 16 so the placements are made on 16 X 16 board.
DIAGRAM 1: 16 X 16 board showing one of the 25480 possible
positions of two non-attacking amazons, represented by
the letter S standing for the German "Springer".

So what is an amazon or superqueen, I asked myself? The simple answer is provided in the comments to the OEIS sequence: an amazon (superqueen) moves like a queen and a knight. The comments also contain a link to a remarkable book that I've now downloaded and added to my Calibre Library.

DIAGRAM 2: cover of the book "Non-attacking chess pieces"

This monumental work is 795 pages in length and on page 347, the sole reference to 25480 can be found:
DIAGRAM 3: table showing the number of ways
in which 2, 3, 4 and 5 non-attacking amazons can be
placed on boards ranging in size from 1 X 1 to 20 X 20

The formula for obtaining this result is shown earlier on page 343:

DIAGRAM 4: page 343 of the text with annotations

One might argue that a so-called superqueen or amazon has no place in standard chess and you'd be right but, like it or not, there are a great many of these alternative pieces. The book mentioned earlier looks not only at the mathematics of standard pieces and boards but also these alternative pieces and even alternative boards. It's best to illustrate by example.

Let's consider another alternative piece, the nightrider, defined by Wikipedia as:
A fairy chess piece that can move any number of steps as a knight in the same direction. The nightrider is often represented by a symbol similar to the knight's icon, but altered in a way to indicate the additional straight-line motion. In this article the nightrider is represented with an inverted knight, and notation N (in which case the knight is abbreviated as S for German Springer). The nightrider was invented by T. R. Dawson in 1925, and is often used in chess problems.
See Figure 1. Note that intervening landing squares must be vacant. For example, a nightrider on b2 can reach empty square c4 and forward to empty squares d6 and e8, but cannot jump over a pawn on f4 to reach h5.:

Figure 1

Now let's consider a toroidal chessboard instead of the standard one:

DIAGRAM 6: toroidal chess board

In this type of board, the standard board is joined side to side to form a cylinder and then each end of the cylinder is joined, thus joining the top and bottom of the board. I won't go into the rules for moving on such a board but a detailed explanation of that can be found here. The reasonable question can then be asked: 
In how many ways can we place two non-attacking nightriders on a 16 X 16 toroidal chessboard?
Impressively, the previously mentioned book provides the answer: 25728 ways.

DIAGRAM 7: table showing no ways that two, three and four non-attacking
nightriders can be placed on boards ranging in size from 1 X 1 to 16 X 16

The formula for obtaining this is somewhat terrifying but I've included it below and must confess to having no idea of how it was arrived at:

DIAGRAM 8: screenshot from page 333 of
the book "Non-attacking chess pieces"

This sequence of terms 2, 18, 72, 200, ... in the column above comprises A196812 in the OEIS. In summary, the different possible positions of standard and fairy chess pieces on standard and non-standard boards provide fertile grounds for mathematical analysis. This post just hints at the range and complexity of content that can be found in Vaclav Kotesovec's remarkable book.

No comments:

Post a Comment