15
$\begingroup$

A 24-hour digital clock occasionally shows times that are palindromes such as 0:34:30, 21:33:12, and 1:20:21, if we ignore the colons.

What is the smallest interval between two such times?

Clarification: If the hour and/or minute and/or second have leading zeroes, only the leading zero for the hour is dropped. For example, one second after midnight would be displayed as 0:00:01.


Attribution: momath.org

$\endgroup$
2
  • 1
    $\begingroup$ Doesn't it display "00:34:30" ? $\endgroup$ Commented Sep 25 at 19:37
  • $\begingroup$ @CarlWitthoft For the purposes of this question, 34 minutes 30 seconds after midnight will be displayed as 0:34:30. How real clocks display it may be different. $\endgroup$ Commented Sep 25 at 19:40

4 Answers 4

21
$\begingroup$

The smallest possible interval is

just over 1 second.

The other answers correctly note that the nearest palindromic times are

9:59:59 and 10:00:01

But they incorrectly conclude that

2 seconds must elapse between them. This is incorrect. If we look at the clock in the last possible moment that it reads 9:59:59, we just have to wait 1 full second while the clock reads 10:00:00 before it reads 10:00:01. It is possible to see two palindromic times on the clock while looking at it for just over 1 second (although you couldn't actually measure this sub-second interval with the clock you're looking at).

$\endgroup$
6
  • 2
    $\begingroup$ +1 for a brilliant solution, though it's correctness is debatable. rot13(Gur dhrfgvba nfxf gur "vagreiny orgjrra gjb fhpu gvzrf." Lbh vagrecerggrq guvf nf, "ubj zhpu gvzr cnffrq sebz NN:OO:PP gb QQ:RR:SS?" Ubjrire, n zber qverpg vagrecergngvba jbhyq or "jung vf gur qvssrerapr orgjrra NN:OO:PP naq QQ:RR:SS." Gur ynggre vf vaqrcraqrag bs npghny gvzr naq guhf vf rknpgyl gjb frpbaqf). Personally, I think this solution is more fun. Were I to present this puzzle to others, I'd probably rot13(gjrnx gur jbeqvat gb znxr gur pbeerpgarff bs guvf nafjre zber qrsvavgvir). $\endgroup$
    – Brian
    Commented Sep 23 at 19:31
  • $\begingroup$ @Brian I agree the wording could be slightly more explicit. But I would find it odd that one could look at the clock for less time than "the smallest interval between two palindromic times", and still see two different palindromic times. $\endgroup$ Commented Sep 23 at 21:03
  • $\begingroup$ Rot13(Vs lbh qb abg pbafvqre NN:OO:PP.100 naq NN.OO:PP.200 gb or qvfgvapg gvzrf, gura lbhe nafjre srryf n ovg zrffl. Vs lbh qb pbafvqre gubfr gb or qvfgvapg gvzrf, gura nethnoyl bar pna qb fvtavsvpnagyl orggre guna lbhe nafjre (r.t., zl rknzcyr vf 100zf).) $\endgroup$
    – Brian
    Commented Sep 23 at 21:26
  • $\begingroup$ @Brian Yes, there are an infinite amount of distinct times occurring for each clock reading. Why wouldn't you consider now and 0.1s from now to be different times even if they occur during the same second? Doing so doesn't help you find any closer palindromes, though - the clock can only read seconds. There are no palindromes separated by 0.1s, the fractional seconds aren't part of the display (but that doesn't mean we can only read the clock at whole-second times). $\endgroup$ Commented Sep 24 at 14:12
  • $\begingroup$ @Brian wrote "Were I to present this puzzle to others, I'd probably rot13(gjrnx gur jbeqvat gb znxr gur pbeerpgarff bs guvf nafjre zber qrsvavgvir)" Pshaw! This played out exactly how it should have. (1) People understood the question as intended and found the intended answer, then (2) Nuclear Hoagie thought outside of the box and found an even better answer, then (3) you thought even further outside the box (in your subsequent observation Rot13(Vs lbh qb abg pbafvqre NN:OO:PP.100 naq NN.OO:PP.200 gb or qvfgvapg gvzrf...)) and found one even better (well, maybe) than that. $\endgroup$
    – Don Hatch
    Commented Sep 24 at 19:46
38
$\begingroup$

The smallest interval I can find is

2 seconds long:
9:59:59 - 10:00:01

My reasoning:

Whenever we change the seconds we also have to change the hours. That would result in a big interval.
So I thought it must have to do with some kind of overflow. I first thought about the overflow around midnight. 0:00:00 looked promising but the closest palindromic time before midnight would be 23:55:32.
Next thing I thought about was an overflow from ?:??:59 to ?:??:00. The only possible time ending in 59 is 9:59:59. Adding 1 second gives 10:00:00 which is no palindrome. Adding one more second gives the palindrome 10:00:01. Which is the smallest possible interval.

$\endgroup$
0
11
$\begingroup$

It's:

$2$ secs.

Why?

If a time can be written as $a:bc:ba$ ($c<9$) and $c$ increases by $1$, it'll still be a palindrome.

Can the interval be shorter than a minute?

For $a:bc:ba + 0:xy$, if the addition of $xy$ seconds changes the hour to $A=a+1$, then we have $a:59:5a$, which turns into $A:00:0A$, taking $11$ seconds. If it takes even fewer seconds, the last digit of the second will change, also altering the very first digit of the time. We can do so by switching to a different number of digits, like $9:59:59$ to $10:00:01$ ($2$ seconds).

$1$ second would also alter the first and last digits, requiring _$:59:59$, but then only $9$ could be the hour without a leading zero, and $10:00:00$ wouldn't be palindromic.

Another way:

If it's $a:bc:ba$, it corresponds to $3601a+610b+60c$ seconds, with $b<6$, meaning we can add or subtract at most $5$ to/from $b$ when we take another $b$. If we're working out the difference between two such numbers, even if you try to compensate for a change in $a$ by $1$ ($+-3601$) by pushing the other digits to the limit - changing $b$ by $5$ ($+-3050$) and $c$ by $9$ ($+-540$), the difference will be $3601-3590=11$ seconds. Only changing $b$ and $c$ will result in $610-540=70$ seconds, and only changing $c$ by $1$ in $60$.

If it's $xy:zz:yx$, it corresponds to $36001x+3610y+660z$ seconds, with $x<3$, $y,z<6$ meaning we can add or subtract at most $5$ to/from $y$ or $z$ when we take another, and $2$ to/from $x$. If we're working out the difference between two such numbers, the best we can get is $3610-3300=310$ seconds.

What if we switch between $3601a+610b+60c$ and $36001x+3610y+660z$?

Assuming the difference is less than $11$, if we subtract $10b+a$ from the former and $10y+x$ from the latter, the difference between them can be $5\times10+9+10=69$ at most. However, both would then be divisible by $60$, so their division by that ($60a+10b+c$ vs. $600x+60y+11z$) will give at most a difference of $1$.

If equal:

$c=z$ ($mod$ $10$)
$10b+c=11z$ ($mod$ $60$) => $10b+c=11c$ => $b=c=z$
$60a+11b = 600x+60y+11b$ => $a=10x+y$ => $x=0$ (contradiction).

If unequal:

$c-z=+-1$ ($mod$ $10$)
$10b+c-11z=+-1$ ($mod$ $60$)
$x=1$, $a=9$, $b=5$, $c=9$, $y=z=0$ ($9:59:59$ to $10:00:01$)

$\endgroup$
12
  • $\begingroup$ When I posted my answer, the one at the top that's a one-liner had a score of 5. It received 2 more upvotes since then even though mine has none. Despite me actually explaining my process of solving it and reaching the correct result, why is my solution considered inferior? $\endgroup$
    – Nautilus
    Commented Sep 23 at 14:42
  • 1
    $\begingroup$ The reason is that your post was submitted significantly after inkili's and fails to expand upon the problem presented since it didn't ask for an explanation. Also tbh, people will upvote a more concise answer 9 times out of 10. (Just my opinion) $\endgroup$ Commented Sep 23 at 15:12
  • 3
    $\begingroup$ I just posted a one-liner because i didn't have the time for an elaborated answer. I just added some reasoning to my answer. I admit that your answer was (and possibly still is) superior to mine. You have my upvote $\endgroup$
    – inkili
    Commented Sep 23 at 16:50
  • 1
    $\begingroup$ "A one-liner is appropriate in this case" Expect if I was the one who posted it, I would have been downvoted to death. I can't believe I'm being called entitled for wanting a right given to everyone else. And if I didn't point out the hypocrisy of it all, my answer would have had a negative score. $\endgroup$
    – Nautilus
    Commented Sep 23 at 22:02
  • 1
    $\begingroup$ This question is so invariably simple and the answer is so obviously correct once you see it that a one-liner is perfectly acceptable as an answer in this case. In more complex questions where an answer isn't obvious, explanations are typically required. Not all questions are created equally, and as such the ways you can answer them will differ between them. The answer inklii provided wasn't 'sub-optimal' as you claim, and that's why it wasn't downvoted. $\endgroup$ Commented Sep 24 at 3:32
1
$\begingroup$

Pedantic answer:

Zero

because you didn't say

two different times

$\endgroup$
1
  • $\begingroup$ Further, Fvapr guvf pybpx bayl punatrf rirel frpbaq, gur gjb qvssrerag gvzrf KK:KK:KK.0001 naq KK:KK:KK.000100001 ner qvssrerag ohg gur qvfcynl vf cnyvaqebzvp $\endgroup$ Commented Sep 25 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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