Quite A Knight

A knight stands on an infinitely large chess board, on a square with coordinates ( 0 , 0 ) (0,0) . Through a sequence of valid knight's moves, it can reach square ( 22 , 18 ) (22,18) .

Question 1: What is the minimum number of moves needed to accomplish this?

Question 2: How many different sequences of moves of minimum length accomplish this?

Report your answers by concatenating them. For instance, if there answer to question 1 is 83 and the answer to question 2 is 155, post the solution "83155".


The answer is 1428028.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Mark Hennings
Apr 13, 2016

Knight's moves involve translations through ± ( 2 1 ) \pm{2 \choose 1} , ± ( 2 1 ) \pm{2 \choose -1} , ± ( 1 2 ) \pm{1 \choose 2} and ± ( 1 2 ) \pm{-1 \choose 2} . If we are going to move from ( 0 , 0 ) (0,0) to ( 22 , 18 ) (22,18) in the least number of moves, we will only be interested in moves that increase the sum x + y x+y of the coordinates ( x , y ) (x,y) of the squares visited. This cuts the number of possible moves in half. Note that this simplification is possible because there exist solutions which only use "positive" moves.

Suppose that we move from ( 0 , 0 ) (0,0) to ( 22 , 18 ) (22,18) after a total of a a translations by ( 2 1 ) {2 \choose 1} , b b translations by ( 2 1 ) {2 \choose -1} , c c translations by ( 1 2 ) {1 \choose 2} and d d translations by ( 1 2 ) {-1 \choose 2} . Then 2 a + 2 b + c d = 22 a b + 2 c + 2 d = 18 , 2a + 2b + c - d \; = \; 22 \qquad \qquad a - b + 2c + 2d \; = \; 18 \;, and hence ( a c ) + 3 ( b d ) = 4 3 ( a + c ) + ( b + d ) = 40 . (a - c) + 3(b - d) \; = \; 4 \qquad \qquad 3(a + c) + (b + d) \; = \; 40 \;. We want a , b , c , d a,b,c,d to be nonnegative integers, and for a + b + c + d a+b+c+d to be as small as possible. Since 40 = ( a + b + c + d ) + 2 ( a + c ) 40 \,=\, (a+b+c+d) + 2(a+c) , we want a + c a+c to be as large as possible, and hence b + d b+d must be as small as possible. Since b + d 1 ( m o d 3 ) b+d \equiv 1 \pmod{3} , the best we can hope for is b + d = 1 b+d=1 . There are two solutions with b + d = 1 b+d=1 , namely a = 7 , b = 1 , c = 6 , d = 0 a = 10 , b = 0 , c = 3 , d = 1 . a = 7, b = 1, c = 6, d = 0 \qquad \qquad a = 10, b = 0, c = 3, d = 1 \;. Either of these solutions involve a total number of 14 14 translations. Thus the minimum number of moves from ( 0 , 0 ) (0,0) to ( 22 , 18 ) (22,18) is 14 14 .

There are 14 ! 7 ! 6 ! 1 ! = 24024 \frac{14!}{7! 6! 1!} \,=\, 24024 ways of achieving the first type of move, and 14 ! 10 ! 3 ! 1 ! = 4004 \frac{14!}{10! 3! 1!} \,=\, 4004 ways of achieving the second type of move. Thus there are a total of 28028 28028 ways of getting from ( 0 , 0 ) (0,0) to ( 22 , 18 ) (22,18) in 14 14 moves.

The answer is the concatenation of 14 14 and 28028 28028 , namely 1428028 \boxed{1428028} .

Yes, that is exactly it!

Arjen Vreugdenhil - 5 years, 2 months ago

One detail, though: One cannot assume beforehand that only moves are needed that increase x + y x + y .

If we were to arrive at ( 23 , 18 ) (23, 18) , you would find these paths of length 15:

1
2
3
a: 12; b: 0; c: 1; d: 2; 1365
a: 9; b: 1; c: 4; d: 1; 150150
a: 6; b: 2; c: 7; d: 0; 180180

but miss out on

1
2
a: 11; b: -1; c: 3; d: 0; 5460
a: 8; b: 0; c: 6; d: -1; 45045

which also are paths of length 15...

Arjen Vreugdenhil - 5 years, 2 months ago

Log in to reply

Since solutions exist which always increase x + y x+y , the question is academic. Looked at another way, any solution which decreases x + y x+y at any stage must take at least 15 15 moves (at least one negative move and at least 14 14 positive moves of 1 1 or 3 3 to recoup the more than 40 40 points of x + y x+y needed to get from ( 0 , 0 ) (0,0) to ( 22 , 18 ) (22,18) . Again, since solutions of length 14 14 exist, negative moves can be ignored...

Mark Hennings - 5 years, 2 months ago

Log in to reply

That is correct; I just missed this reasoning step in your solution. It is instructive to see where the case ( 23 , 18 ) (23, 18) goes different. Instead of 40 40 and 4 4 we now have 41 41 and 5 5 ; now b + d 2 b + d \equiv 2 mod 3. This leads to the solutions with ( b , d ) = ( 0 , 2 ) ; ( 1 , 1 ) ; ( 2 , 0 ) (b,d) = (0,2);\ (1,1);\ (2,0) .

However , we can also consider this a case where b + d 1 b + d \equiv -1 mod 3, and use ( b , d ) = ( 1 , 0 ) ; ( 0 , 1 ) (b,d) = (-1,0);\ (0,-1) . They turn out to have the same total length as the "positive" solutions.

In the original problem this would correspond to solving b + d = 2 b + d = -2 . It is true that these would lead to longer paths, but it is not trivial!

Btw, your posted solution in the second display equation has = 0 = 0 where is should be = 18 = 18 .

Arjen Vreugdenhil - 5 years, 2 months ago

Log in to reply

@Arjen Vreugdenhil Yes, your problem, as stated, is right on the edge. Change it slightly and it becomes hugely more complex! Thatnks for spotting the typo.

Mark Hennings - 5 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...