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)!"

147 comments

  1. Shucks! by Anonymous Coward · · Score: 1

    If the Bible was a little more specific in the number of days between "begats", we could find out exactly on what day the heavens and the earth were created.

    I'm sure the canonical theory is that it was created on a Sunday, with God resting on Saturday, but of course that only comes with 14% probability of being correct. ;-)

    Slash Doter

    1. Re:Shucks! by Water+Paradox · · Score: 1

      It was Tuesday, the 42nd of May. Didn't you read the hitchhikers guide?

      --
      information is immaterial
  2. damn slashbots by Anonymous Coward · · Score: 1
    math isn't open source. The concept of open source does simply not apply to math, as noted here and elsewhere many times before. But I can see that it was necessary to include some free speech buzzwords just to get this story accepted.

    Has someone else gotten the impression that stories are accepted or rejected using some sort of script these days? In preudo code:

    • if Submission.partof("open source"||"free speech"||"MS sucks")) accept(); else reject();
  3. A basic implementation in 1 line of code by Anonymous Coward · · Score: 1

    I've been using this for almost 30 years

    00100 rem "getday - 03/16/72 (bdc)
    00110 enter d0$,z1$
    00120 rem d0$=day of the week, Z1$=return value
    00130 let D0=MOD(NUM(D0$(7,2))+20,100)+80+SGN(SGN(NUM(D0$(1, 2))-2.5)-1), Z1$
    00130:="WednesdayThursday Friday Saturday Sunday Monday Tuesday ", Z1
    00130:$=Z1$(1+9*MOD(D0+INT(D0/4)+INT(MOD(NUM(D0$ (1 ,2))+9,12)*2.6+.4)+NUM(D0$
    00130:(4,2)),7),9)
    00140 exit

  4. Re:It's all a hoax by Russ+Steffen · · Score: 2
    What a funny game. The only way to win is not to play. There's another game like that - it's called Global Thermonuclear War...

    Sorry... Just saw "Wargames" again recently.

  5. Re:Correction by Vic+Metcalfe · · Score: 1

    There is no magic to multiplying 5 digit numbers in one's head. Systems like The Trachtenberg System of Speed Mathematics (called Basic mathematics in the edition of the book that I have) can teach this trick to anyone who is good with figures.

  6. Interesting side effect by CaseyB · · Score: 1
    Viewing the algorithm page has a wierd side effect. It makes the text on slashdot green. Honest! Go there, read it for a minute, then come back here...

    Anyone else notice this?

    1. Re:Interesting side effect by Old+Wolf · · Score: 1

      This is interesting. When I first accessed the algorithms page, my monitor's blue gun was off (it has an intermittent fault).

      This meant that the algorithms, and Slashdot, both had the same bright yellow-green background. Ugh!

    2. Re:Interesting side effect by ahde · · Score: 1

      the links are always green

    3. Re:Interesting side effect by Remote · · Score: 1

      Anyone else notice this?

      I did. Both the grey and the green text looked just as green up front; I thought CT was trying to be cutesy. I read on and forgot about it, but when I read your post it caught my attention: grey looked grey again, which is a good thing...

      I think that what really happened was that because that page background is green, the white in this page tends to look rosy. making the grey look green in contrast.


    4. Re:Interesting side effect by FunkSoulBrother · · Score: 1

      I'm sorry man, its time to get a new freaking monitor. Honestly.

  7. Re:metric calendar by rnielsen · · Score: 1

    I think the problem with this is the pesky ratio of 365.25 days to a year. While everything else (hours, minutes, weeks, months) are fairly arbitrary, you would have to keep this ratio if you wanted the seasons to stay at the same time of the year. If you don't then you are fine but it does defeat the purpose of having a year. You might as well go for milliseconds since the epoch...

  8. Re:Here's the link through Google... by gmezero · · Score: 2

    Damn it! I can't even get first Google here!

  9. Re:Limitations. . . by slpalmer · · Score: 1

    Odd though, their "Day of week calculator" on that website won't accept a date before 1900 or past 1999.
    "Year 19yy" is listed above the input box, and it will accept only 00-99 as input for that field.

    ---

  10. Re:Limitations. . . by Zagadka · · Score: 2

    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.

    And if you want to see something weird, but nifty, type the following into your local shell prompt:

    cal 9 1752

  11. Re:Correction by jimfl · · Score: 1

    You can do it in John Conway's head.

    --
    --Jim
  12. 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

    1. Re:Correction by divec · · Score: 1
      That should read "...that one can do in one's head." I could no soonervdo that in my head than I could give birth.
      I take it you're a man, then? OTOH if it took you nine months and excruciating pain to calculate the day of the week, I guess your point would still be valid.
      --

      perl -e 'fork||print for split//,"hahahaha"'

    2. Re:Correction by Winged+Cat · · Score: 2

      I could no sooner do that in my head than I could give birth.

      I think he was speaking to most of the readers of this site. I can do it in my head easily enough.

    3. Re:Correction by b0r1s · · Score: 2

      Interestingly enough, this "new algorithm" was taught to me by Art Benjamin, who teaches some math classes (combinitorics, discrete, number theory, etc) at Harvey Mudd College ... who not only did this trick in his head for random (birthdays of students) days, but also did some very impressive multiplication (multiplying two 5 digit numbers in his head, no paper, no pencil, etc)... just some evidence that some people CAN do this in their head ...



      --
      Mooniacs for iOS and Android
    4. Re:Correction by b0r1s · · Score: 2

      I didnt say it was a trick ... but to do it quickly, and correctly, is NOT TRIVIAL... I consider myself rather intelligent, and I can not yet do it quickly, because there are simply too many digits to keep track of...

      --
      Mooniacs for iOS and Android
  13. Re:Problems w/linux hardware support by Cid+Highwind · · Score: 3

    Pure FUD.
    Linux has supported bongs with any number of chambers since kernel 2.4.1 The generic waterpipe driver has been re-written from the ground up to support bongs up to 1024 inches. The only trouble items are the so-called winpipes. These pipes don't have an actual bowl, they're just an empty tube and a driver that makes windows *act* like it's stoned. Due to poor real-world performance and their unsatisfactory smoking experience, they are unlikely to ever be supported.

    Hookah support for multiple users is now available through the tokin' ring network device. The new tokin' ring driver also supports 128-bit encryption of the smokestream, to prevent "sniffing" of the connection by local police.

    --
    0 1 - just my two bits
  14. 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...

  15. Re:Stardates by ethereal · · Score: 1

    Heck, if you could tell what the stock market was going to do that far in the future, why not just predict it about a year in advance and make a killing? Unless that stardate really is next year...

    (posted w/o a shred of sarcasm because it took me three reading to realize you meant Day-Of-Week.)

    Caution: contents may be quarrelsome and meticulous!

    --

    Your right to not believe: Americans United for Separation of Church and

  16. Alternative method... by Skeezix · · Score: 2

    I'd like to point out an alternative method that I have found. I started out with a method that I read in a memory improvement book and made some modifications for the sake of simplicity and speed. What I came up with is described in the Memory Howto I've written. The method requires the memorization of 12 one-digit numbers (one for each month) which will be extraordinarily easy if you learn the other tricks in the howto such as the peg. It takes a bit of practice, but it can be very fast and IMO is simpler. Link to entire essay is in my tagline below:
    ----

    1. Re:Alternative method... by Skeezix · · Score: 2

      :) It does take some practice. The real practice is in the converting from pictures to numbers. The easy part is visualizing the crazy pictures, for most people...since the mind is very visual.
      ----

    2. Re:Alternative method... by bjsvec · · Score: 1
      I started reading your method and was doing pretty well until this:

      I'll give an example. I would use phone numbers that I have actually
      memorized before, but I'm afraid you would slashdot them, so we'll keep it fictitious. Let's
      suppose I have a friend named Ralph. The thing that strikes me about Ralph is that he loves
      baseball. I'll use that fact as a starting point for my link. His phone number is 471-2398. First
      thing that comes to mind is "ragged gnome beef." So I picture Ralph at the baseball game as he
      is wont to do, kicking a ragged gnome doll all around the field which happens to be covered
      with huge mounds of juicy beef.


      I have no doubt, that as you mention in your article, that this method will take much practice and concentration...
  17. A Perhaps Simpler Algorithm by The+Grey+Mouser · · Score: 1

    Many years ago, I stumbled upon a book that contained an alternate method for finding the weekday for a given date. Wish I could remember the reference, but I do remember the method :-)

    You just need to remember twelve numbers, one for each month:

    Jan = 0 Feb = 3 Mar = 3 Apr = 6 May = 1 June = 4
    Jul = 6 Aug = 2 Sep = 5 Oct = 0 Nov = 3 Dec = 5

    (You can derive these on the fly by remembering how many days are in each month, modulo 7)
    Now, subtract 1900 from your year, and take the difference modulo 7.
    ( 2001 - 1900 ) mod 7 ===> 101 mod 7 ===> 3

    Add the number of Leap Years between the year of interest and 1900 (include the current year if it's a leap year, and the date you want is after 28th February)

    (2001 - 1900) / 4 = 25 leap years

    Add the two numbers, modulo 7: (25 + 3) modulo 7 = 28 modulo 7 == 0
    Add the number of the month, above, modulo 7: June = 4, (4 + 0) mod 7 = 4
    Add the day of the month, modulo 7: 5th June = 5, (5 + 4) mod 7 = 9 mod 7 = 2
    Now, 0 == Sunday, 1 == Monday . . . 6 == Saturday, so:

    5th June, 2001 is a Tuesday (if you didn't know already :)

    Works for years prior to 1900 as well, just remember how additive moduli work with negative numbers (add, don't subtract), and subtract the number of leap years, don't add them.

    Let's try 20th September, 1989 (no reason in particular):

    1989 - 1900 = 89 mod 7 = 5
    Number of intervening leap years: 22
    September = 5
    20th = 20

    ( 5 + 22 + 5 + 20 ) mod 7 == 52 mod 7 == 3 == Wednesday

    Not sure if it's much easier than Conway's algorithm, or if I'm just used to it now. Anyway, I didn't see it mentioned elsewhere in the comments, so I thought I'd point it out.

    Cheers,

    Michael

    1. Re:A Perhaps Simpler Algorithm by The+Grey+Mouser · · Score: 1

      Many thanks for the link. Actually, I believe my numbers are still correct (1 Jan 1900 was a Monday). Also, the number for February and March had better be the same! (February has 28 days normally, which means that identical days of the month in February and March share the same weekday as well (14 Feb is on the same weekday as 14 March)

      I'll go through the link again, and see if why things differ (my German needs polishing rather badly :)

      Cheers,

      Michael

    2. Re:A Perhaps Simpler Algorithm by dh5fbr · · Score: 1

      It might be equal, although I don't believe so at the moment, but your numbers for January and February may be messed up. January =1 , February=4 (BTW: A german explanation can be found at http://www.math.uni-bonn.de/people/gw/wochentag.ht ml)
      73 Joerg

  18. Perl, in my head!?!? by sharkey · · Score: 2

    How in the heck am I going to compile Perl into my head? That's completely besides the fact that the human brain would probable go schizo trying to figure out the best way to implement the alogorithm, since there are probably too many ways to do it.

    --

    --

    --
    "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
  19. Re:metric calendar by kallisti · · Score: 2
    Funny you should call it the metric calendar. You see, the same people who brought us the mmetric system also tried to change the calendar, getting rid of all the "old gods" and such. This happened in France just after the Revolution and before the Reign of Terror. Guess what happened to the calendar reformers...

    Changing the calendar is not something that people accept, there were riots when the Gregorian calendar was adopted due to people being upset that they were losing 10 days. You might say people are more rational these days, but I don't see any evidence of that.

  20. And Conway does this pretty quickly! by Tchaik · · Score: 2

    He likes to ask for your birthday and by the time he's done saying "well, I can tell you that this was a" he has the weekday.
    Of course, I didn't check his answer at the time, so I presume mistakes could easily go unnoticed, but he's really good at those kinds of things. To practice he has a program in his .login that prompts for a couple of random given day of the week (and checks) and gives him his score (total time taken for 5 good answers iirc) He has the same kind of program for factoring 4 digit numbers, etc...

    (I've been privileged to be one of his student and he is truly the most amazing mind I've personally met)

  21. yes it does read the article by blach · · Score: 1

    dude quit bitching and read the article, it most certainly does mention the fact that it uses the gregorian calendar and has problems with earlier dates, and earlier dates in great britain.

    karma whore. =(

  22. Favorite quote... by BlueSpark · · Score: 1

    Christmas is always the day before Doomsday.

    Ain't that the truth,

    --
    -- "Words are lame and words are crap" - Bouncing Souls
  23. Re:metric calendar by Silverfish · · Score: 2

    Yeah, this is a good idea... until you actually think about it.

    According to your system the year would have only 100 days (10 days/mo * 10 mo/yr). That unfortunately is not anywhere close to reality.

    A day is defined by the time it takes the earth to rotate on its axis, and a year is defined by the time it takes our earth to orbit the sun.

    The two are interrelated in that the time for one orbit ~= time for 365 revolutions. i.e. 1 year = 365 days. There's nothing you can do about it.

    You could go to a 10 month year, with each month having 36.5 days. (or 1/2 would have 36 days and 1/2 would have 37) But is that really gaining us anything?

    To have a 100 day year as you propose, you would have to change the definition of "day" or "year", neither of which is appealing: Would yo prefer a "day" with 3.65 daylight/nighttime cycles, or having it take 3.65 "years" to complete the four seasons?

  24. Re:Google Copy by SMN · · Score: 2
    Interesting idea -- post the link to the google cache of the article when the page hasn't even gone down, with a little "sigh" to make users think otherwise. What a great way to deceive moderators and earn karma!

    (moderators: this isn't flamebait or a troll, it's just pointing out how easy it is to fool others into moderating one's post up undeservedly. You might even call it insightful =)

    --
    -- Imagine how much more advanced our technology would be if we had eight fingers per hand.
  25. Re:Is the Zeller algorithm correct ? Re:Limitation by SMN · · Score: 2
    Are you sure you're truncating, and not rounding?

    It should work as follows:
    2 + (8*26)/10 + 73 + 73/4 + 19/4 - 2*19
    = 2 + 208/10 + 73 + 18 + 4 - 38
    = 2 + 20 + 73 + 18 + 4 - 38
    = 79 % 7 = 2 -> Monday

    --
    -- Imagine how much more advanced our technology would be if we had eight fingers per hand.
  26. Re:Limitations. . . by SMN · · Score: 2
    Well, I didn't say that the Gregorian Calendar would certainly be wrong in the year 4092 -- it's just that we don't know how people will deal with the problem, so we can't be certain the date we obtain is correct and, as I said, "this algorithm should not be used for any date past December 31, 4091."

    The leap year rules might be adjusted to compensate every 4000 years, or the days might be allowed to accumulate, as you suggested. Or there might be an entirely different Calendar in use. But since we don't know, it wouldn't be a good idea to try to get one of those dates, because those are much less likely to be correct.

    --
    -- Imagine how much more advanced our technology would be if we had eight fingers per hand.
  27. 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 PurpleBob · · Score: 2

      Wow. You certainly must be smarter than John Conway, then. He should take a lesson from you and, instead of teaching neat mathematical tricks, start a course in "Not Reading The Article 101".
      --

      --
      Win dain a lotica, en vai tu ri silota
    2. Re:Limitations. . . by Speare · · Score: 2

      There are a few very minor limitations on this algorithm that are not mentioned on the page. [...] The algorithm uses the Gregorian Calendar.

      The example preceding the #Origins section of the page describes the same issues about the Gregorian calender, including the fact that the Gregorian dates weren't adopted everywhere instantly.

      As for which is better for the job, I'll take Doomsday over Zeller. If I wanted a method that required integer division, I'd get out my calculator. Many sufficiently advanced calculators have a shortcut to calculate this, anyway. Perhaps Doomsday is to Bresenham as Zeller is to Interpolation.

      --
      [ .sig file not found ]
    3. Re:Limitations. . . by brassman · · Score: 1

      Heh. You think Daylight Savings Time sucks?

      $ cal 9 1752
      September 1752
      Su Mo Tu We Th Fr Sa
      .. .. .1 .2 14 15 16
      17 18 19 20 21 22 23
      24 25 26 27 28 29 30



      $

      There were riots in the streets over this.
      --

      --
      "Ain't no right way to do a wrong thing."
    4. Re:Limitations. . . by MPolo · · Score: 1

      Fine, then go to this page to get the complete Doomsday algorithm, including corrections for the Julian calendar.

    5. 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...

    6. Re:Limitations. . . by Water+Paradox · · Score: 1
      It is important not to calculate the day of the week for ANY date after February 12, 152,560. It is rumored that knowledge of anything beyond that date rests in the domain of the eternal, and the entire universe will cease to exist if anything is attempted to be known beyond that date, including something so ordinary as the day of the week.
      --
      information is immaterial
    7. Re:Limitations. . . by knoxvillejeff · · Score: 1

      I'm LOL! Great reference to Fermat!

    8. Re:Limitations. . . by inbox · · Score: 1

      Off topic but the precession of the planet does not reverse the seasons every 13,000 years, it merely augments the time spans in which they happen. Just wanted to clarify that.

    9. 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!

    10. Re:Limitations. . . by fortunatus · · Score: 1
      THANK YOU!!! you'd think that someone going to the trouble to think up this algorithm would know about that pre-Gregorian calandar twist...

      especially with the tone of that page being like, wow, this Dr. is so cool...

      i still do like the algorithm, though, but minus cool points on the Dr. for not showing Ph. D. quality thoroughness on the date research...

    11. Re:Limitations. . . by fortunatus · · Score: 1
      i do take it back about the prof. -- he didn't write the page, did he!

      fact is, there was BAD DATA presented in the form of both WRONG CHARTS and WRONG EXAMPLES.

      the author knew better than to operate the algorithm outside of the Gregorian bounds, hence the disclaimer, and yet the BAD WORK was included anyway! that deserves some good bashing! how hard could it be to draw a line and say, "the algorithm is not valid before HERE?"

  28. Re:It's all a hoax by gorilla · · Score: 2

    Not terribily suprising. The chances of getting 12 correct with 12 guesses is 80!-68!, or 1 in 1,962,360,214,549,183,088,640,000. Even if a trillion guesses are played, the chances of winning are still almost 2000 trillion to 1.

  29. Now we wait... by west · · Score: 2

    Seems pretty clever. I wonder how long it will be before somebody claims a patent violation.

  30. Re:Is the Zeller algorithm correct ? Re:Limitation by Old+Wolf · · Score: 1

    Can you do that all in your head?
    I can do three of the Doomsday at once, no trouble...
    It may have more steps, but you can remember them all at once, in bite-sized portions.

  31. Re:Great fun at parties? by Old+Wolf · · Score: 1

    Well, it depends on what sort of chicks you're after. Some prefer a bit of intelligence and some don't. If you're looking for a quick fuck with an airhead then by all means pretend to be dumb :)

  32. Why is it called Doomsday? by Old+Wolf · · Score: 1

    I don't think they mentioned this in the article..

    I read this in the morning, and practised it in my head on the way to work. While thinking of random dates to try, "June 6 1945" came to my mind. by "The Hand", 0 + (1900s Doomsday) + 3 + 9 + 2 = (you guessed it) the 1900s Doomsday!

    Having found this, I now remember everything perfectly :)

    Also, some of you may not have picked up on the fact that this article was penned cleverly: instead of brashly stating facts and expecting memories, he deliberately leaves out some critical deductions, but hints very strongly at them. It is ten times easier to remember something you worked out yourself, than something you saw somewhere.

  33. Mathemagician and penny experiments by LinuxParanoid · · Score: 1
    Did anyone else check out the "Mathemagician" article about Conway at the bottom of the cited web page?

    I did, and it ends in an intriguing claim (and demonstration) from Conway that if one stands pennies on their side on a table, and bumps the table, all the pennies will land heads-up. And that if spun, pennies will land 2/3 of the time tails up. (Appropriate physics reasons are given for the surprising behavior.)

    I tried this with a sample of 10-20 pennies from my jar and was not able to duplicate the findings. (In the 2 trials I had patience for, I got heads up 2/3 of the time with both table-thumping and coin-spinning.) I'd have done more trials but I was at work, albeit on a dinner break. ;) Has anyone else heard of this or checked it out?

    --LP

    1. Re:Mathemagician and penny experiments by LinuxParanoid · · Score: 1

      The article seemed to be set in Conway's office which is on the campus of Princeton University in the US. So I presumed US pennies. UK pennies might very well be different though, true.

    2. Re:Mathemagician and penny experiments by Lozzer · · Score: 1

      Can't tell from the article whether they are UK pennies or US (is there such a thing?)...

      --
      Special Relativity: The person in the other queue thinks yours is moving faster.
    3. Re:Mathemagician and penny experiments by SlippyToad · · Score: 1

      Or maybe Conway suffers from a case of fullishitus.

      --
      One day I feel I'm ahead of the wheel / the next it's rolling over me / I can get back on / I can get back on
  34. /dev/bong by StrawberryFrog · · Score: 1

    Oddly enough, this is not original see ther E2 node for : /dev/bong

    --

    My Karma: ran over your Dogma
    StrawberryFrog

  35. Re:child geniuses by Paelon · · Score: 1

    There was an interesting description of an idiot savant who could do just this in "The Man Who Mistook His Wife For A Hat" by Oliver Sacks (wrote Awakenings).

    I agree that I'm not sure how remarkable it is that this algorithm can merely be computed in ones head. However for people who have never had the algorithm described to them, (maybe the savant had allready read about this algorithm, who can be sure), it shows great ingenuity to come up with an algorithm like this for themselves.

    It's not the act of executing the algorithm that would make them genius material. It's whether they read the solution and were good at menial math, or whether they were inventive and (re)created an algorithm themselves.

  36. Not exactly breaking news by gorsh · · Score: 2

    The poem has been around since 1976, and the algorhythm is even older...

    1. Re:Not exactly breaking news by tswinzig · · Score: 2

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

      Yeah, it started on a Wednesday, to be exact.

      --

      "And like that ... he's gone."
  37. Re:why the free speach worries? by linuxy · · Score: 2

    Yes, this assumes base 10. A more general, and easily provable (although I'm not going to include a proof here) rule is that in base b, b-1 divides the number iff b-1 divides the sum of the digits. If another number n divides b-1 then, n divides the sum of the digits as well. Similiary, b+1 divides the number iff if divides the alternating sum of the digits (in other words, in base 10 - 132 = 2-3+1 = 0, which is divisible by 11, so 132 is divisible by 11). Similary, numbers that divide b+1 have a similar property.

  38. 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.

    1. Re:Hey... by os2fan · · Score: 1
      Lucky we don't have the Roman calendar. Their week was tied to the month, and the leap day was put in between 23 Feb and 24 Feb.

      Their style was to have weeks of seven or eight days, with fixed dates as the "Sundays". Dates other than Sundays are counted to them, so a date that we would call 11, would be four days before the Ides.

      With a little ingenuity, one could have a stock blank form for all months. If there are missing days, you just cross off some date on the calender. On the same system, we would have 7 month blanks, where we cross off 31, 30 and 29 if these don't apply. Except in the roman system you don't have to grab the tuesday blank.

      The algorithm presented here is quite interesting, because if you know "doomsday" is tuesday, you can check the token dates to see if they are a tuesday as well: 5/9 9/5 7/11 11/7 4/4 6/6 8/8 10/10 12/12.

      --
      OS/2 - because choice is a terrible thing to waste.
  39. Re:It's all a hoax by The+Good+Reverend · · Score: 1

    Next think you know, they'll be figuring out a way to crazy casino games like Kino...

    There's an easy way to win at Keno - don't play. If you're looking to win at gambling, first remember that hotels are big and fancy for a reason, and second, play blackjack - that's as close as you're going to get to having "good" odds.

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

  40. Re:why the free speach worries? by The+Good+Reverend · · Score: 2

    Regarding my above post, numbers divisible by three add up to three, six, nine, or another number divisible by three, not just three. Sorry for the quick post =)
    The Good Reverend
    I'm different, just like everybody else.

  41. Re:It's all a hoax by The+Good+Reverend · · Score: 2

    Ah...I wasn't aware. Very interesting. All the Keno games I've seen in Vegas use balls for their main game, I'm not sure about the side games, though I'm sure most do, even if it's behind the scenes. What I find facinating is that no one in Las Vegas has ever matched 12 of 12 or better (keno is a pick as many as you want from 80, and 20 are picked, for those unfamilar with the game). The odds do suck, but how many billions of keno games have been played in the last 50 years?

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

  42. 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.

    1. Re:why the free speach worries? by CaseStudy · · Score: 1

      Algorithms aren't (supposed to be) patentable. Mechanisms or processes which employ algorithms may be patentable. It's a subtle distinction (and one that's let a few algorithms slip through), but I don't think this would be patentable, as it can be done by head and hand (see Gottschalk v. Benson).

      The other speech commentary is sheer idiocy. So it's a copyrightable poem; so what? Copyright would only protect the poem, not the algorithm. Free speech is a complete non-issue.

    2. Re:why the free speach worries? by CaseStudy · · Score: 1

      Free and protected how? The protection 2600 was talking about was based on the First Amendment; they claimed free-speech concerne overrode the DMCA's provisions against disseminating the DeCSS code.

      This isn't an example of that kind of First Amendment protection, because nobody has tried to prohibit this speech.

    3. Re:why the free speach worries? by jordandeamattson · · Score: 1

      A major issue in the DeCSS cases is are mathematics, alogorithms, source code protected speech?

      If mathematics, algorithms, source code are protected speech, then 2600 Magazine is protected when publishing both the DeCSS code and links to the DeCSS code. If these aren't protected speech, than it isn't possible to invoke free speech guarantees when publishing them. This is a major issue. If it goes the wrong way, it would be bad news.

      As the original author said, this is a marvelous example of how mathematics is a form of free and protected speech. It is a shame that this example wasn't available for inclusion in EFF's 2600 Magazine brief.

    4. Re:why the free speach worries? by tbone1 · · Score: 1
      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?

      Actually, it's the sum of the digits should be divisible by three, which you've already pointed out. And don't forget that a number is divisible by nine if the sum of its digits is divisible by nine.

      I think this assumes base 10; does anyone know if it applies to anything like, say, base 13? I think it does, but I've been out of school too long to prove or disprove this.

      --

      T-Bone
      "I will not make an issue of my opponent's youth and inexperience." - Ronald Reagan

      --

      The Independent: Reverend Spooner Arrested in Friar Tuck Incident - ISIHAC, Historical Headlines
    5. Re:why the free speach worries? by ryants · · Score: 2
      Has someone tried to claim a patent on this? It's a neat little math trick, but the poster seems a little paranoid.

      Well, if it catches on, calendar makers will be out of business, and we can't have that.

      Seriously I think this is a swipe at the anti-DeCSS crowd, who are trying to argue that computer code (and, by extension, mathematical algorithms) are not protected speech.

      Ryan T. Sammartino

      --

      Ryan T. Sammartino
      "Ancora imparo"

    6. Re:why the free speach worries? by blang · · Score: 1

      In some countries, not everyone has the right to publish and sell calendars. For example, in Norway, Almanakkforlaget (The Almanac Publishers) used to have an exclusive right to print and publish calendars. I am not sure if that is still the case, though. You could always get calendars from other makers, but they had to be licenced from Almanakkforlaget. I am not sure why they had such a right. It might have been something delegated to them from the lawmakers to ensure quality control of calendars.

      --
      -- Another senseless waste of fine bytes.
  43. Is the Zeller algorithm correct ? Re:Limitations. by monsoon · · Score: 1

    The Zeller algorithm listed doesn't work if you interpret the direction "where all of the arithmetic is done with INTEGERS" literally. Try for example July 2nd 1973. If I treat every calculation (including the divisions) as an integer operation, the algorithm suggests a Saturday, whereas the date is a Monday. Or am I missing something ?

  44. It's all a hoax by Delrin · · Score: 1

    Oh, so this is how those pretend to be geniuses/idiot savants do it. Next think you know, they'll be figuring out a way to crazy casino games like Kino.....waitaminute.

    1. Re:It's all a hoax by Delrin · · Score: 1

      RE:Bingo Actually, I agree with you. Bingo is fun, cheap, and you won't lose your house and children... we'll probably not, as long as those old dye stamping grannies aren't high-rollers. :)

    2. Re:It's all a hoax by Delrin · · Score: 1

      LOL! I liked that one (your comment, AND the movie for that matter)... setec astronomy

    3. Re:It's all a hoax by Delrin · · Score: 1

      Yeah tell me about it. There must have been a sympathetic judge, who liked the idea of the underdog teaching the big boys a small lesson. From what I remember, he took home more than $60,000 CDN. That's like $3 US. ;-)

    4. Re:It's all a hoax by Delrin · · Score: 1

      I agree with everything you are saying, and thanks for the detailed info. Very interesting. I've attached a link to a quote from the actual article. Which I am sure you can dig up a the Globe and mail Toronto's newspaper that the link was quoted from. If you're interested, and you find the link. Let me know, I'm curious also.
      Delrin Kenro

    5. Re:It's all a hoax by Delrin · · Score: 2

      Actually, I was making a "witty" commentary on something that happened here in montreal. A hyper-addicted gambler watched and recorded all the kino games for a period of time. And found a flaw in the so-called "random" number generation (computerised), he successfully was able to predict the outcome on a large number of occasions, and the Casino tried to sue him for the money back.. unsuccessfully. They then started using real balls to get the numbers. :)

    6. Re:It's all a hoax by smyle · · Score: 1

      I hadn't heard about the Canadian Keno problem, but I had heard about the Texas Hold-em Poker problems a couple of years ago. (That's http://www.cigital.com/news/gambling-tech.html for the goatse.cx paranoid)
      --

      --

      Sleep is just a poor substitute for caffeine, anyway. -Bob Lehmann

    7. Re:It's all a hoax by edp · · Score: 1

      "... like counting cards at a poker game in Vegas, this IS illegal..."

      Counting cards is not illegal. Interfering with the game would be, but using skill is not. This is typically misunderstood because people confuse the (non) illegality of counting with the legality of the casino refusing to let you play if you count. That is, the casino is within their rights not to play blackjack with you if they think you are counting, or if they don't like the fact that you are winning, or if they just don't like you -- but that's simply because it is their freedom to choose whom to do business with, not because you do anything illegal by counting.

      I have heard this is different in Atlantic City, that skillfull play (like counting cards) is protected by law, so casinos cannot stop you if that is all you are doing to win, but I haven't seen any authority on that.

    8. Re:It's all a hoax by pcidevel · · Score: 1

      There's an easy way to win at Keno - don't play. If you're looking to win at gambling, first remember that hotels are big and fancy for a reason, and second, play blackjack - that's as close as you're going to get to having "good" odds.

      Actually, if you want good odds play bingo.. in bingo you acutally give a bit to the house in order to play the game against the other players, as opposed to other games in which the house can win... look at it like this:

      Slot machines, you have a very small chance to win, that is why the house makes out like a bandit, because if you don't win the house does.. you are playing against the house at very low odds..

      Bingo, lets say you pay $5 to play.. the house will take 25 cents and then put the other $4.75 into a pot, the winner of the game gets the pot of cash that is $5 per person minus the 25 cents the house took from each entry... so the house is garunteed to make a bit of cash off every player, and they have an incentive to make sure that lots of players make lots of money (they make more every time someone plays, not every time someone looses).. Bingo is the best game for the player because there is no incentive for the house to cheat players into not winning, like say having games that pay out 99% in the off times and 80% in the peak times that some casino's (NOT VEGAS!) do with their slot machines... vegas is a different story all together, very well regulated, but still driven to make the player loose more than the house (after all, that is how vegas makes it's money)...

      --

      I thought someone said there was going to be free beer!

    9. Re:It's all a hoax by pcidevel · · Score: 3

      Actually, I was making a "witty" commentary on something that happened here in montreal. A hyper-addicted gambler watched and recorded all the kino games for a period of time. And found a flaw in the so-called "random" number generation (computerised), he successfully was able to predict the outcome on a large number of occasions, and the Casino tried to sue him for the money back.. unsuccessfully. They then started using real balls to get the numbers. :)

      Actually that definately was not a 'flaw' persay other than the fact that the pseudo random number generator must have been displaying every number called in order.. ALL pseudo random number generators (i.e. every computer generated random number sequence) is a repetive sequence.. given the same seed it will produce the same results.. it's a fact of life, random number generation isn't possible algorithmically.. I know, I used to write them for gambling applications for a living.. What the player must have done was sit through enough iterations of the random number generator to realize what the pattern was (say, they seeded with time, using only the hours and minutes, and if the game started at 9:00 the numbers would always be the same).. I have heard rumors about this kinda stuff happening.. but I have never seen any REAL proof that a programmer was lax enough to get this out on the market.. In fact when some of my games went through the regulatory procedures, people at the agencies that verified the games had basically the same story (urban legend?) happening in atlantic city casino's.. funny enough, every time I've heard it it's been keno, but I would think there would be much easier and less detectable games to do this with (computerized blackjack)..

      It's important to realize that just like counting cards at a poker game in Vegas, this IS illegal and I'm quite sure that if it could be proven it the casino would win a lawsuit (and probably the person counting the deck so to speak would serve jail time also)...

      We got around this with our generator by selecting numbers from the deck even when we weren't being asked for a number, so a 'random' amount of numbers were drawn in between each time that a 'random' number was drawn.. that and the random seed was not only second from epoch but a serial number and various other things (like the content of a 'random' location in memory) all added together..

      Every gaming market I have been too requires at LEAST a Chi-Square test on the generator to ensure even distribution of random numbers.. Most test the random number generator much more vigorously.. I can't imagine something slipping into the field that a player could cheat easily.. It seems to me that probably this is a legend that started with someone with basic random number generator knowledge saying "Hey, theoretically you could cheat these generator's IF..." that got spread into a real legend that it happened.. but then again.. I've met some poor programmers in my time, and seen extremely lax validation agencies.. so it's possible that something like this really happened.. :)

      --

      I thought someone said there was going to be free beer!

    10. Re:It's all a hoax by ryants · · Score: 2
      If you're looking to win at gambling, ... play blackjack - that's as close as you're going to get to having "good" odds.

      Horse racing is better, since you aren't competing against the house (they just take a fixed cut), but rather you're competing against the other gamblers.

      My best summer job was working at the local race track and watching my high school principal gamble away his daughter's inheritance week in, week out.

      Ryan T. Sammartino

      --

      Ryan T. Sammartino
      "Ancora imparo"

    11. Re:It's all a hoax by terrymah · · Score: 1

      Counting cards (a term usually associated with blackjack, not poker) isn't illegal - at least at every casino I've been to. It's legal for the player to use any information given to him (which includes the cards that have been shown to him) in any way he sees fit - players just aren't allowed to use outside help in interpretting this information (such as computers, calculators, etc) or obtain any information they shouldn't have through the course of fair play (ie look at the dealers down card).

      The flip side is, of course, that a casino can bar you from playing a specific game or (less often) from the casino as a whole for any reason they see fit or for no reason at all. However, they certainly can't have you arrested for keeping a high/low count in blackjack and definately can't take any winnings away that you may have already won.

    12. Re:It's all a hoax by banshee2000 · · Score: 1

      How do they do it? Year (usually start with a 00 yr like 1900 or 2000) divided by 4. Then year divided by 100 + year divided by 400 = modulo 7 = day. Gives you Jan. 1 If you want Apr.22, Jan. 1 + number of day for each month. Did this guy make money on this? HAH! There used to be a sucker born every minute, now it's every second :P

  45. Here's the article I was talking about by Delrin · · Score: 2

    I found some more info here. Apparently it was 620,000$ CDN that he won. They been the odds of "1 in 6 billion" 3 times in a row. Here are some excerpts

    - Corriveau used an "antique 286" computer to analyse 7,000 combinations from the keno game, [which uses an electronic pseudo-random number generator].
    - The Casino managers shut the game down and called the police.
    - The Surete du Quebec [provincial police] fraud squad investigated; Corriveau and his family even took polygraph tests.
    Might want to look on yahoo or somewhere to find the details of the actual judgement. Though I am pretty sure he was let off completely.

  46. Re:metric calendar by Pebble · · Score: 1

    So do you suggest that we spin the Earth on it's axis slower to get 100 days per orbit of the sun or are we going to decrease our orbital path so we can have the same length day but a shorter (and hotter!) year? Until you decide I guess we'll stick with the 365.25 day orbit.

  47. aw gimme a break! by sudog · · Score: 1

    You have to know what day doomsday is before the algorithm even works! Didn't you even read the article you mook?

  48. John Conway by Satai · · Score: 1

    I remember when he showed my B90 class this at nwu last year. He did a series of very interesting lectures - evidently based on a series he did at princeton - about a HUGE variety of topics. Godel, Number Theory, discrepancies in time measurement...

    One of the most interesting things he showed us was how to find Pi from a game of pool - no tricks! I forget the exact method, but I think you took two balls of equal mass, hit them together, and looked for how many times the second would hit the wall before stopping. And then you changed the mass ratio to 10-1, then 100-1, and so on.

  49. There's a newer version by rbowen · · Score: 1

    The newer version of the package comes with another module, Date::DayOfWeek, that actually has a function to calculate the day of the week for any day in the Gregorian calendar. http://search.cpan.org/search?mode=module&query=Do omsday

    --
    Apache guy, Open Source enthusiast, runner
    1. Re:There's a newer version by GeneOff · · Score: 1

      Get it instead of the one linked to in the post. The tar file there is missing. Here it is: http://www.cpan.org/authors/id/RBOW/Date-DayOfWeek -1.13.tar.gz

  50. This story has nothing to do with DeCSS by CaseStudy · · Score: 1

    Here's a comparison with the legal status of the DeCSS algorithm: the DeCSS algorithm is the subject of a lawsuit because it circumvents an encryption scheme and may therefore be illegal under the DMCA. The Doomsday algorithm is not the subject of any lawsuit, has nothing to do with encryption, and the DMCA has no bearing on it. Conclusion: the Doomsday algorithm does not affect the DeCSS case in the slightest.

    1. Re:This story has nothing to do with DeCSS by CaseStudy · · Score: 1
      (Apologies in advance for an American-centric post, and for responding to such an obvious troll...)

      I'm not an obvious troll; an obvious troll posts goatsex links. I just try to let people know when they're seriously misinformed about the law.

      The point is that it's possible to express an algorithm in a "natural" language; when you do so, it is considered protected speech by the courts. When you express it in an another language, though, the courts have decided that it it *not* protected speech.

      And my point is that where this statement isn't just plain wrong (something is not automatically protected speech just because it can be expressed in a natural language), it's meaningless (protected against what?).

      In other words, the courts have opined that *how* you say something is at least as important as *what* you say; and even if what you have uttered what would normally be considered protected speech under the 1st amendment, if you don't say it the right way, then you lose your 1st amendment rights.

      Well, obviously. Time, place and manner restrictions have always worked this way.

  51. Re:Easy to remember? by mr3038 · · Score: 1

    I agree. And even if I remember all rules there's a good change I get not so accurate answer doing it in my head... I'd probably get equally valid answer simply guessing and it's much faster algorithm! Success rate 1 of 7. How about changing to 10-based system and discarding months altogether instead of inventing YAWA (yet another weekday algorithm). Simply calculate days from the start of year. That would be great solution to mm/dd/yyyy vs. dd.mm.yyyy problem also. One could simply write like 2001#157@500 (internet time). One can always dream...
    _________________________

    --
    _________________________
    Spelling and grammar mistakes left as an exercise for the reader.
  52. I have an easier way... by ajuda · · Score: 1

    D00d, Just use cal!

    Linux: An OS for the Masses: Rosanne Barr and Tom Arnold


    This message was encrypted with rot-26 cryptography.

  53. Bigger margins by yerricde · · Score: 2

    but the margin is too small to contain it...

    You have all the margin you want at Everything, the Internet's most popular collaboratively filtered database and writing community. (See also what I've written.)

    --
    Will I retire or break 10K?
  54. Re:Great fun at parties? by gibson_81 · · Score: 1
    so long as I happen to know whether the last day of Feburary is the 28th or 29th that year, and what day of the week the last day of Feburary happens to land on.

    OK, I can admit that the trick for getting the doomsday for a year in a century might take some training to memorize, but for the base (centuries) you only need to memorize 4 days - it's a nice, short period. As for the leap years, that's stuff you usually pick up in kindergarten ... come on here, read the whole article, not just the first screen of it ... you know what that grey bar on the right side of the text means?

  55. Re:child geniuses by Theodore+Logan · · Score: 1
    This algorithm is really not very difficult to figure out and straighforward, and there are a lot of variations on it. Not to brag or anything, but I came up with a different one when I was a child that worked almost as well. People were impressed, but I am by no means a genius.

    That said about this particular case, in the general you have a point.

    --

    "If you think education is expensive, try ignorance" - Derek Bok

  56. child geniuses by Theodore+Logan · · Score: 2
    Actually, being able to do this calculating is a capability often attributed to various "child prodigies". For example, Amy Wallace wrote in "The Prodigy" (a sort-of biography of William Sidis, by some (myself, for example), considered by many the greatest child prodigy ever) something like:
    • Young Sidis astounded guest with his remarkable ability to calculate the the day of any given day in a matter of seconds, using an algorithm he had invented himself.
    While Sidis undoubtly was a real prodigy, many others that are attributed with this "remarkable ability" aren't. That they are nevertheless labeled so is probably mostly due to biographers (like Wallace) overestimating the difficulty of this particular task. Not that this is really important or anything, but it always annoys me when people gravely overestimate someone's intellectual capacity merely because of simple tricks.
    --

    "If you think education is expensive, try ignorance" - Derek Bok

  57. Knuckle thing by simetra · · Score: 1

    The knuckle thing for figuring out if a month has 30 or 31 days is best. If you're not aware of this, find someone who is, have them teach it to you, and you'll have a much happier life.

    --

    "Would it kill you to put down the toilet seat?" -- Maya Angelou
  58. Re:Great fun at parties? by The+Dark · · Score: 1

    HER: Sure....what day of the week does never fall on?
    Busted... now everyone at work is wondering why I burst out laughing.

    --
    sig's not here
  59. Curry-Howard correspondence by Blackheart2 · · Score: 1
    There is a well-known theorem in programming language theory called the Curry-Howard(-de Bruijn-Tait-Feys-...) correspondence. It says, approximately, that every program P of type T written in a functional programming language is equivalent to a proof P' of a theorem T', in a particular logical system. This suggests (but does not prove) that any program written in any strongly-typed language is probably a "piece of mathematics", and may provide an argument that programs and mathematical theorems be treated analogously by the law.

    BH

    --

    BH
    Fools! They laughed at me at the Sorbonne...!

  60. too complicated by 2Bits · · Score: 1
    I still think this trick to compute the day is way too complicated. A math teach taught us a much simpler "formula" to compute that when I was 8.... now if I could recover that formula....

    1. Re:too complicated by 3am · · Score: 1

      is it short enough to fit in the margin of your notes?

      x^n+y^n=z^n is kappup for n2

      --

      A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
  61. Conway by profzoom · · Score: 1

    One of the highlights of my mathematics education so far has been when John Conway was visiting Northwestern University last year for a series of lectures after winning the Nemmers Prize. My math prof got him to come in and lecture for us one day. The first thing he did was his day of the week finding algorithm, and I was the student whose birthdate he asked. And sure enough, maybe 2 or 3 seconds later, he proclaimed I was born on a Wednesday.

  62. Stardates by Archangel+Michael · · Score: 1

    Can anyone calculate the DOW for stardate 40759.5?

    --
    Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    1. Re:Stardates by Water+Paradox · · Score: 1

      Tuesday, of course.

      --
      information is immaterial
  63. Google Copy by Alien54 · · Score: 2
    {Sigh}

    Here is the link to the copy in the Google Cache

    enjoy!

    (oops - forgot the password)

    Check out the Vinny the Vampire comic strip

    --
    "It is a greater offense to steal men's labor, than their clothes"
    1. Re:Google Copy by Alien54 · · Score: 2
      Hate to be the one to tell you, but Vinny the Vampire is some horrendously unfunny shit. Maybe it's time for a new sig?

      No accounting for taste, of course. I'll pass the info on to the pair running it, a couple of of my teenage nephews.

      (gotta help out family and all that)

      Check out the Vinny the Vampire comic strip

      --
      "It is a greater offense to steal men's labor, than their clothes"
    2. Re:Google Copy by Alien54 · · Score: 2
      Interesting idea -- post the link to the google cache of the article when the page hasn't even gone down,

      Considering I tried to access it from work where we have the usual t-1 line, it I couldn't get it, what was I supposed to think? after all, not everyone has an OC line

      And I've been maxed for months. I wish they would tweak/fix the moderation system so that I could use some more of the karma.

      Check out the Vinny the Vampire comic strip

      --
      "It is a greater offense to steal men's labor, than their clothes"
    3. Re:Google Copy by tristan+f. · · Score: 1

      Hate to be the one to tell you, but Vinny the Vampire is some horrendously unfunny shit. Maybe it's time for a new sig?

      --
      Hi, I'm a pretentious cock who will make some gay comment about ignoring AC posts here.
  64. Neater code by Cassivs · · Score: 2
    Personally, I think this little snippet is much more obfuscated, and well, just more like "that's hacker code.":

    int dow(int m,int d,int y)
    {y-=m<3;return(y+y/4-y/100+y/400+"-bed=pen+mad. "[m]+d)%7;}

    Even though it only works for "a restricted range." This comes from here, which has some other information too.

    --
    -skip
  65. Hey wait a minute... I think I smell conspiracy... by Junior+J.+Junior+III · · Score: 1
    After carefully analyzing the intricate steps of this so-called "calendar algorithm"*, I've deduced that this is in fact a Doomsday Algorithm!!!!

    Beware! Running it will bring about the end of the world!

    * Well, that and the big headline at the top of the page...

    --
    You see? You see? Your stupid minds! Stupid! Stupid!
  66. Re:Recommending vices by pcidevel · · Score: 1

    Well, if ya really want to do stupid things with your money, you could eat it. Make sure to shred it well with your teeth, otherwise it gets clumped up in your epifloggital sac.
    Gambling... all gambling... is for losers. Even if you win, you lose.

    Baugh. I played the lottery once. Lost a dollar. Never played again. Got the point.


    Heh.. smart man, I always felt like a tax collector for the stupid when I was working in the gambling industry.. the ONLY reason anyone should ever gamble is for Entertainment, and it sure does not entertain me for one.. You should look at gambling like a video game (you put in your money, you get to see some pretty things, your money is gone).

    I have seen people loose their lives to my paycheck when I was in the industry, and no, that didn't upset me in the slightest. I was always up front with anyone that asked that you will NEVER beat the house gambling (it's not possible, the house is a group of professionals, you aren't).. Never once did that deter someone from gambling and thinking they would win that I know of, but seriously YOU WON'T WIN... it's just not possible, the odds are typically astronomical..

    --

    I thought someone said there was going to be free beer!

  67. Build your own Perpetual Calendar by T1girl · · Score: 2

    I'd just as soon try to memorize the Charge of the Light Brigade as that bizarre poem. It ain't exactly "Thirty days hath September."

    But I think I could manage to make four paper strips and fold them around a pencil, or build this cardboard contraption, or even try tattooing this stuff on various body parts like the guy in Memento.

    I might try this interactive calendar to find the Doomsday to start the algorithm process, but then I wouldn't need to remember the algorithm, would I? I would be most likely to consult my desk copy of Farmer's Almanac, then the only thing I would have to remember is where I put it.

    Resisting the urge to shout "How are you, gentlemen?" every time I pass the "gentlemen's room" at work.

  68. In my head?!? by wrinkledshirt · · Score: 2
    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.

    Maybe, but only if one of the steps included in my head is telling myself "Remember where you put the printout to that page, dumbass."

    --

    --------
    Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

  69. Recommending vices by Water+Paradox · · Score: 1
    Well, if ya really want to do stupid things with your money, you could eat it. Make sure to shred it well with your teeth, otherwise it gets clumped up in your epifloggital sac.

    Gambling... all gambling... is for losers. Even if you win, you lose.

    Baugh. I played the lottery once. Lost a dollar. Never played again. Got the point.

    --
    information is immaterial
  70. Television good. by Water+Paradox · · Score: 1
    Spoken by one who has learned well where all the buttons are on his TV remote. Hell, why even get up in the morning?

    1. Open Palm IX
    2. Climb Mt. Everest
    3. Pray to God
    4. Something else difficult
    5. Close Palm IX

    Do you even remember what dirt smells like anymore?

    --
    information is immaterial
  71. Re:dang slashbots by Water+Paradox · · Score: 1
    Sarcasm is also tolerated, we noticed.

    Ummm, didn't you see that Slashdot is "news for nerds?" It didn't say "Open Source nerds," it sed "nerds." Geez. Don't be a nerd, ya geek!

    :-)

    --
    information is immaterial
  72. Re:Even more fun with nines by tanpiover2 · · Score: 1
    Any number which is divisble by nine will NOT be divisble by zero.

    This does not assume base 10.

    --

    But masters, remember that I am an ass: though it be not written down, yet forget not that I am an ass.
  73. Zeller's Algorithm (at last!) by Shade,+The · · Score: 1

    Ta for the info! I used this algorithm in a program years back, but I forgot the name and have never been able to find it since :)

  74. Re:metric calendar by matrix29 · · Score: 1

    Slight problem. We do actually have 365.25 days per year. Days are an unchangable unit. A better deal is changing the measurement of the second (another one of my bored thought exercises). I pondered doing a "percent of the day" digital watch.

    A day is equal to 24 x 60 x 60 seconds = 86400 seconds. If we went to a percent of the day it would be 10 hours x 10 minutes x 10 seconds = 1000 "seconds" which would be make the new second 86400 / 1000 = 86.4 longer. So another 2 divisions of the day would need to occur to near the pulse-beat per second accuracy if this were to be an adopted concept.

    An example would be 8:22:34 PM would become 73354 seconds into the day or 84.9004629% of the day. Since you'd only need 4 digits following the decimal point to maintain the previous accuracy level, it'd be easy to do, but you'd need a bigger numerical display for the time. Don't even get me started on why somebody named a time unit "seconds" which also means the unit following one of some set.

    --
    "Face it, a nation that maintains a 72% approval rating on George W. Bush is a nation with a very loose grip on reality.
  75. In other news by IanA · · Score: 1

    Associated Press, June 4, 2001

    Greece - A new math theorem is out, that allows the computation of angles in a triangle.
    This theorem was created by a 'Pythagoras'.
    It is entitled the 'Pythagorean theorem'.
    The algorithm, patent free, is available below.

    a^2+b^2=c^2

  76. Dr Who anual of 1978 by Zeinfeld · · Score: 2
    An algorithm that was pretty simple appeared in the Dr Who annual of 1978 (or thereabouts). It was the sort of thing one might do at the age of 12 but which rapidly becomes tedious thereafter.

    A much simpler algorithm is

    1. Open Palm VII
    2. Start Calendar
    3. Consult relevant day in calendar

    The SAS survival handbook lists hundreds of ways to stay alive in artic wastes armed with only a rusty can opener. Me I go down to the supermarket.

    Technology is good, folk should try it sometime.

    --
    Looking for an Information Security student project suggestion?
    Try http://dotcrimeManifesto.com/
    1. Re:Dr Who anual of 1978 by crowke · · Score: 1

      Your algorithm is pretty cool! It's soooo easy to port it to other platforms like Psion, WinCE, Linux, ... :)

  77. Re:metric calendar by inbox · · Score: 1

    Plus think of all the people that would cease to exist because they were born in November or December. That's not riotous, that's tragic.

  78. Autistic Savants by sexykitty · · Score: 1

    One skill commonly found among autistic savants is the ability to calculate the day of the week for a particular date in only seconds. Autism (brought to life by Dustin Hoffman in Rain Man) is a developmental disorder usually apprearing early in life. The fact that this complex (to the average person) algorithm is needed to perform this task only highlights the amazing abilities of these special people. There is still so much we don't understand about the mind. Please see the Austism Society's website: www.autism-society.org

    --
    echo $wittysigline;
  79. Editors are Retarded by Razzious · · Score: 2

    I think back to a movie about a Savant(Rainman)...Seems that they want us all to be autistic and wonder aimlessly figuring calculations in our head...Meantime i get my palm out of my pocket protector, pull my half keyboard and go about it the old fashioned way....


    I am accepting donations for more bow-ties and a new pair of coke bottle glasses.


    Razzious Domini

    --
    Razzious Domini
    I could be a GREAT KARMA WHORE if I could just shed the few morals I have left.
    1. Re:Editors are Retarded by 3am · · Score: 1

      you are retarded.

      by your own admission, you can't figure out what day of the week it's going to be in the future in your head...

      why don't you try artificial respiration? it really beats that old fashioned breathing...

      donald knuth admired conway, and without people like knuth and conway, you wouldn't have your precious little palm. it your going to eat the fruit, don't knock the farmers

      --

      A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
  80. How did this get modded as interesting? by 3am · · Score: 1

    at best, it's funny.

    the reasons a metric calendar makes no sense are very, very easy to see.

    1. the earth completely rotates around it's axis every 24 hours.
    2. the moon rotates around the earth about every 30 days
    3. the earth rotates around the sun about every (24 hour) days.

    whatever, this idea is like deciding to speak exclusively in pig latin. ie, it is more complicated and messy than the existing solution, and makes no sense.

    at least do it in a power of 2 radix. radices of 10 don't make sense anymore either... just a little less arbitrary as the gregorian method.

    --

    A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
    1. Re:How did this get modded as interesting? by 3am · · Score: 1

      "3. the earth rotates around the sun about every (24 hour) **365** days"

      okay, i didn't preview my posting. shoot me.

      no one who doesn't need a palm pilot to figure out the date would have any problem with the omission anyway...

      --

      A: None. The Universe spins the bulb, and the Zen master merely stays out of the way.
  81. Love Poems for the poem's author by Bakajin · · Score: 1
    Has anyone yet written love poems to the author?

    Truely geeky girls, gotta love em! So rare and special. Despite being kinda cute, she's got that slightly sarcastic sassiness one would hope for.

  82. Easier algorithm? by $hotgun · · Score: 1

    Wouldn't it be easier to just asign a date a number based upon it's distance from a starting date, say a Sunday sometime early in the century, and then just mod7 that date?

  83. metric calendar by viva1917 · · Score: 1

    Maybe the problem is that our calendar is simply too complicated. Why on earth are we using the Gregorian calendar, anyway? It would be far simpler to use a dating convention that has, let's say, 10 months per year, 10 days per month, 10 hours per day, and 10 minutes per hour. Better yet, we do not even have to name the units. Year = e0. Month = e-1. Day = e-2. Hour = e-3. Minute = e-4. Dates and times could then be represented easily by a single decimal. For example, 5.072 would 5th year, 0th month, 7th day, 2nd hour.

  84. this thing is pretty old by m08593 · · Score: 1

    If you pick up books on memory tricks and mnemonics, they describe schemes very similar to this. Many people who do this actually prefer methods that involve a little bit more memorization: they are faster and you are less likely to make a mistake.

  85. Great fun at parties? by NickFusion · · Score: 1

    So, I can figure out what day of the week any date in history falls on in my head...so long as I happen to know whether the last day of Feburary is the 28th or 29th that year, and what day of the week the last day of Feburary happens to land on.

    Say, that will be great fun at parties.

    --
    What were you expecting?
    1. Re:Great fun at parties? by NickFusion · · Score: 1

      Ahhh...my bad. Mistook a divider for the bottom of the page.

      Having discovered my error, I can see now that mastering this skill would indeed make me a true chick magnet.

      ME: Hey Babe, you were born on a FOURsday. How 'bout a date tWEBELSday?

      HER: Sure....what day of the week does never fall on?

      --
      What were you expecting?
    2. Re:Great fun at parties? by NickFusion · · Score: 1

      Ah, I see. Rout memorization of a algorithm makes me smart. Gotcha. So long "current events", so long "interesting books I've read recently", hello FIVEsday!

      --
      What were you expecting?
  86. 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
  87. 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

  88. This story is really about DeCSS by jdavidbathome · · Score: 1

    Glad everybody thought this was so neat, but the real reason for posting was to invite comparison with the legal status of the DeCSS algorithm. I wish they'd put that in as a related link. But, you could do your own search, instead: DeCSS stories on slashdot

    When will we recognize that legal maneuvering cannot and should not replace true technological protection (such as real encryption) or enforce it. Laws that say "keep your eyes closed while your computer manipulates that information" are ineffectual and contrary to the spirit of the law.