The number of ways to arrange 8 rooks on the chessboard satisfying the condition

84 Views Asked by At

I have an interesting combinatorial math problem as follows

How many ways are there to arrange 8 rooks on the chessboard such that no rook is on the main diagonal (the diagonal connecting the top left and bottom right corners) and no rooks eats another?

I numbered the 8 vertical columns of the chessboard. Obviously there are no 2 rooks in the same row, so for each arrangement of 8 rooks i represent as an 8 digit number $a_{1}a_{2}... a_{8}$ where $a_{i}$ is the position of rook i. Since no rook can be matched, the number above must be a different 8-digit number made up of the digits 1,2,...,8. moreover, obviously $a_{i}=i$ doesn't exist (I'm stuck here) Everyone please comment and thank you so much for it

2

There are 2 best solutions below

1
On

As you have discovered, the number of such arrangements is the same as the number of permutations of the set $\{1,2,\ldots,8\}$ with no fixed points. These are known as derangements. Using the formula from the article, we get an answer of $$d_8 = 8! \sum_{i=0}^8 \frac{(-1)^i}{i!} = 14833.$$

1
On

Using a vizualization of the board with rooks placed as a 8x8 binary matrix (0=no rook, 1=rook) this seems to be the number of traceless binary matrices where each row and each column sums to 1, as counted in https://oeis.org/A000166 . This gives 14833 for the 8x8 board.