A friend of mine challenged me a while ago to find all the times where the hands of the clock are 180° from each other. The easy example of this is 6:00, but there are a total of 11 times in 12 hours where this occurs.

This may seem like a simple problem at first, but it is anything but. Below, I will prove the times where the clock’s hour and minute hands align.

First, let’s define some variables.

We can then reduce $D_m$ to terms of $H$.

$H-int(H)$ uses the $int$ function (which is comparable to the floor function in math.h or FLOOR in Excel) to get the decimal part of a number. $int(x)$ returns the largest integer that is not larger than x. Essentially, it chops off the decimal part of a (positive) number. For example, $int(\pi) = 3$, $int(0.999) = 0$, and $int(1) = 1$. In this context, $H-int(H)$ removes the whole number part of $H$, leaving only the decimal part. (The rules are slightly different for negative numbers, but that doesn’t matter in this case.)

This is useful because the minute hand of a clock does not depend on the hour, only the portion past the hour. If we define the hour as a decimal number, such as 3.5 for 3:30, the minute hand is positioned at $0.5 * 360 = 180\degrees$.

At this point, the angles of both hands have been defined; all we need to do is solve the equation for $D_h - D_m = 180$.

We know that at 6:00 the hour and minute hands line up, so let’s plug in 6.0 for $H$.

That works out, so we know the equation is correct. Let’s try 7:00.

7:00 doesn’t quite work. We need one more on the left than the right. In most cases, that would be impossible, but ignore that for a minute. The left side of this equation is $11H + 6$. We want this to equal 84, so let’s solve for $H$.

So when $H = 7{\frac1{11}}$, $11H + 6 = 84$. Now we need to put our new value of $H$ into $12int(H)$. This gives us $12int(7{\frac1{11}})$. The $int$ function takes off the fractional part, leaving us with $12*7 = 84$, the same as before.

$7{\frac1{11}} = 7.\overline{09} \approx 7 \text{ hours, } 5.5 \text{ minutes}$, so at about 7:05 the hour and minute hands are 180° apart. There is $1{\frac1{11}}$ hours between these two times where the hands line up, so it is a reasonable assumption that every $1{\frac1{11}}$ hours the hands line up.

At this point, we’ve gone until we hit a whole number. Most of these times, though, are after 12 o’clock. In these cases, we can apply the modulus function, $mod$. This gives us the remainder after dividing. For example, $13 \bmod 12 = 1$. It essentially says that the highest number is 11, then you wrap around to zero. (Formally, this is known as modular arithmetic.) We stopped adding at the whole number 18. $18 \bmod 12 = 6$, so we looped back around to six o’clock. If we plug any of these numbers back into the original equation for $H$, we will prove that at these times the hands of the clock are aligned.

When the hour is $8{\frac2{11}}$, the hands line up. Multiplying $\frac2{11}$ by 60 gives us around 10.9 minutes. At around 8:11, the hands are aligned. I won’t plug in every number here, but they all work out except for 18. While 18 doesn’t work, it is equivalent to 6:00, which we know works. This shows the domain of the equation: [6, 18). (In inequality notation, $6 \le H \lt 18$.)

In conclusion the clock hands align starting at 6:00 and every $1{\frac1{11}}$ hours afterwards. This works out to the following times: 6:00, 7:05, 8:11, 9:16, 10:22, 11:27, 12:33, 1:38, 2:44, 3:49, and 4:55. Five o’clock is the only hour where the hands do not align. After 4:55, they next align at 6:00, restarting the cycle. The times listed are approximate; I rounded the decimal part of the minute up to the nearest whole number.

You can graph this problem using WolframAlpha or by downloading this Grapher file if you use a Mac. Grapher is an application included with Mac OS X that nobody seems to know about that can graph most equations. It does not show solutions, though. WolframAlpha confirms the solutions I came to, as does an actual clock. I created the equations above without assistance, but initially solved the equation using WolframAlpha. Today, while writing this post, I figured out how to solve it without a graph.