Originally Posted By: K447
Originally Posted By: tanstaafl.
... Here's the problem:

Visualize an analog 12-hour clock with hour hand, minute hand, second hand. We know that at 12:00:00 all three hands are in perfect mathematically defined alignment. At what other times if any (such as five minutes and a few seconds after one, or maybe 21 or 22 minutes and a few seconds after four) are all three hands in perfect alignment. Prove (or disprove) it...
Prove what exactly?

Off the top of my head, the clock hands would align eleven times as the hour hand travels around the clock face. The minute hand must run around 60 minutes plus five minutes (1/12th of the next hour) to catch up with the hour hand.

That's actually quite incorrect. It all comes down to a question of
precision -- how precise do you want to be?

The problem with your logic is that, as the minute hand moves the 1/12th
of the next hour to catch up to the hour hand, the the hour hand is
still moving
. So in truth, the minute hand must move 1/12th of an
hour plus the delta that the hour hand has moved in those 5 + delta
minutes. Similarly for the second hand.

The simple way to look at it is as a function of percentage. The hands
will align when they're the same percentage of the way around the clock
face. You can describe that as the following set of functions (in terms
of seconds -- we could arbitrarily pick any other unit, like tenths of a
second, if we wanted to, but seconds is quite sufficient):
Code:
h(x) = x / 43200
m(x) = (x mod 3600) / 3600
s(x) = (x mod 60) / 60

for x in [0,43200)

Alignment occurs for the set
Code:
{ x | h(x) = m(x) = s(x), 0 <= x < 43200 }

At this point, it's easier to break out a bit of C -- I lack the knowledge
to continue representing this in pure mathematical notation. smile
Code:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>

#define PRECISION 0.01

double h(int x) {
    return ((double)x) / 43200.0;
}

double m(int x) {
    return fmod((double)x, 3600.0) / 3600.0;
}

double s(int x) {
    return fmod((double)x, 60.0) / 60.0;
}

int main(void) {
    for (int x = 0; x < 43200; x++) {
        double h_pct = h(x);
        double m_pct = m(x);
        double s_pct = s(x);

        if (fabs(h_pct - m_pct) < PRECISION &&
            fabs(h_pct - s_pct) < PRECISION &&
            fabs(m_pct - s_pct) < PRECISION) {
            printf("%5d (%02d:%02d:%02d)\t%f\t%f\t%f\n", x, x/3600, (x/720)%60, x%60, h_pct, m_pct, s_pct);
        }
    }
}

If you only care about precision within, say, 1%, then that gives you the following:
Code:
    0 (00:00:00)        0.000000        0.000000        0.000000
 3905 (01:05:05)        0.090394        0.084722        0.083333
 3966 (01:05:06)        0.091806        0.101667        0.100000
 7871 (02:10:11)        0.182199        0.186389        0.183333
11776 (03:16:16)        0.272593        0.271111        0.266667
15742 (04:21:22)        0.364398        0.372778        0.366667
19647 (05:27:27)        0.454792        0.457500        0.450000
23553 (06:32:33)        0.545208        0.542500        0.550000
27458 (07:38:38)        0.635602        0.627222        0.633333
31424 (08:43:44)        0.727407        0.728889        0.733333
35329 (09:49:49)        0.817801        0.813611        0.816667
39234 (10:54:54)        0.908194        0.898333        0.900000
39295 (10:54:55)        0.909606        0.915278        0.916667

But none of those percentage numbers are actually equal, and
since Doug did say "perfect mathematical alignment", I'd say this level
of precision isn't sufficient. As a consequence the only acceptable
answer is...

Never (as Doug hinted, with his underlined "if any").

Thank you, irrational numbers. edit: Thank you Peter, for reminding me that these are not irrational, as they're just a decimal representation of fractions...


Edited by canuckInOR (13/05/2014 14:41)