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)!"
Sorry... Just saw "Wargames" again recently.
Damn it! I can't even get first Google here!
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
...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
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
Whining about old news has been around since Ecclesiastes, and whining in general is even older...
If tits were wings it'd be flying around.
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:
----
Celebrate the finer things in life
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.
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. .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...
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
(I've been privileged to be one of his student and he is truly the most amazing mind I've personally met)
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?
(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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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. 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.
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?
- 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
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"
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
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!
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.
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...
A much simpler algorithm is
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/
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"
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.
"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
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