Re: [math-fun] sketched proof of Knight distance formula
This formula works: kd = Function[{ox, oy}, Module[{x = Max[Abs[ox], Abs[oy]], y = Min[Abs[ox], Abs[oy]], p = 0}, p = If[3 x < 2 (x + y), (x + y + 1)/3, (x + 1)/2]; If[Mod[x + y, 2] == 0, p = 2 Floor[(p + 1)/2], p = 2 Floor[p/2] + 1]; If[x == 1 && y == 0, p = 3]; If[x == 2 && y == 2, p = 4]; p]]; Proof: It suffices to verify that kd[0, 0] = 0 and kd[x, y] = 1 + Min[kd[x + 1, y + 2], kd[x + 2, y + 1], ..., kd[x - 2, y - 1]], in which case we are done by induction on the value of kd[x, y]. Both of these are absolutely trivial to verify, although the latter is a messy case-bash (having to special-case squares near the lines 2|x| = |y| and 2|y| = |x|). Sincerely, Adam P. Goucher
----- Original Message ----- From: Dan Asimov Sent: 04/12/14 02:54 PM To: math-fun Subject: Re: [math-fun] sketched proof of Knight distance formula
Let f(K,L) := the smallest number of knight moves {(+-2,+-1),(+-1,+-2)} it takes to get from square (0,0) to square (K,L) on an infinite chessboard.
WLOG assume K,L > 0.
Then find an explicit way to express f(K,L), and prove its correctness.
--Dan
On Apr 12, 2014, at 6:18 AM, David Wilson <davidwwilson@comcast.net> wrote:
I've kind of lost track of this thread. What exactly is the "Knight distance formula" to be proved?
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
participants (1)
-
Adam P. Goucher