in reply to Re: How preparing the weekly shift roster led to a fascinating discovery...
in thread How preparing the weekly shift roster led to a fascinating discovery...

mmm, yes.. that is a nice bit of deductive reasoning, but...

What if you hadn't of know beforehand that the 31st was the _only_ one that missed out?

I mean, once glide let the cat out of the bag and the result was obvious, then it becomes much easier to apply a bit of backwards logic to explain the phenomena.

Of course, I didn't know what the result would look like until I'd written some code to test it. And once the code was written, it became a simple matter to modify it to test for as many years as I wished.

By the way..

Because of leap years the last day of January ..
Don't you mean February?

Cheers,
Darren :)

  • Comment on Re^2: How preparing the weekly shift roster led to a fascinating discovery...

Replies are listed 'Best First'.
Re^3: How preparing the weekly shift roster led to a fascinating discovery...
by CountZero (Bishop) on Dec 15, 2007 at 09:10 UTC
    What if you hadn't of know beforehand that the 31st was the _only_ one that missed out?
    Then I would never have given the matter a single thought.

    But ... consider this: someone finds a curious phenomenon and reports it to his fellow scientists. These start running a number of experiments which prove or disprove this phenomenon in a variety of circumstances. Then someone steps in and formulates a theory and finally someone proves (based upon the existing body of scientific knowledge) that the theory is correct.

    I think we just have witnessed the scientific method at work in our Monastery!

    Don't you mean February?
    No no, I really mean January. February never has 31 days, so by starting my "year" in March (as did the old Romans -- why do you think September really means the seventh month?) my reasoning does not have to take into account leap years but for the month of January (which as lidden said can only be a "+5" of "+6" day but never a "+3".) thus making my proof much easier and clearer.

    Shall we --in line with good scientific practice and hubris-- call this theory the "McDarren-CountZero-lidden Theory of the Missing Weekday of the 31st"?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re^3: How preparing the weekly shift roster led to a fascinating discovery...
by polettix (Vicar) on Dec 15, 2007 at 15:22 UTC
    If you restrict to months different from february, all of them have at least 30 days and you can easily see that "having" days 1..7 always gives you all the days up to 30 (just write numbers 1..30 putting a newline every 7 of them). Restricting to months from march to december (which always present the same pattern, whatever year you consider after the transition from Julian to Gregorian calendars) you can quickly check that all days 1..7 are there for all days of week (it suffices to see it for only one of them, then that's only a matter of modulo-7 maths).

    So the only one that remains tricky is 31, because not all months "support" it.

    Flavio
    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?