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
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.$$