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.