Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
It's funny.  Laugh.

Calendar: Code, Free Speech, Or Mathematics? 147

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)!"
This discussion has been archived. No new comments can be posted.

Calendar: Code, Free Speech, Or Mathematics?

Comments Filter:
  • by Anonymous Coward
    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
  • by Anonymous Coward
    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();
  • by Anonymous Coward
    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

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

  • There is no magic to multiplying 5 digit numbers in one's head. Systems like The Trachtenberg System of Speed Mathematics [mdc-berlin.de] (called Basic mathematics in the edition of the book that I have) can teach this trick to anyone who is good with figures.
  • Viewing the algorithm [interlog.com] 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?

  • 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...
  • Damn it! I can't even get first Google here!
  • 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.

    ---
  • 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
  • You can do it in John Conway's head.
  • by waldoj ( 8229 ) <waldo@@@jaquith...org> on Monday June 04, 2001 @01:18PM (#177016) Homepage Journal
    ...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
  • by Cid Highwind ( 9258 ) on Monday June 04, 2001 @01:28PM (#177017) Homepage
    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.
  • Whining about old news has been around since Ecclesiastes, and whining in general is even older...
  • 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!

  • 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:
    ----
  • :) 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.
    ----
  • 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
  • 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
  • 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.

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

  • 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)
  • 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. =(
  • Christmas is always the day before Doomsday.

    Ain't that the truth,
  • 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?
  • 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 =)

  • 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

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

  • by SMN ( 33356 ) on Monday June 04, 2001 @01:22PM (#177034)
    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 [columbia.edu] .

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

  • 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.
  • Seems pretty clever. I wonder how long it will be before somebody claims a patent violation.
  • 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.
  • 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.
  • 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!
  • 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 :)
  • 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.
  • 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".
    --
  • Did anyone else check out the "Mathemagician" [cloud9.net] 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

  • 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.
  • Oddly enough, this is not original see ther E2 node for : /dev/bong [everything2.com]
  • 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.
  • The poem has been around since 1976, and the algorhythm is even older...
  • 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.
  • by Moonshadow ( 84117 ) on Monday June 04, 2001 @01:10PM (#177049)
    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.
  • 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.

  • 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. [michris.com]
  • 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. [michris.com]
  • 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. [michris.com]
  • 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. [michris.com]
  • 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 ?
  • the links are always green
  • 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.
  • 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. :)
  • LOL! I liked that one (your comment, AND the movie for that matter)... setec astronomy
  • 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. ;-)
  • 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 [globeandmail.com] 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
  • 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. :)
  • I found some more info here. [ncl.ac.uk] 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.
  • 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.
  • 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.
  • You have to know what day doomsday is before the algorithm even works! Didn't you even read the article you mook?
  • I hadn't heard about the Canadian Keno problem, but I had heard about the Texas Hold-em Poker problems [cigital.com] a couple of years ago. (That's http://www.cigital.com/news/gambling-tech.html for the goatse.cx paranoid)
    --
  • I remember when he showed my B90 class this at nwu [nwu.edu] 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.
  • 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
  • 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.
    --
  • 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.

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

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

  • (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.

  • 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...
    _________________________
  • D00d, Just use cal!

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


    This message was encrypted with rot-26 cryptography.
  • but the margin is too small to contain it...

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

  • Fine, then go to this page [utexas.edu] to get the complete Doomsday algorithm, including corrections for the Julian calendar.
  • 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?

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

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


  • I'm sorry man, its time to get a new freaking monitor. Honestly.
  • Can't tell from the article whether they are UK pennies or US (is there such a thing?)...

  • 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.
  • HER: Sure....what day of the week does never fall on?
    Busted... now everyone at work is wondering why I burst out laughing.
  • Interestingly enough, this "new algorithm" was taught to me by Art Benjamin [hmc.edu], who teaches some math classes (combinitorics, discrete, number theory, etc) at Harvey Mudd College [hmc.edu] ... 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 ...



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

  • {Sigh}

    Here is the link to the copy in the Google Cache [google.com]

    enjoy!

    (oops - forgot the password)

    Check out the Vinny the Vampire [eplugz.com] comic strip

  • 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 [eplugz.com] comic strip

  • 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 [eplugz.com] comic strip

  • 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 [cs.unb.ca], which has some other information too.

  • by sv0f ( 197289 ) on Monday June 04, 2001 @03:20PM (#177099)
    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...
  • by pcidevel ( 207951 ) on Monday June 04, 2001 @01:39PM (#177102)
    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.. :)
  • 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.
  • I'd just as soon try to memorize the Charge of the Light Brigade [eserver.org] as that bizarre poem. It ain't exactly "Thirty days hath September."

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

    I might try this interactive calendar [alabanza.com] 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 [almanac.com], 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.
  • 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."

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

  • 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

  • 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

  • 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
  • by bark76 ( 410275 ) on Monday June 04, 2001 @02:59PM (#177138)
    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!

  • by Purple_Walrus ( 457070 ) on Monday June 04, 2001 @01:24PM (#177149)
    "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!
    ---
  • by ayers ( 457413 ) on Monday June 04, 2001 @01:31PM (#177150)
    CalendarBuilder.asp, a combination VBScript/JavaScript Server Page implements this algorithm.

    Source code available at webware.skybuilders.com [skybuilders.com]

    The calendar built by this page is part of skyBuilders timeLines [skybuilders.com]

    dtd

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

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...