—

By using the observation that the minimum distance occurs when J is travelling directly towards K, you can deduce the equation for the minimum distance as:

or more generally:

where is the ratio and is the initial distance between Joe and Ken.

By differentiation we find this is minimised in the case where .

And the solution follows.

—

Very nice.

]]>Yes. It does.

]]>def check(a, b): # check combinations below 120 N = 120 c = [0] * N for n in range(0, int(N / a) + 1): for m in range(0, int((N - a*n) / b) + 1): s = a*n + b*m if not(s < N): continue c[s] += 1 if not(c[59] == 1): return if c[:60].count(0) 1]) 1]) < N - 60: return print(a, b, c[:60], c[60:]) # OK, let's assume a < b for b in range(3, 60): for a in range(2, b): check(a, b)

**Edit:** When edited the post remains unmangled.

def check(a, b): # check combinations below 120 N = 120 c = [0] * N for n in range(0, int(N / a) + 1): for m in range(0, int((N - a*n) / b) + 1): s = a*n + b*m if not(s < N): continue c[s] += 1 if not(c[59] == 1): return if c[:60].count(0) 1]) 1]) < N - 60: return print(a, b, c[:60], c[60:]) # OK, let's assume a < b for b in range(3, 60): for a in range(2, b): check(a, b)

**Edit:** Editing the comment causes the parameters to the [sourcecode] tag to be messed up, resulting in a mangled comment unless it is fixed up manually.

from fractions import Fraction

from collections import Counter

ms = Counter()

for x in range(15, 255, 15):

for y in range(0, 195, 15):

ms[Fraction(y – 80, x)] += 1

print(len([m for m in ms.values() if m > 1]))

**Update:** I am now editing the post just to add this content after the code. In the editor the quotes around the value for the `language` attribute to the `sourcecode` tag were presented doubled (i.e. there where two sets of double quotes around the value `python`). I have not corrected this manually. As you can see when the comment is updated the code does not display correctly.

To delete a comment, just log in, and view the posts’ comments, there you will have the option to edit or delete them. ]]>