A rook stands in a corner of an $n$ by $n$ chess board. For what $n$, moving alternately along horizontals and verticals, can the rook visit all the cells of the board and return to the initial corner after $n^2$ moves? (A cell is visited only if the rook stops on it, those that the rook “flew over” during the move are not counted as visited.) Proposed by A. Spivak
Problem
Source:
Tags:
howie2000
18.05.2014 06:48
In a $n$ by $n$ chessboard, the rook can move along each row and then move one square to the next row and go down that row and then move one more square to the next row, etc... until the rook has covered the whole board. For each trip down a row of the board and then taking the extra move to the next row, there are $n-1+1=n$ moves. Since there are $n$ columns and the last row does not have an extra move, we have that a there are a total of $n^2-1$ moves required to cover the whole board. From there, there are either $n-1$ or $2(n-1)$ moves required to get back to the original corner. Thus, solving the equations $n^2-1+n-1=n^2$ and $n^2-1+2n-2=n^2$ yields $n=\boxed{1,2}$
EDIT: oops the problem says alternating horizontal and vertical moves. 1 and 2 still work so...
Zimbalono
20.05.2014 16:36
For odd $n>1$, the answer is no. When the rook visits a square in one particular row, it must immediately visit another square in the same row, and then leave; so the squares in a given row must be visited in pairs. If the rook tries to complete an initially empty row with an odd number of squares, it will get stuck.
For even $n$, the tour is possible. Suppose we start in the bottom-left corner, $(n,1)$. First we move to $(1,1)$ and visit all the squares in the first two rows using the single-step pattern right-down-right-up, ending with a downward move into $(2,n)$ before going back to $(2,1)$. Then we move to $(3,1)$ and repeat the pattern, two rows down. Repeating this for every pair of rows lands us in $(n,n)$, from which we can return to $(n,1)$.
[asy][asy]
int n=8;draw((0,n)--(n,n)--(n,0));
for(int i=0;i<n;++i){draw((0,i)--(n,i));draw((i,0)--(i,n));}
for(int i=0;i<n;++i)for(int j=0;j<n;++j)dot((i+.5,j+.5));
currentpen=magenta+linewidth(.4mm);
draw((.5,.5)--(.25,.75)--(.25,n-.75)--(.5,n-.5));
path p=(0,0)--(1,0)--(1,1)--(2,1)--(2,0);
for(int i=0;i<n;i=i+2){for(int j=2;j<n;j=j+2){draw(shift((j-.5,i+.5))*p);}draw((.5,i+1.5)--(1.5,i+1.5)--(1.5,i+.5)^^(n-.5,i+.5)--(n-.75,i+.25)--(.75,i+.25)--(.5,i+.5));if(i>0){draw((.5,i+.5)--(.5,i-.5));}}
[/asy][/asy]
mathtastic
21.05.2014 00:48
What does the problem mean by "moving horizontally and vertically"?
SZRoberson
21.05.2014 05:20
mathtastic wrote: What does the problem mean by "moving horizontally and vertically"? It means moving along ranks, then files (or files, then ranks), alternating. For example, if your A1 rook moves to A5, your next move must be to one of B5, C5, ..., H5.