A knight is placed on a corner square of a chessboard. A move consists of moving the knight to a square reachable by two horizontal steps followed by one vertical step, or two vertical steps followed by one horizontal step. In how many ways is it possible to move it to the opposite corner square, with exactly 12 moves?
Solution
Solution:
The answer is 992. Observe that the knight will always move on squares adjacent to the perimeter of the chessboard (all except the central one) and that from each square two moves are possible: one that moves the knight forward by 3 squares on the perimeter in the clockwise direction, and one that moves it by 3 squares in the counterclockwise direction. If we number the squares of the perimeter of the chessboard from 1 to 8 in the clockwise direction, where square 1 is the starting one, the moves of the knight can be represented as in the following figure: each move takes the knight from the vertex of the corresponding octagon where it is located to one of the two adjacent ones, depending on whether it is clockwise or counterclockwise. To reach the opposite corner, the knight must move a total of 4 positions on the octagon, plus possibly an integer number of laps of the octagon (8 moves clockwise or counterclockwise bring the knight back to the starting square).
Let be the number of moves made clockwise, the number of moves made counterclockwise; we must count the number of possible paths in which (12 moves in total are made) and is a number of the form (with an integer). The ordered pairs of possible solutions (with and non-negative) are the following: ; ; ; .

The first two pairs represent the two paths in which the knight makes all its moves clockwise or counterclockwise. The other two pairs represent paths in which 8 moves are made clockwise and 4 counterclockwise, or vice versa; the number of such paths is given by the number of ways in which it is possible to choose the order of the moves: in particular, this is in both cases (among the 12 moves to be performed, from the first to the twelfth, the 4 that will be carried out counterclockwise in the first case, clockwise in the second, must be chosen).
The total therefore is .