How many different knight's moves are there on an $n \times n$ chessboard?

2k Views Asked by At

I have found there to be $48$ total moves on a $4 \times 4$ board... and $96$ on a $5 \times5$... but I can not see the relevance to each other in terms of a "$n \times n$" board.

By "moves" I am referring to from each space the amount of moves available from it.

Example

3

There are 3 best solutions below

0
On BEST ANSWER

Extending your example ...

For the top row you get 2,3,4,4,....,4,4,3,2

For the second row you get 3,4,6,6,....,6,6,4,3

For the third 4,6,8,8,...,8,8,6,4

For the fourth also 4,6,8,8,...,8,8,6,4

...

[and then the mirror of that for the bottom 4 rows]

So:

With $n\ge 4$ you get:

$2+3+(n-4)*4+3+2=10 +4*(n-4)$ for rows 1 and $n$

$3+4+(n-4)*6+4+3=14+6*(n-4)$ for rows 2 and $n$

$(n-4)*(4+6+(n-4)*8+6+4=(n-4)*(20+8*(n-4))$ for all other rows

For a total of

$$2*(10+14)+ (2*(4+6)+20)*(n-4)+ 8*(n-4)^2 = $$

$$48+40*(n-4)+8*(n-4)^2$$

Check: for $n=4$ we indeed get 48. For $n=5$, we get $48+40+8=96$ (So your 98 was a bit off)

0
On

Note: I am not counting different moves that end on the same square.

On an $n x n$ board:

On the 4 corners there are 2, for 8 total.

On the squares on the border adjacent to the corners there are 3 for $3\cdot 8 = 24$.

For the squares adjacent diagonally there are 4 for $4\cdot 4 = 16$.

For the $n-4$ on each border not yet counted there are 4 for $4\cdot 4\cdot (n-4) =16n-64$.

For the 2 at offset $(1, 1)$ from each corner there are 4 for $4 \cdot 4 \cdot 2 = 32 $.

For the $n-4$ that are one from the border not yet counted there are 6 for $6\cdot 4 \cdot (n-4) = 24n-96$.

For the remaining $(n-4)^2$ not in the two border rows, each has 8 for $8\cdot (n-4)^2$.

Add these up to get the total number of knight moves.

This might even be correct, but it should be easy to correct any errors.

1
On

A knight move can go in one of $8$ directions: if we think of squares on the chessboard as being given coordinates $(x,y)$ with $1 \le x,y \le n$, then our options are to add one of $$\{(2,1), (2,-1), (1,2), (1,-2), (-1,2), (-1,-2), (-2,1), (-2,-1)\}$$ to $(x,y)$.

For each direction, there are $(n-1)(n-2)$ ways to choose a valid starting square without going off an $n \times n$ board:

  • If we're adding $1$ to a coordinate, it can be one of $\{1,2,\dots,n-1\}$, and if we're subtracting $1$, it can be one of $\{2,3,\dots,n\}$, for $n-1$ choices either way.
  • If we're adding $2$ to a coordinate, it can be one of $\{1,2,\dots,n-2\}$, and if we're subtracting $2$, it can be one of $\{3,4,\dots,n\}$, for $n-2$ choices either way.

So the total number of knight moves is $8(n-1)(n-2)$.