[Math] All possible combinations of the black and white knight on 8×8 chess board, which are not mutually attack

combinatoricsdiscrete mathematics

All possible combinations of the 2 knights on 8×8 chess board, which
are not mutually attack?

I figured that when they DO attack each other the result will be, i think, 64-9 but still puzzled when they do not attack each other. Thank you for your response.

Best Answer

If we don't care whether they attack each other, there are $64$ ways to place the White knight, and for each of those there are $63$ places for the black knight, so $64\times63=4032$ positions. From this we have to subtract the number of positions in which the knights attack each other.

Two knights (of different colors) attack each other if they are at opposite corners of a $3\times2$ or $2\times3$ rectangle, so we start by counting those rectangles.

A $3\times2$ rectangle is determined by its lower left corner square, which must be on one of the first $6$ files and one of the first $7$ ranks, so the number of such rectangles is $6\times7=42.$ The number of $2\times3$ rectangles is the same, so the total number of rectangles is $2\times42=84.$

For a pair of mutually attacking knights, the white knight must be at one of the $4$ corners of one of those $84$ rectangles, and the black knight at the opposite corner; so the number of positions for the two knights is $84\times4=336.$

The final answer is $\boxed{4032-336=3696}.$

Alternatively, let us define the degree of a square (in the knight's graph) to be the number of squares attacked by a knight on that square. By actual count there are $16$ squares of degree $8,$ $16$ of degree $6,$ $20$ of degree $4,$ $8$ of degree $3,$ and $4$ of degree $2;$ so the number of positions for two mutually attacking knights is $16\times8+16\times6+20\times4+8\times3+4\times2=336.$

More generally, the answer to the analogous problem on an $m\times n$ chessboard ($m,n\ge2$) is $$mn(mn-1)-4[(m-2)(n-1)+(m-1)(n-2)].$$