Slashdot Mirror


Calendar: Code, Free Speech, Or Mathematics?

jdavidb writes: "Dr. John Conway (author of the famous "Game of Life") has a wonderful algorithm for finding the day of the week for any year in history that you can do in your head. It's so easy and elegant, in fact, that someone has decided to write a poem about it. Shades of DeCSS haikus! What a marvelous example of how mathematics is a form of (free and protected) speech. As if to further illustrate that computer code is just another form of speech, there is an implementation of this algorithm (in Perl of course)!"

9 of 147 comments (clear)

  1. Correction by waldoj · · Score: 5

    ...has a wonderful algorithm for finding the day of the week for any year in history that you can do in your head.

    That should read "...that one can do in one's head." I could no sooner do that in my head than I could give birth.

    -Waldo

  2. Re:Not exactly breaking news by PD · · Score: 4

    Whining about old news has been around since Ecclesiastes, and whining in general is even older...

  3. Limitations. . . by SMN · · Score: 5
    There are a few very minor limitations on this algorithm that are not mentioned on the page. In fact, these limitations are ignored, and lead several mistakes on that page.

    The algorithm uses the Gregorian Calendar. Most countries did not adopt the Gregorian Calendar until October 15, 1582, and therefore it is inaccurate for any date before that. The major exception is Great Britian which, due to the feud between the Catholic and Anglican Churches, did not adopt the Gregorian Calendar until September 14, 1752.

    This means that the "Doomsday"'s before 1583 are all wrong everywhere, and those before 1753 are wrong in Great Britian.

    In addition, the Gregorian Calendar only considers Leap Year exceptions on a 400-year cycle, so in the year 4092 it will have drifted off by one full day. Therefore, this algorithm should not be used for any date past December 31, 4091.

    In my opinion, the Doomsday algorithm isn't even the best algorithm for this job. I prefer Zeller's Algorithm, for a which a good description can be found at http://www.columbia.edu/ ~cs1005/HW03.html .

    Zeller's Algorithm was first proposed by Chr. Zeller, in 1883 -- long before computers. It also allows one to find the day of week for a date using only integer division, and thus can be done easily by hand. It's much simpler than the Doomsday Algorithm appears to be.

    I can't post it here correctly due to formatting limitations, but it can be found at the above lined page. It's slightly harder to memorize, but simpler to use (and program -- only took me a few minutes).

    --
    -- Imagine how much more advanced our technology would be if we had eight fingers per hand.
    1. Re:Limitations. . . by sv0f · · Score: 5

      I can't post it here correctly due to formatting limitations, but it can be found at the above lined page.

      I have discovered a marvelous algorithm for finding the day of the week for any date in history but the margin is too small to contain it...

    2. Re:Limitations. . . by bark76 · · Score: 5
      In addition, the Gregorian Calendar only considers Leap Year exceptions on a 400-year cycle, so in the year 4092 it will have drifted off by one full day.

      WOO HOO! That means that by 744,744AD our winters will be in the summer and vice versa, it'll be like we're living in Australia!

  4. Hey... by Moonshadow · · Score: 5

    This code circumvents the obfuscation put in place by the Romans way back when by allowing the masses to find the weekday equivalents of any day in history! This must be stopped! Why, if this information leaks to the masses, we'll have rebellion and revolution, and it's only a matter of time before calendar makers' proprietary secrets are laid bare, depriving them of their hard-earned money! Rest assured that we will be filing a lawsuit against the author of this code, and any who distribute it. Such criminal "crowbars" cannot be allowed to proliferate to the masses!

    Have a nice day,

    Calendar Makers Association of America.

  5. why the free speach worries? by The+Good+Reverend · · Score: 5

    What a marvelous example of how mathematics is a form of (free and protected) speech.

    Has someone tried to claim a patent on this? It's a neat little math trick, but the poster seems a little paranoid. Should we not tell the world that the digits in numbers divisible by three add up to three, in case someone tries to patent that too? It doesn't seem like this is a big problem. or even a free speech issue.

    The Good Reverend
    I'm different, just like everybody else.

  6. Easy to remember? by Purple_Walrus · · Score: 4

    "Easy to remember" means remembering your own name. "Easy to remember" means basic rules of addition. This is more like "painstakingly difficult to remember under any circumstances."
    I'll stick to using my calendar, thank you very much!
    ---

    --
    ------
    Sig
  7. An open source application uses this algorithm by ayers · · Score: 4
    CalendarBuilder.asp, a combination VBScript/JavaScript Server Page implements this algorithm.

    Source code available at webware.skybuilders.com

    The calendar built by this page is part of skyBuilders timeLines

    dtd

    Any sufficiently advanced technology is indistinguishable from magic.
    - Arthur C. Clarke