As a function of time in minutes, the minute hand angle has the formula
m(t) = pi/2 - 2*pi*tand the hour hand angle has the formula
h(t) = pi/2 - 2*pi*t/12
Consider the cosine of the angle between the minute hand M and the hour hand H:
cos ( h(t) - m(t) ).= cos ( 2*11*pi*t/12) = cos(11*pi*t/6)
11*pi*t/6 = 2*pi
t = 12/11 hours
11*pi*t/6 = pi
t = 6/11 hours
11*pi*t/6 = pi/2
t = 3/11 hours
The minute and hour hand start out at the same spot at midnight, and return at noon, so we have to consider all the times in that interval. The minute hand and hour hand travel at velocities of 1 mark/minute and 1/12 mark/minute (where I'm using mark to denote the minute marks on the clock face.) If the two hands were traveling in a straight line, the distance between them after M minutes would be:
D = M * ( 1 - 1/12 ) = 11 * M / 12Now D actually represents the difference in the distance the two hands have traveled, and that's true even on the clock, although D no longer represents the difference in position.
To find the difference in position, we have to use the mod function. To find a time when the hands differ by exactly two minutes is equivalent to finding a time in minutes M so that:
( 11 * M / 12 ) mod 60 = + 2 or -2 = + 2 or + 58
Now the puzzle specified that the hour hand pointed to an exact minute. This is equivalent to saying that the number of minutes after midnight M is a whole number multiple of 12. Therefore, for any solution we find, not only will M be an integer, but so will T = M / 12. Therefore, we are justified in rewriting the equation in terms of T, and looking only for integer solutions:
11 * T mod 60 = 2 or 58
Since we are only looking at integer solutions, we are considering the sequence of values as T starts out at 0, and continues through 1, 2, 3, and possibly a lot longer. The values of interest are the sequence of values 11 * T mod 60. Since 11 is relatively prime to 60, we know the sequence 11, 22, 33, ... will attain every possible nonzero remainder, modulo 60, in the first 59 entries, achieving 0 on the 60th step. That means that we are guaranteed exactly one solution for +2 and one for -2, in other words, there will be exactly one time when the hour hand is two minutes ahead, and one time when it is two minutes behind.
This also means that after 60 x 12 minutes, the hands will coincide again, that is, after 12 hours (we knew that) and not before (we might not have known that).
(Well, that must be wrong, mustn't it? We know the minute hand passes over the hour hand 11 times between midnight and noon. Yes, that's true, but it can't happen on an exact minute!)
So let's return to the sequence, which represents the distance between the two hands. An interesting point is to note the value that "wraps around" after 60 minutes.
11, 22, 33, 44, 55, | 66 = 6because the 6 is the "seed" for the next set of values:
6, 17, 28, 39, 50, | 61 = 1
Now we already know that we've got to have a solution for 2 and 58. Let's just try to see in advance roughly where these solutions will occur. 2 is a seed value all by itself. To hit 58, we need the seed of the sequence which, backwards, is 58, 47, 36, 25, 14, 3; in other words, 58 occurs in the sequence with seed 3. But now we notice that the seeds drop by 5 each cycle, so their sequence is:
11, ... 6, ... 1, ... 7, ... (drop by 5, or go up by 6 if negative) 2, ... <--- here's our 2 minute difference 8, ... 3, ...<--- here's where our sequence ending in 58 begins 9, ... 4, ... 10, ... 5, ... 0. <-- 12 noon.
So now when exactly are these times? We have to actually enumerate the times, since there can be either 5 or 6 values in a cycle. So if we generate values til we reach 2, we have:
11, 22, 33, 44, 55, 6, 17, 28, 39, 50, 1, 12, 23, 34, 45, 56, 7, 18, 29, 40, 51, 2,so the 2 represents T = 22, but we were counting T in groups of 12 minutes, so 22 * 12 minutes after midnight, so that's 4:24, when the minute hand is exactly on the 24 minute mark, and the hour hand is on the "4 hours and 24 minutes" mark, which is the 22 minute mark.
Continuing, to find 58, we compute:
2, 13, 24, 35, 46, 57, 8, 19, 30, 41, 52, 3, 14, 25, 36, 47, 58so the 58 occurs after 38 intervals of 12 minutes, or 35 + 3 intervals, namely 7 hours and 36 minutes. At that time, the minute hand is exactly on the 36. The hour hand is on the "7 hours and 36 minutes" mark, = the 35 minute mark + 3 minutes = 38 minute mark.
These two times have to be "symmetric", since a watch going forwards from midnight and a watch going backwards from noon must always be mirror symmetric. And in fact, the second time is actually 4 hours and 24 minutes before noon, so we could have deduced that without working it out.
A more concise solution has been supplied by Sudarshan Chawathe of the University of Maryland, who reasons as follows:
We use the term marker to refer to the ticks marking off minutes on the clock dial; the markers 5, 10, 15, ..., 50 and 55 are called hour markers. The short hand moves over five markers every hour; thus it moves from one marker to the next every 12 minutes. Therefore, the only times that the short hand is directly over a minute marker are at 0, 12, 24, 36 and 48 minutes past the hours. At those times, the long hand is on the 0th, 12th, 24th, 36th and 48th markers. Now we use the requirement that the long hand be exactly two markers away from the short hand.
- When the minute hand is on the 0th marker, the hour hand is also on an hour marker, and hence cannot be two markers away.
- When the minute hand is on the 12th marker, the hour hand is one marker ahead of an hour marker, which cannot be the 10th or 14th markers, so there are no solutions.
- When the minute hand is on the 24th marker, the hour hand is two markers ahead of an hour marker, which means 4:24 is a solution.
- When the minute hand is on the 36th marker, the hour hand is three markers ahead of an hour marker, which means that 7:36 is a solution.
- When the minute hand is on the 48th marker, the hour hand is four markers ahead of an hour marker, which cannot be the 46th or 50th markers, so there are no solutions.