June 24, 2019

Fun with lattices: When do the hands of a clock point 120 degrees apart?

Do the hands of a clock ever point 120 degrees apart? This is a question I have been having for a long time, but for almost as long I have known that there is no exact solution to this problem.

However, today I found the solution to a related problem: When do the hands of a clock approximately point 120 degrees apart?

TL;DR: At 05:49:09 and 06:10:51

This can be formulated as a lattice reduction problem, here shown in Sage:

x = 60*60*12 # number of possible positions for the hour hand
a = x/3      # one third
W = x*x*x    # just a huge number weight for LLL to work

# First three columns: hand positions
# Last two: weight and elapsed time in seconds
#       h     m        s  w  t
M = [[  x, 12*x, 12*60*x, 0, 1], # one second tick
     [x*x,    0,       0, 0, 0], # hour hand modulus
     [  0,  x*x,       0, 0, 0], # min  hand modulus
     [  0,    0,     x*x, 0, 0], # sec  hand modulus
     [  x,    x,       x, 0, 0], # rotation does not matter
     [  0,  a*x,    -a*x, W, 0]] # equilateral position to be reduced

print Matrix(M).LLL()

This gives the answer in the last column of the row with the weight: 20949 seconds before/after midnight/noon. This is at 05:49:09 and 06:10:51. And indeed, at this times the angles between the hands are nearly 120 degrees but not perfectly so.

No comments:

Post a Comment