The Second Puzzle

Dr. Dobb's Journal January 1998


You know the story of the blind men and the elephant? And how each perceived the elephant as a different beast? Or maybe you know the modern version, the programming team and the Ada compiler? The clock puzzle in my November 1997 "Flames" evoked a similar variety of responses from readers.

The clock puzzle, as you may recall, asked how to set a digital clock. My cousin Corbett wanted to set his clock (which doesn't display seconds) 30 seconds fast, so that it would read 11:00 from 10:59:30 to 11:00:30. His reasoning was that he could take "11:00" to mean exactly 11:00 and be no more than 30 seconds off. I supported setting the clock to the exact time, realizing that a reading of "11:00" means between 11:00 and 11:01.

One reader saw it as just like A/D conversion, another viewed it as essentially a statistics problem, while a third said that it was clearly analogous to the numbering of freeway exits and mileposts. Another wrote that similar questions of rounding strategy come up all the time in his job, developing cash register and point-of-sale software, while yet another saw in it the problem of not missing anything when recording a movie on a VCR, and still another saw an analogy with the way water drains from bathtubs in his native Brazil. Harald Ruda was inspired to wonder how Java handles pixel boundaries: "Does a whole number represent the middle of a pixel or the edge of a pixel? With Quickdraw, it is explicitly stated." Is Java "Write Once, Draw Anywhere?"

Andy Searls was reminded of his father's digital clock, which was linked to a radio signal from Ft. Collins, Colorado, that displayed the time to 1/100th of a second and drove his mother crazy (until papa Searls put electrical tape over the wildly rolling final digits).

David Rogers reminded me, "When digital clocks and watches first came out, you could tell who had them by asking the time. You'd get an answer like 'four thirty-eight.' Now that they've been around for a while, we've all gone back to saying 'about a quarter till.'" Rolf Boelckow was reminded of a clock aphorism in the Illuminatus trilogy by Robert Shea and Robert Anton Wilson. As he recalls, it went "A man with a clock knows the time; a man with two clocks is never quite sure." But since he read the trilogy in German, it may have lost something in retranslation. Or gained. Or both.

By the way, you must remember the story of the first translating computer. All the bigwigs were gathered around for the demonstration, which involved translating a phrase from English to Russian and back to English. One of the bigwigs offered, "The spirit is willing, but the flesh is weak," and it was duly entered. Tense minutes later, the teletype chattered out, "The meat is rotten, but the vodka is excellent." There's a new Douglas Hofstadter book out and it's all about translation. Remember that picture on the cover of Hofstadter's first book, Goedel, Escher, Bach, of a carved block that cast shadows that looked like the letters G, E, and B in three orthogonal directions? Kurt Jung wrote to propose the design of "a set of fractal stencils which, when placed in the shifting rays of the sun, display the time digitally." Sort of like Hofstadter's block, but trickier.

But back to the clock puzzle. There were a few creative alternatives, like the suggestion that Corbett buy 60 digital clocks and set each one a second later than the previous. Some readers were very literal, saying, "Wait until midnight and plug it in." And many reminded me that a stopped clock is right twice a day.

Readers were virtually unanimous, however, in supporting my sensible view of time against my cousin Corbett's off-kilter one. Setting a clock 30 seconds fast doesn't increase its precision, and does violate expectations.

Okay, but what if you get a second look?

Here's my second clock problem: Suppose you know that a clock with no seconds display has been set absolutely correctly, and suppose you look at it and then count off n (strictly between 0 and 60) seconds and look at it again. You now have two (possibly identical) readings (plus some additional uncertainty due to your inability to count seconds perfectly, but let's ignore that). Suppose both readings say 11:00. What is your best guess for the exact time, as a function of n?

--Michael Swaine


Copyright © 1998, Dr. Dobb's Journal