We will first count the number of ways of placing 8 mutually non-attacking rooks on black squares and then count the number of ways of placing them on white squares. Suppose that the rows of the board have been numbered 1 to 9 from top to bottom.

First notice that a rook placed on a black square in an odd numbered row cannot attack a rook on a black square in an even numbered row. This effectively partitions the black squares into a $5 \times 5$ board and a $4 \times 4$ board (squares labelled $O$ and $E$ respectively, in the diagram at right) and rooks can be placed independently on these two boards. There are 5 ! ways to place 5 non-attacking rooks on the squares labelled $O$ and 4 ! ways to

![](https://cdn.mathpix.com/cropped/2024_04_17_67fc3a6a86c4932c5e38g-2.jpg?height=328&width=327&top_left_y=912&top_left_x=1517)
place 4 non-attacking rooks on the squares labelled $E$.

This gives 5!4! ways to place 9 mutually non-attacking rooks on black squares and removing any one of these 9 rooks gives one of the desired configurations. Thus there are $9 \cdot 5 ! 4$ ! ways to place 8 mutually non-attacking rooks on black squares.

Using very similar reasoning we can partition the white squares as shown in the diagram at right. The white squares are partitioned into two $5 \times 4$ boards such that no rook on a square marked $O$ can attack a rook on a square mark $E$. At most 4 non-attacking rooks can be placed on a $5 \times 4$ board and they can be placed in $5 \cdot 4 \cdot 3 \cdot 2=5$ ! ways. Thus there are $(5 !)^{2}$ ways to place 8 mutually non-attacking rooks on white squares.

![](https://cdn.mathpix.com/cropped/2024_04_17_67fc3a6a86c4932c5e38g-2.jpg?height=331&width=331&top_left_y=1493&top_left_x=1515)

In total there are $9 \cdot 5 ! 4 !+(5 !)^{2}=(9+5) 5 ! 4 !=14 \cdot 5 ! 4 !=40320$ ways to place 8 mutually non-attacking rooks on squares of the same colour.
How many ways can 8 mutually non-attacking rooks be placed on the $9 \times 9$ chessboard (shown here) so that all 8 rooks are on squares of the same colour?

[Two rooks are said to be attacking each other if they are placed in the same row or column of the board.]