The Doomsday Algorithm

Okay, so this is my new favorite thing. John Horton Conway is a renowned mathematician who came to my attention for his Doomsday Algorithm.

The algorithm allows one, with the memorization of a few rules and some basic arithmetic, to determine the day of the week for any day, month and year specified. Conway himself can consistently provide the answer in under two seconds. Arthur Benjamin can also do it very quickly, as he demonstrates in this performance (starting at 7:54). I’ve been practicing for about an hour and can do the calculation in about half a minute…

The essential concept is that each year has a Doomsday (a day of the week), and that day is always the last day of February. For example, 2008’s Doomsday (February 29th) is Friday. Once you know a given year’s Doomsday, the day of the week for the date specified can be inferred from its offset to Doomsday, with the application of a few simple rules.

For example, let’s say that the date given is December 18th, 2008. 2008’s Doomsday is Friday. Based on the way that the Gregorian calendar works, December 12th (12/12, easy to remember) always falls on the same day of the week as the last day of February (the count of the days between the two is evenly divisible by 7). From there, all you do is calculate the offset from December 12th to the target date December 18th (6 days). So, December 18th is a Thursday.

The rules are different for different months. For example, take March 28th, 2008, the date that Max Mosley engaged in a five hour Nazi-themed orgy with five prostitutes (previously, previously). March 7th is always the same day of the week as Doomsday, so March 28th (offset by 21 days) is a Friday as well.

For me, the time-consuming part is determining a given year’s Doomsday, because of leap year rules (a leap year occurs every four years, except for years that are evenly divisible by 100, unless they are also evenly divisible by 400). The only method that I’ve located involves using a century offset. For example, if I want to know the Doomsday of the year 1967, I calculate it as an offset of 1900’s Doomsday.

1900’s Doomsday is Wednesday (which has to be memorized). To determine 1967’s Doomsday, you do three calculations and sum the results of each:

1) How many times does 12 go into 67 (as in 1967)? The answer is 5.
2) What is the remainder? The answer is 7.
3) How many times does 4 go into the remainder? The answer is 1.

5 + 7 + 1 = 13, which is the number of days that 1967’s Doomsday is offset from 1900’s Doomsday. So, 1967’s Doomsday is Tuesday.

I hope to get a lot faster, because it seems like a fun way to play with someone else’s mind. I’m not overly worried about this post spoiling the trick, because my legion readership is still dwarfed by Famous Jewish Sports Legends.

Discrete vs. Discreet

Shopping for midget porn the other day, I came across an e-commerce site offering “Discrete Shipping”.

Discrete Shipping

A Google search on “Discrete Shipping” (over 63,000 results) suggests the problem is not isolated (but hilarious).

As a committed pedant, I thought I would take this opportunity to explain the difference between “discreet” and “discrete”, and even offer a mnemonic trick for remembering the difference.

Discreet – having or showing discernment or good judgment in conduct and especially in speech (Merriam-Webster Online), as in, “Max Mosley failed to keep his Nazi-themed orgy discreet.”

Discrete – constituting a separate entity; individually distinct (Merriam-Webster Online), as in, The five prostitutes that Max Mosley engaged for his Nazi-themed orgy were from five discrete agencies.”

So, taken literally, “discrete shipping” would mean that if I ordered three midget porn DVDs, they would arrive in three separate packages.

I’m glad that I didn’t order jelly beans.

The mnemonic trick is simple. Look at the “e”s in each spelling. Notice how the “e”s in “discrete” are separate, or discrete.

Isn’t learning fun?

Compare Stuff

My pal Gokmop recently published a post about Compare Stuff, a site that allows you to correlate a user-defined keyword axis against an axis of predefined collections (such as emotions, days of the week, etc,), using web search results as the data set:

God and Satan

Click to embiggen

What we learn here is that both God and Satan are extremely bored (which will probably clear up once the Wii shortage abates) and not very satisfied (perhaps they should go back to some good Old Testament jacking around with the likes of Job and Abraham), and that, annoyance aside, God seems generally more upbeat about the future.

Print *This*, Pal

I decided to try out Yaakov’s sweet Perl hack on printers that use the HP Printer Job Language (HPPJL), in honor of April Fool’s Day.

The script connects via TCP to the printer’s (standard) port 9100 and changes the LCD “Ready” message to one of your choosing (with space limitations). Below are a few of the messages that our area’s network printer displayed today.

They ranged from the controversial:

HAIL SATAN

FREE TIBET

To the confusing, but plausible:

JIGGLE TRAY 1

REVERSE TRAY 1

To the bizarre:

REMOVE PANTS

WTF?

REPLACE GERBIL

Beer Me

Mmm, minty.

ICE TRAY LOW

To the confessional:

April Fools!

What Does Schadenfreude Mean? Ask Max Mosley. He Speaks German.

Max Mosley is the President of the Fédération Internationale de l’ Automobile and is, as such, arguably the most powerful person in motor racing worldwide.

The News of the World (a British tabloid) published an investigative piece yesterday (with video) that appears to show Mr. Mosley participating in a Nazi-themed, sadomasochistic orgy with five prostitutes.

Or, as we call it at my house, “Thursday.”

While Mr. Mosley has not made a statement denying the article’s claims, a spokesperson for the FIA stated:

This is a matter between Mr. Mosley and the paper in question. We understand that Mr. Mosley’s lawyers are now in contact with that newspaper and the FIA has no comment.

Predictably, the hue and cry for Mosley’s resignation came immediately from organizations such as Holocaust Educational Trust and the Holocaust Centre. I say “predictably” because Max Mosley is a prominent figure in the public eye, whose family has direct Nazi associations. Max’s father Oswald Mosley was the founder of the British Union of Fascists, and he and Max’s mother were married in the drawing room of Joseph Goebbels, with Adolf Hitler in attendance.

The timing is also unfortunate, coming as it does less than a month before the debut of a FIA-sponsored anti-racism initiative at the Barcelona Grand Prix.

Now, I don’t like Max Mosley. He has used his position to carry out personal attacks in the media against Formula 1 legends like Sir Jackie Stewart (“He goes round dressed up as a 1930s music hall man. He’s a certified halfwit.”), and I have a personal grudge over his breathtaking failure of leadership in the debacle that was the 2005 United States Grand Prix.

That said, I don’t want to see Max forced to resign over this. While the whole episode is decidedly unsavory if true, I think it falls firmly in the realm of private life, and it was a victimless crime. While Max may have shown questionable personal judgment (public figures should really make more an effort not to get caught on video engaged in this sort of behavior), I would rather see him lose his position as President of the FIA based solely for his actions in that role.

Heikki Kovalainen

Given that I have a whole page of this site dedicated to it, I am obviously a huge Formula 1 fan. Since I started following the series in 2000, I have been an unwavering McLaren supporter. This year’s McLaren driver lineup is phenomenal. Lewis Hamilton and Heikki Kovalainen are both beginning their second seasons in Formula 1. They’re both extremely talented, and it appears that they have the right equipment under them to put that talent to good use.

That said (and I apologize profusely, in advance, Heikki, my dear, wee, little puppet man):

thunderbirds.JPG

kovalainen.JPG

The Thunderbirds called. They want their marionette back.

Do Not Reply

Okay, so this is my new favorite thing. Surely my gentle readers have received email from “donotreply@somecompany.com”. It turns out that some institutions (several major banks, the TSA, Halliburton) do not want to deal with the email replies sent to these addresses themselves, so they instead use an address like “donotreply@donotreply.com”. The problem (if by “problem” you mean “hilarious fuckup”) is that “donotreply.com” is a registered domain, and the fellow who owns it (Chet Faliszek) reads the email replies and publishes redacted versions of the more amusing ones to his blog.

Apparently Mr. Faliszek receives legal threats more frequently than I change my underwear, but has never once been sued. If the entity contacting him is civil about it, he will remove posts from his blog in exchange for the requester making a donation to hus local pound or animal protection organization.

Wikihistory – A Short Story

A lot of people on the Internets are linking to this short story by Desmond Warzel. I normally don’t participate in the blog equivalent of email forwarding “Fw: Re: FW: FWD: This is really funny,” but as a regular lurker in forums (fora?), I have to say that this is, in fact, the funniest thing I’ve read in awhile.

My favorite excerpt:

At 02:29:49, SilverFox316 wrote:
PS to SneakyPete: your Hitler paintings aren’t worth anything, schmuck, since you probably brought them directly here from 1907, which means the paint’s still fresh. Freaking n00b.