After an earlier version of the program below narrowed down the minimum total deviations to 2:54:34+ and 9:05:25+, the following program produced a somewhat finer detail:
DEFDBL AZ
DATA 2,54,9,5
PRINT
leastDiff = 5
h = 2: m = 54
hd = h * 30
md = m * 6
FOR s = 34 TO 35 STEP .0000001#
sd = s * 6
hhdeg = hd + (m / 60 + s / 3600) * 30
mhdeg = md + (s / 60) * 6
shdeg = sd
hmDiff = ABS(hhdeg  mhdeg): IF hmDiff > 180 THEN hmDiff = 360  hmDiff
hsDiff = ABS(hhdeg  shdeg): IF hsDiff > 180 THEN hsDiff = 360  hsDiff
smDiff = ABS(shdeg  mhdeg): IF smDiff > 180 THEN smDiff = 360  smDiff
totDiff = ABS(hmDiff  120) + ABS(hsDiff  120) + ABS(smDiff  120)
IF totDiff <= .3337972 THEN
PRINT h; m; s, totDiff
leastDiff = totDiff
END IF
NEXT s
h = 9: m = 5
hd = h * 30
md = m * 6
FOR s = 25 TO 26 STEP .0000001#
sd = s * 6
hhdeg = hd + (m / 60 + s / 3600) * 30
mhdeg = md + (s / 60) * 6
shdeg = sd
hmDiff = ABS(hhdeg  mhdeg): IF hmDiff > 180 THEN hmDiff = 360  hmDiff
hsDiff = ABS(hhdeg  shdeg): IF hsDiff > 180 THEN hsDiff = 360  hsDiff
smDiff = ABS(shdeg  mhdeg): IF smDiff > 180 THEN smDiff = 360  smDiff
totDiff = ABS(hmDiff  120) + ABS(hsDiff  120) + ABS(smDiff  120)
IF totDiff <= .3337972 THEN
PRINT h; m; s, totDiff
leastDiff = totDiff
END IF
NEXT s
2 54 34.54798330640379 .3337969844352671
2 54 34.54798340640379 .3337969578406614 *
2 54 34.54798350640379 .3337969761740283
2 54 34.54798360640379 .3337969945073525
2 54 34.54798370640379 .3337970128407051
2 54 34.54798380640379 .3337970311740719
2 54 34.54798390640379 .3337970495074245
2 54 34.54798400640379 .3337970678406776
2 54 34.5479841064038 .3337970861740018
2 54 34.5479842064038 .333797104507326
2 54 34.5479843064038 .3337971228406929
2 54 34.5479844064038 .3337971411740455
2 54 34.5479845064038 .3337971595073981
2 54 34.5479846064038 .3337971778407649
9 5 25.4520154052823 .333797175698237
9 5 25.4520155052823 .3337971573648844
9 5 25.4520156052823 .3337971390315602
9 5 25.4520157052823 .3337971206981933
9 5 25.4520158052823 .3337971023649828
9 5 25.4520159052823 .3337970840316302
9 5 25.4520160052823 .3337970656982634
9 5 25.4520161052823 .3337970473648966
9 5 25.45201620528231 .333797029031544
9 5 25.45201630528231 .3337970106982198
9 5 25.45201640528231 .3337969923648529
9 5 25.45201650528231 .3337969740316424
9 5 25.45201660528231 .3337969556982898 *
9 5 25.45201670528231 .3337971223312479
the minimum for the given increments being marked with an *.
The two solutions are mirror images, resulting from running the clock forwards to after noon and backwards to before noon (or midnight).
Analytically we should be able to get an exact time:
At 2:54:34, the number of degrees advanced clockwise from the straight up position for the hands are:
hour hand: (2+54/60+34/3600)*30 = 87 + 17/60
min. hand: (54+34/60)*6 = 327 + 2/5
sec. hand: 34*6 = 204
Shown with their distances from each other these are:
position difference
h: 87 + 17/60
119 + 53/60
m: 327 + 2/5
123 + 2/5
s: 204
116 + 43/60
h: 87 + 17/60
As the second hand is the fastest, advancing the time beyond 2:54:34 will both decrease the distance to the minute hand and increase the distance to the hour hand.
During the course of one minute, the second hand advances 360 degrees while the minute hand advances 6 degrees, so the relative motion is 354 degrees/minute or 5 + 9/10 degrees per second, and at the instant in reference above, the second hand is closing the gap. To bring the second hand exactly 120 degrees behind the minute hand will require (3 + 2/5) / (5 + 9/10) = 34/59 seconds.
On the other hand (pun accidental), the hour hand moves only 1/2 degree during the course of one minute, so the relative motion of the second hand vs the hour hand is 359.5 degrees per minute or 5 + 119/120 degrees per second. So to bring the second hand 120 degrees from the hour hand requires (3 + 17/60) / (5 + 119/120) = 394/719 seconds.
As 34/59 is later than 394/719, the exactness of the second hand's 120deg distance comes sooner with the hour hand than with the minute hand.
Of course hourhand/minutehand distance also is under consideration. In one hour, the minute hand moves 360 degrees while the hour hand moves 30 degrees so the relative motion is 330 degrees per hour or 330/3600 = 11/120 degree per second.
At 2:54:34 + 394/719 s, when the second hand and hour hand are exactly 120 degrees apart, the hour hand and minute hand are 119 + 599/719 degrees apart; then at 2:54:34 + 34/59 s, when the second hand and minute hand are exactly 120 degrees apart, the hour and minute hands are 119 + 49/59 degrees apart, which is less.
So the total discrepancy at the first time is lower than that at the second time.
Now, prior to the first of the two instants (second hand being 120 degrees from hour hand) the secondhour and secondminute were both improving, while the slower hourminute was already getting worse. Between the two instants of exact equality for the second hand (hour and minute), the secondminute situation was improving at 5 + 9/10 degrees per second, the secondhour situation was deteriorating at 5 + 119/120 degrees per second and the hourminute situation deteriorated at 11/120 degrees per second, for a net deterioration of 11/60 degree per second. So the instant of exact 120 degrees between second and hour hand is the best in this interval.
After the second of the two instants (second hand 120 from minute hand), the deterioration was even geater as both, large secondhand discrepancies were increasing.
So the best time was 2:54:34 + 394/719 sec., and the corresponding mirror image at 9:05:25 + 325/719 sec., or approximately 2:54:34.5479833101529902642 and 9:05:25.4520166898470097357.
position diff from 120 separation
87 + 207/719
120/719
327 + 327/719
120/719
207 + 207/719

240/719 or about 0.3337969401947148817 degrees total discrepancy

Posted by Charlie
on 20090410 16:38:52 