Solution:
Suppose the 3×3 square is
We count the number of ways a board could have two knights attack each other using PIE. First notice that in any setup with two knights attack each other, the center square must be empty. Also, for any pair of knights that attack each other, one must be in a corner, and the other at the center of a nonadjacent side. There are
8⋅25 ways for one pair of knights to attack each other.
Next, we count the number of ways two pairs of knights attack each other: up to symmetry, there are four cases:
- knights at A, B, G, H, and D and E empty;
- knights at A, H, F, and B, D, E empty;
- knights at A, B, H, I, and D, E, F empty;
- knights at A, C, H, and D, E, F empty.
For each of these cases, there are four symmetries, so there are a total of 4⋅(23+23+22+23) ways to have two pairs of knights attack each other.
Next, there's only one way for three pairs of knights to attack each other, discounting symmetry: A, B, G, H, I have knights, and D, E, F empty. Then there are 4⋅2⋅2 ways for three knights to attack.
Finally, there is only one way for four knights to attack: knights at A, B, C, G, H, I and empty squares at D, E, F, for a total of 2 ways after counting symmetries.
Applying PIE, we get that the total number of boards with at least one pair of knights attacking each other is
8⋅25−4⋅(23+23+22+23)+4⋅2⋅2−2=158
Then the probability the 3×3 board has a pair of knights attacking each other is 29158=25679.