9

It has already been answered (here) that it is impossible for the (continuously moving) hands of a clock to trisect the face of said clock. Even ideally the hour, minute, and second hand can never pairwise form 120 degree angles with each other. Can we find the time of day where they most nearly do?

To put a metric on this one could take the area of the smallest sector divided by the largest sector. (One being the unatainable optimum.) Or add up the amount by which the three angles are off.

$$\left|\frac{2\pi}{3} - \measuredangle H M\right| + \left|\frac{2\pi}{3} - \measuredangle H S\right| + \left|\frac{2\pi}{3} - \measuredangle M S\right|$$

where zero is now the unatainable optimum.

amcalde
  • 4,674

2 Answers2

5

Lemma. $$ \left| e^{i\,\alpha} - e^{i\,\beta} \right|^2 = \\ \left| \; \left[ \cos(\alpha) + i\,\sin(\alpha)\right] - \left[\cos(\beta) + i\,\sin(\beta) \right] \; \right|^2 = \\ \left[ \cos(\alpha) - \cos(\beta) \right]^2 + \left[ \sin(\alpha) - \sin(\beta) \right]^2 = \\ \cos^2(\alpha) - 2\cos(\alpha)\cos(\beta) + \cos^2(\beta) + \sin^2(\alpha) - 2\sin(\alpha)\sin(\beta) + \sin^2(\beta) = \\ 2 - 2\cos(\alpha-\beta) $$ Least Squares Method. Two possibilities: $$ \left| e^{i(\theta+2\pi/3)} - e^{i12\theta} \right|^2 + \left| e^{i(\theta-2\pi/3)} - e^{i720\theta} \right|^2 = \mbox{minimum}(\theta) \\ \left| e^{i(\theta-2\pi/3)} - e^{i12\theta} \right|^2 + \left| e^{i(\theta+2\pi/3)} - e^{i720\theta} \right|^2 = \mbox{minimum}(\theta) $$ Whatever minimum is the smallest. With the lemma: $$ 2 - 2\cos(\theta+2\pi/3-12\theta) + 2 - 2\cos(\theta-2\pi/3-720\theta) = \mbox{minimum}(\theta) \\ 2 - 2\cos(\theta-2\pi/3-12\theta) + 2 - 2\cos(\theta+2\pi/3-720\theta) = \mbox{minimum}(\theta) $$ Brute force algorithm with sampling $\Delta\theta = 2\pi/(60\times 720)$ :

program klok;
function minimum(theta : double; teken : integer) : double; begin minimum := 2 - 2*cos(theta+teken*2*pi/3-12*theta) + 2 - 2*cos(theta-teken*2*pi/3-720*theta); end;
function normal(theta : double) : double; var OK : boolean; v : double; begin v := theta; OK := false; while not OK do begin OK := (0 <= v) and (v < 2*pi); v := v - 2*pi; end; normal := v + 2*pi; end;
procedure brute_force(teken : integer); var k : integer; M,min,p,w : double; begin min := 8; w := 0; for k := 0 to 43200-1 do begin p := k*2*pi/43200; M := minimum(p,teken); if min > M then begin w := p; min := M; end; end; Writeln('Minimum =',min); Writeln('H =',w,' <',w+2*pi/43200); Writeln('M =',normal(12*w),' =',w+teken*2*pi/3); Writeln('S =',normal(720*w),' =',w-teken*2*pi/3); Writeln; end;
begin brute_force(+1); brute_force(-1); end.
Output (in radians):
Minimum = 1.32888417836478E-0004
H = 3.04690854166910E+0000 < 3.04705398577343E+0000
M = 5.14697596413128E+0000 = 5.14130364406230E+0000
S = 9.42477796078314E-0001 = 9.52513439275905E-0001
Minimum = 1.32888417839328E-0004 H = 3.23627676551049E+0000 < 3.23642220961482E+0000 M = 1.13620934304831E+0000 = 1.14188166311729E+0000 S = 5.34070751109978E+0000 = 5.33067186790368E+0000
Differentiation of the minimum functions, resulting in two equations: $$ 11\sin(11\theta-2\pi/3) + 719\sin(719\theta+2\pi/3) = 0 \\ 11\sin(11\theta+2\pi/3) + 719\sin(719\theta-2\pi/3) = 0 $$ Solving these with MAPLE, resulting in numerical refinement of the above:
Digits := 50;
fsolve(11*sin(11*theta-2*Pi/3)+719*sin(719*theta+2*Pi/3)=0,theta=3.0469..3.0470);
fsolve(11*sin(11*theta+2*Pi/3)+719*sin(719*theta-2*Pi/3)=0,theta=3.2362..3.2364);
Giving (Hours hand in radians):
3.0469223755142191756046177765785671073381009266460
3.2362629316653673013206689899804386610562378721043
Don't know which one of the two is the best. It looks like the minima are exactly the same, namely:
0.0000339325557414428099817512048046050292710528311
Han de Bruijn
  • 17,070
  • Looks like some good analysis. Let me just look it over first. – amcalde Aug 28 '14 at 13:36
  • Looking at all possible minima, I think I found a lower value. See my answer below. – amcalde Aug 28 '14 at 14:54
  • Note that your two solutions, $\theta_1=3.0469223...$ and $\theta_2=3.236262...$, sum to $2\pi=6.283185...$. This is as it should be, and explains why the minima are exactly the same: If you run the clock to a minimum and then look at it in a mirror, you'll see an identical minimum, but as if the clock were running backwards. So if a minimum occurs at time $\theta_1$, it also occurs at time $-\theta_1$, hence also at (positive) time $\theta_2=2\pi-\theta_1$. – Barry Cipra Aug 28 '14 at 21:22
  • @BarryCipra: Thanks for a crystal clear explanation of the phenomenon that $F_+ = F_-$ (adopting amcalde's notation). – Han de Bruijn Aug 29 '14 at 09:44
  • @amcalde: For such small differences: segment length $\approx$ arc length. Thus the square root of the minimum divided by $2\pi$ (and multiplied by $100$) is an estimate for the relative error in the $120$ degrees configuration. $\approx 0.1 %$ is found with my own answer; this is even better, of course, with the improved answer by yourself, namely $\approx 0.05 %$ . – Han de Bruijn Aug 29 '14 at 09:53
  • The (excellent) analysis by amcalde shows that it's easy to miss quite a few minima with the above brute force sampling method. In retrospect, I could have been aware of that :-( – Han de Bruijn Aug 29 '14 at 10:10
  • Indeed. In the above program, using instead a $60 \times$ refined sampling ($43200 \to 2592000$) and invoking MAPLE for finding the root in the neighbourhood gives the better approximation as published by amcalde. – Han de Bruijn Aug 30 '14 at 09:11
3

Expanding on Han de Bruijn's work I think we can do better. (To be gentlemanly, I'll award the bounty.) the two functions he sets out to minimize are:

$F_\pm(\theta) = 4 - 2\cos(\frac{2 \pi}{3} \mp 11 \theta)-2\cos(\frac{2 \pi}{3} \pm 719 \theta)$

Differentiating and simplifying, we find that the extrema of these functions are found at the roots of

$G_\pm(\theta) = 719 \cos(\frac{\pi}{6} \pm 719\theta)-11\sin(\frac{\pi}{3}+11\theta)$

There are 1437 such roots for each of $G_\pm$ over the interval $[0\le \theta<2\pi]$. Using Mathematica I found each one to high accuracy and substituted back into $F_\pm$. I found a unique minimum for $F_\pm$. I also found that the minima were the same but got a lower value:

{$\min F_\pm$, $\theta$} = { $8.483 \times 10^{-6}$, $1.52346119$ (radians of hour hand)}

So this happens at about $1.52346119*720/(2\pi) = 174.575$ minutes

Or at 02:54:34.54

amcalde
  • 4,674
  • (+1) for this nice improvement. Thanks for the bounty anyway. – Han de Bruijn Aug 28 '14 at 15:50
  • Why are we using trig functions so much? The angle variation, sector size, etc, they're all piecewise linear... – Dan Uznanski Aug 28 '14 at 16:20
  • What exactly is being minimized here, the sum of the absolute values of the errors, or the sum of their squares? – Barry Cipra Aug 28 '14 at 20:13
  • @BarryCipra The absolute difference (complex norm) between the vector positions of the hands of the clock and where they should be if they were to trisect the face. This is just one of many possible measures. – amcalde Aug 28 '14 at 20:21
  • @amcalde, it looks to me like you're minimizing the sum of the squares of the errors here. In general, different minimizations give (slightly) different answers. – Barry Cipra Aug 28 '14 at 20:46
  • @DanUznanski: Trig functions pop up spontaneously because the clock is represented mathematically by that beautiful complex function $e^{i\theta}$ . But if you can come up with something simpler and "piecewise linear", please be my hero and feel free to formulate another answer. – Han de Bruijn Aug 29 '14 at 10:01
  • @BarryCipra: The Least Squares norm has the enormous advantage that you can do calculus (differentiate) to find the minima (many more of these than I expected, though). – Han de Bruijn Aug 29 '14 at 10:05
  • @HandeBruijn, agreed, Least Square, aka the $L^2$ norm, has its advantages. It's just that the metric cited in the OP's displayed equation is an $L^1$ norm. I think that's what Dan Uznanski was referring to. Roughly speaking, the clock will pass through a possibly global minimum twice per hour (when the minute hand is more or less $20$ minutes past or before the hour hand and when the second hand is more or less $20$ seconds past or before the minute hand). If you locate the time intervals where these occur, the linearity Dan notes may prove easier to work with. – Barry Cipra Aug 29 '14 at 11:33
  • @BarryCipra: I would say: let someone just do it. I'm truly curious to see how that may prove easier to work with. – Han de Bruijn Aug 29 '14 at 11:53