Brain-Teaser 438: Electric clock
From The Sunday Times, 28th September 1969 [link]
My watch keeps perfect time and so does my electric wall clock until the battery starts to run down. I check the clock every noon, and when I find that it has lost a minute in 24 hours I know that it will slow down by an additional minute each day until the battery is exhausted.
At noon on a day towards the end of August, when I was preparing for a fortnight’s holiday, I noticed that the clock was one minute slow but. I forgot to do anything about it. As I hurried off to catch my train, at noon on 1st September, I saw that the clock was exactly 21 minutes slow. I put it right and left it at that.
Family matters forced me to return earlier than I had expected and on my arrival home I found that the clock was still going. I then noticed that the hands of my watch were exactly overlapping, while the hands of the clock were almost so.
It took me only a minute to fix a new battery, and I at once put the clock on the correct time. In doing so the hands crossed each other three times.
On what date did I return from my holiday?
This puzzle is included in the book Sunday Times Brain Teasers (1974).
[teaser438]
Jim Randell 9:18 am on 2 July 2023 Permalink |
The clock is 21 minutes slow on 1st Sep, and as 21 is the 6th triangular number it must be progressing as follows (minutes slow at noon on the specified date):
A 12 hour clock has overlapping hands at 12:00, and then every 12/11 hours later.
So we can check times that are multiples of this gap (up to 14 days), and look for times when the hands on the wall clock are separated by a small angle, and it would require 3 crossings of the hands to set to clock to the correct time.
As the clock is set to a time just after the hands have crossed the amount the clock has lost must be greater than 131 minutes. So the earliest possible date of return is 12th Sep. And a return on 14th Sep wouldn’t be an early return, so the answer must be 12th Sep or 13th Sep.
This Python program starts by constructing a continuous function to give the amount the clock is slow at any particular time, and it does this by using polynomial interpolation of the times given above at noon on the 1st to 14th Sep. (And as we might expect, that function turns out to be a quadratic polynomial).
It then looks at times when the hands of a correct clock are overlapping, and calculates the angular distance between the hands on the slow clock. If the hand are less than 10° apart, and setting the clock right requires crossing the hands exactly 3 times, then we have found a solution.
It runs in 66ms. (Internal runtime is 2.4ms).
Run: [ @replit ]
from enigma import (Rational, Polynomial, irange, mdivmod, divc, sprintf, printf) Q = Rational() # after h hours, loss (in minutes) is t h = t = 0 ps = [(h, t)] for i in irange(7, 19): h += 24 t += i # remove (<time>, <loss>) (both in hours) ps.append((h, Q(t, 60))) # p: hour -> hours lost p = Polynomial.interpolate(ps) printf("[p(x) = {p}]") # calculate hand positions from time in hours (between 0 and 1) def pos(t): (z, h, m) = mdivmod(t, 12, 1) return (Q(h + m, 12), m) # angular distance between hand positions (between 0 and 1) def ang(t): (h, m) = pos(t) d = abs(h - m) return min(d, 1.0 - d) # format a time (in hours) def fmt(t): (d, h, m) = mdivmod(t, 24, 1) return sprintf("{d:d}+{h:02d}:{m:05.2f}", m=float(m * 60)) # gap between times of successive overlapping hands g = Q(12, 11) # continue forward from noon on 1st Sep in 12/11 hour increments for i in irange(1, 11 * 28): # actual elapsed time (hours) h = i * g # time lost (hours) x = p(h) # calculate the number of crossings in setting the clock to the correct time k = divc(x, g) if k != 3: continue # clock elapsed time (hours) t = h - x # calculate the angular distance between the hands d = ang(t) # look for distances less than 10 degrees if not (0 < 360 * d < 10): continue # output solution printf("[i={i}] {h} -> {t}; {d:.2f} deg; {k} crossings", h=fmt(h), t=fmt(t), d=float(360 * d))Solution: You returned home on 12th September.
The polynomial that gives the time lost (in hours) from the time of departure (noon on 1st Sep) is:
If the setter returned home at noon on 12th Sep, then the clock would be 132 minutes slow, so it would be showing 9:48am. And the hands are 6° apart, and the minute hand is slightly behind the hour hand.
The battery is replaced and the clock is set to 12:01pm, which involves the hands crossing at: just before 10, just before 11, 12. So the hands cross 3 times.
And this is the solution given in the book.
However the program finds a “better” solution.
If the setter were to return at 10:54am on 12th Sep (i.e. the previous time the hands on the watch coincide), then the clock would be displaying 8:43am, and the hands are just 1.6° apart, with the minute hand slightly behind the hour hand.
The battery is replaced and the clock set to 10:55am. So the hands cross at: just before 9, just before 10, just before 11. So the hands cross 3 times, and they started out much closer together than the given solution.
I also think that the wording of the puzzle implies that setter returned home at an overlapping time other than noon.
However it doesn’t change the date that the setter returned, so the answer is the same in both cases.
LikeLike