Charlie has two clocks that hold reasonably good time. That is, each clock ticks at a constant rate, but its ticks are not necessarily exactly 1 second apart. The period between ticks is constant for each clock, with each period in the range $1 \pm 0.1$ seconds.

Charlie sleeps for 8 hours each night. If Charlie hears the clocks ticking out of phase when he goes to sleep one evening and in phase when he wakes up the next morning, what's the largest possible difference between the periods of the two clocks?

Assume that at the moment Charlie bought the clocks, they happened to tick at exactly the same time.


  1. The period of the clock is the time between one tick and the next. The period of each clock must be between 0.9 seconds and 1.1 seconds. It could be 0.92 or 1.1 or even 1 second, so long as it is a constant between 0.9 and 1.1 seconds.

  2. Out of phase means that the clocks are ticking exactly 0.5 seconds apart. They sound like tick-ka-tick over a space of about 1 second, with 'tick' coming from one clock and 'ka' coming from the other. Update: this may be taken to imply that Charlie falls asleep upon hearing a 'ka' exactly half a second after the other clock 'tick'ed.

  3. In phase means that the clocks tick at exactly the same time. They sound like just one (loud) clock for that tick.

  4. If one clock ticks at $1 + t_1$ seconds and the other ticks at $1 + t_2$ seconds, find $|t_1 - t_2|$.

Bonus: generalise the answer for clocks with periods in the range $1 \pm t$ seconds.

This is not a lateral-thinking puzzle. Reasoning for the answer must be provided. The correct answer with the simplest valid reasoning wins. No need for spoiler tags.

  • $\begingroup$ "its ticks are not exactly 1 second apart" VS "It could be 0.92 or 1.1 or even 1 second"? which one is right? $\endgroup$ – Oray Apr 6 '16 at 12:55
  • $\begingroup$ Thanks for the catch. I've made the correction. It's "not necessarily 1 second apart". $\endgroup$ – Lawrence Apr 6 '16 at 14:05
  • $\begingroup$ Not sure I agree they hold reasonably good time if after only 5 hours, they may already be half an hour off... $\endgroup$ – Oliphaunt - reinstate Monica Apr 6 '16 at 15:26
  • 3
    $\begingroup$ "Out of phase means that the clocks are ticking exactly 0.5 seconds apart. They sound like tick-ka-tick over a space of 1 second" - - isn't this assuming one of the clocks has a period of exactly 1 second? $\endgroup$ – ffao Apr 6 '16 at 16:21
  • 1
    $\begingroup$ It's still unclear what the out-of-phase condition is. Do you mean that exactly 1/2 second elapses from the first to the second tick, or from the second to the third tick? Also, which of the three ticks is the 8 hours measured from? And does the "in-phase tick" occur exactly 8 hours later, or just at some point after the 8 hours? $\endgroup$ – 2012rcampion Apr 7 '16 at 3:49

NOTE: I have no idea if this answer still applies after the edit.

It is known that $(a \pm b) + (c \pm d) = (a+c) \pm (b+d)$

Therefore $2(a \pm b) = 2a \pm 2b$

For general rule $n(a \pm b) = na \pm nb$

Total number of seconds in $8$ hours $= 8 \times 60 \times 60 = 28800$ seconds

We have $a=1$ and $b=0.1$ and $n=28800$

Therefore $$n(a \pm b) = na \pm nb$$ $$\Rightarrow 28800(1 \pm 0.1) = 28800 \pm 2880$$

So, the maximum value is $= 28800+2880$
And , the minimum value is $=28800-2880$

So, the largest possible difference between the periods of the two clocks is

Maximum value - Minimum value

$= (28800+2880) - (28800-2880)$

$=5760 $ seconds

  • $\begingroup$ Does this take into account the initial offset? I'm not good at math. $\endgroup$ – Raystafarian Apr 6 '16 at 11:33
  • $\begingroup$ @Raystafarian No, I don't think we need to consider it (according to the question) $\endgroup$ – manshu Apr 6 '16 at 11:34
  • $\begingroup$ How did you do away with the subtractions in the first line? $\endgroup$ – Lawrence Apr 6 '16 at 11:34
  • $\begingroup$ @Raystafarian If by initial offset, you mean the difference when the clocks started, that wasn't intended as a complicating factor. You can choose any convenient initial difference. $\endgroup$ – Lawrence Apr 6 '16 at 11:36
  • $\begingroup$ @Lawrence It is known I said. We consider the the maximum errors when we add two errors $\endgroup$ – manshu Apr 6 '16 at 11:37

Here's how I interpret the question. I don't think it's correct but it will hopefully lead to another clarification. First, these clocks can go out of sync very quickly. Clock A can have a period of .9 seconds and clock B 1.1. Imagine they both tick at time 0. A ticks at .9, B at 1.1. Next tick is A at 1.8 seconds then B at 2.2. They are already .4 out of phase. Therefore the definition of in phase when he wakes and out of phase when he goes to sleep is a bit tricky.

I take it to mean that one clock ticks half a second before he falls asleep. At the instant he falls asleep the second clock ticks. He sleeps for exactly eight hours and both clocks tick together the instant he wakes.

The problem is then simple. Assume the clock with the longer period ticks first and the clock with the shorter period half a second later. What is the largest value of the first and smallest value of the second that will allow them both to tick the instant he awakens? The smallest value of the second period is .9 which conveniently exactly divides the sleep time of 28800 seconds. 1.1 divides 28800.5 26182 times with a remainder. Therefore the longer period can be at most 28800.5 divided by 26182 which is about 1.09999236. The difference between the periods is about .19999236.

I ought to do this the other way around as well and turn it into a general formula but as I said, I am rather doubtful that this is the intended interpretation.

I await comment.

  • $\begingroup$ This was the way I was interpreted it as well. One small mistake in what you wrote: 1.09999236 (4 9's) $\endgroup$ – charfellow Apr 6 '16 at 21:09
  • $\begingroup$ Note to self: this was posted about 1h before Hemant Rupani's answer, with a similar approach. $\endgroup$ – Lawrence Apr 7 '16 at 1:07
  • $\begingroup$ Your interpretation is valid, though the ticking at the point of sleep (call that time $T$) is more general in the question - if one clock ticked at $T$, the other clock could tick at $T \pm 0.5$; also, I would accept that if the clocks didn't tick exactly at $T$, then the ticks straddling $T$ are exactly 0.5s apart (e.g. one at $T - 0.25$ and the other at $T + 0.25$). $\endgroup$ – Lawrence Apr 7 '16 at 1:29
  • $\begingroup$ Where is the 0.5s 'phase difference' between the clocks at the sleep and wake times accounted for in your calculations? $\endgroup$ – Lawrence Apr 7 '16 at 1:32
  • 1
    $\begingroup$ @Lawrence The calculation is actually written wrongly. I divided 28800.5 by 1.1 to obtain that result. Transcription error. I will correct it. $\endgroup$ – Hugh Meyers Apr 7 '16 at 4:50

To happens tick-ka-tick situations, time between ticks of slower clock should be slower than at most 0.5 seconds to time between ticks of faster clock, otherwise faster clock sounds tick with or within the slower clock. Mathematically, $(1+t) - (1-t)< 0.5$ i.e. $ t<0.25$

Let $ S $: be slower clock with time between ticks $1+t $ & $ F $: be faster clock with time between ticks $1-t $

tick-ka-tick must start and end with $ S $ and ka (sound) after 0.5 seconds from $ F $

Now, at the instance of Charlie go to sleep He hears out of phase (tick sound from $ S$, and ka sound after 0.5 seconds from $ F$), And after 8×60×60=28800 seconds He hears one loud tick at the instance.

Therefore, there must be exact Integer count of ticks-lengths from $ S $ during 28800 seconds, and exact Integer count of tick-lengths from $ F $ during 28800-0.5=28799.5 seconds.

Possible tick counts for $ S $ is in between ($\lceil 28800÷(1+t) \rceil , \lfloor 28800÷(1-t) \rfloor$)

& for $ F $ is between ($\lceil 28799.5÷(1+t) \rceil , \lfloor 28799.5÷(1-t) \rfloor$)

The largest possible difference between the periods of the two clocks is $ Max\Big(\frac {28799.5}{\lceil 28799.5÷(1+t) \rceil} - \frac {28800}{\lfloor 28800÷(1-t) \rfloor} , \frac {28800}{\lceil 28800÷(1+t) \rceil} - \frac {28799.5}{\lfloor 28799.5÷(1-t) \rfloor} \Big)$

Where $\lfloor x \rfloor$is the largest integer less than or equal to x and $\lceil x \rceil $ is the smallest integer greater than or equal to x.

Generalise aswer is stated above and for $t=0.1 $ answer is $\frac {28800}{\lceil 28800÷1.1 \rceil} - \frac {28799.5}{\lfloor 28799.5÷0.9 \rfloor}=\frac {28800}{26182} - \frac {28799.5}{31999} \approx 0.19997986$

  • $\begingroup$ Apologies. I had not intended to force one clock to have a period of exactly 1 second. I've amended the clarification. $\endgroup$ – Lawrence Apr 7 '16 at 0:04
  • $\begingroup$ Perhaps this was just a typo, but I don't follow the 3rd paragraph (after the sentence "He hears one loud tick at the instance"). To get the tick count for the 0.9s clock, shouldn't you use time/period, rather than time x period, I.e. 28800/0.9 +/- 0.5? You seem to have corrected this in the 5th paragraph. $\endgroup$ – Lawrence Apr 7 '16 at 1:16
  • $\begingroup$ Note to self: this is the first answer to consider the 0.5s phase difference in calculations. $\endgroup$ – Lawrence Apr 7 '16 at 1:34
  • $\begingroup$ @Lawrence I edited as per requirements. $\endgroup$ – Hemant Rupani Apr 7 '16 at 8:56
  • 1
    $\begingroup$ Let's look at the units of the expression you use for the lower-bound of tick counts for S. The rounding doesn't change the units, so can be ignored. 28800 is in seconds, and (1-t) is also in seconds, so the units would be $s^2$, whereas we want a dimensionless quantity. Let's use some convenient numbers to illustrate. Suppose we had 10 seconds and 2 seconds per tick. We actually have 5 ticks (actually, 6 if we count ticks at both t=0 and t=10). But multiplying them gives 10x2=20, which is the wrong number. Also, there's no requirement that the clocks tick with periods 1-t and 1+t seconds. $\endgroup$ – Lawrence Apr 7 '16 at 11:22

I am making the interpretation that one clock ticks precisely $0.5$ seconds before Charlie falls asleep, and the other clock ticks at the precise moment he falls asleep, then $8$ hours later at the precise moment he wakes up both clocks tick.

So let $C_1$ be the clock that ticks at time $-0.5$ seconds and later at 28800.0 seconds, and $C_2$ clicks at time $0.0$ seconds and later at $28800.0$ seconds.

$C_1$ has a period $0.9 \leq P_1 \leq 1.1$, and C2 has a period $0.9 < P_2 \leq 1.1$

$C_1$ will tick $N_1$ times such that $N_1 = 28800.5/P_1$ and $C_2$ will tick $N_2$ times such that $N_2 = 28800.0/P_2$. Note the difference in total time.

By inspection, $P_1$ has a minimum of 0.900015625 seconds (after completing $N_1 = 32000$ ticks), and a maximum or $1.099969446$ seconds (after completing $26183$ ticks).

Similarly, $P_2$ has a minimum of $0.9$ seconds (after completing $N_2 = 32000$ ticks), and a maximum or $1.099992361$ seconds (after completing $26182$ ticks).

The largest difference in period will be either $P_{1_{Max}} -P_{2_{Min}}$, or $P_{2_{Max}}-P_{1_{Min}}$. By inspection the latter difference: $0.199976736$ seconds, is slightly larger then the former: $0.199969446$ seconds.

So the max difference is $0.199976736$ seconds (slightly smaller than Hugh's answer). After $24$ hours, $C_1$ wil be running about $2$ hours $23$ minutes and $58.7$ seconds fast, while $C_2$ will be running $2$ hours $23$ minutes and $53.4$ seconds slow. Charlie needs a new alarm clock!

  • $\begingroup$ Good approach: counting the number of ticks as an integer. $\endgroup$ – Lawrence Apr 7 '16 at 11:33
  • $\begingroup$ I rolled back to your last edit because the $\leq$ symbol was showing up with strange artefacts. The artefacts were extra $\leq$ symbols on the next line, shifted horizontally. They didn't appear in the preview while editing. $\endgroup$ – Lawrence Apr 7 '16 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.