## Clock hands symmetry

A long time ago, Dan Meyer took to the twitter-sphere with a question:

At the time I thought of doing some coding to figure out the answer, but I never got around to it. I will say, though, that it’s bugged me ever since. So, I finally decided to do something about it.

At first I thought I could put together a genetic algorithm to find the solution, but I got stuck on how to parametrize the problem. Then I found a good way to do it as a single parameter: time (duh). Once I had it down to a single parameter, I figured a genetic algorithm might be overkill. Instead I played around with tricking Mathematica to find lots of minima of a function.

First the parametrization: I realized that, at the symmetry point Dan refers to, if I set all the hands to have the same length, their vectors will add up to the null vector. So, I made a function that determined the length (actually I did the length squared because it saved a square root call) of the sum of the hands of the clock, as a function of time. Here’s what that function looks like if you plot it from noon to 3pm:

length (squared) of the sum of the hands of the clock from noon to 3pm

As you can see, there are lots of times it gets close to zero, but the question is whether it actually ever does. Consider the dip between 1000 and 1500 seconds. That corresponds to around 12:17 or so, when the hour and minute hands are roughly separated by 120 degrees. The second hand continues to sweep around and the function gets close to zero every time the second hand is over around the “8” or so. If you zoom in, however, you can see that none of those times brings the function to zero:

Zoomed in plot from 1000 to 1500 seconds. Note the zoomed in y-axis scale.

Now, on this one it looks like the dip around 1300 seconds is zero, but it’s not:

close look at the dip around 1300 seconds. The y-axis is zoomed further

So, does it ever nail it? I set about determining that by doing three different approaches:

First, I did an iterated FindRoot sequence. FindRoot will find all those dips if they get close enough to the axis. Of course, the problem with FindRoot is that it only finds one. So I did it as a sequence where I kept increasing the initial guess. This did end up finding all the dips, and then I asked Mathematica to determine the value in all of them, and then I found the minimum of that.

Second, I remembered that I had figured out once before how to find all the peaks/troughs/roots whatever of a function using a cool NDSolve feature:

So I did that, reaping all the points where f’[t] was zero, then sorting the solutions. This gave the same answer, though, I think, more accurate than the previous one.

Both of those approaches found that the closest the clock ever gets is at 2:54:34.560960612107436 (overkill, I know).

For the third approach, I thought I’d make it simpler. First I found all the times where the minute hand and hour hand were at exactly 120 degrees, and then find where the second hand is, compared with the perfect position. That lead to this image:

Best time: Black short is hour hand, black long is minute hand, red is actual second hand. Green is ideal 120 degree point.

This approach validated the conclusion of the first two: there is no time when they are all 120 degrees away from each other.

Some questions you might have:

1. Don’t you have a life?
2. How did you find all the times when the hour and minute hand were 120 degrees?
3. My clock’s second hand snaps to the integer seconds, will that have a solution?
4. If Dan Meyer asks, you should give the right answer, not just “it doesn’t happen.” That’s just rude.

Associate professor of physics at Hamline.
This entry was posted in fun, math, mathematica. Bookmark the permalink.

### 4 Responses to Clock hands symmetry

1. Dan Meyer says:

Two years ago … mercy. Extra credit for persevering.

• Andy "SuperFly" Rundquist says:

Really it just means I would notice the clock hands’ angles every once in a while. It’s funny that it took so long to come up with this simple parametrization, though, otherwise I’m sure I would have jumped on it sooner.

2. Rob Ryan says:

For the third approach, shouldn’t you choose all three combinations of two hands and check all positions where they’re at 120 degrees?

• Andy "SuperFly" Rundquist says:

That could certainly find a closer situation, but my approach should tell me if the perfect situation ever arises.