Monday, January 23, 2012

Doomsday Algorithm


Often we see in the news or read  in some article about an extraordinary person who can name the day of the week when given an arbitrary date… It seems unbelievable…
All it requires is a bit of skillful math, some amount of talent, practice and knowledge of Doomsday Algorithm or Doomsday Rule

 It is all about having an information that:
§  For any given year, 4/4, 6/6, 8/8, 10/10, 12/12 and the last day of february falls on the same day…
Ø  For odd months, it’s a bit tricky…
ü  January – Its 3rd if its not a leap year, 4th if leap year…
ü  March – Its 7th – exactly a week after the last day of February…
ü  And remaining are a bit simple… 9/5, 5/9, 7/11, 11/7
§  It is called the Doomsday
§  Eg: This year the Doomsday is a Wednesday…
 Calculating the Doomsday for a particular year…
 For calculating the Doomsday for any particular year, we need an Anchor Day
§  An Anchor Day is the Doomsday for the zeroeth year (1800, 1900, 2000 etc.) of the century…
Ø  For the purposes of the Doomsday rule, a century starts with a 00 year and ends with a 99 year
§  Eg: the Doomsday of 1900 is Wednesday, hence Anchor Day for 1900-1999 is a Wednesday, similarly for 2000-2099 it’s a Tuesday…
 Then it’s all about calculations using some simple formulae (like the odd+11 method etc.)… unless you have a great memory…

So, when is this years Christmas???
 Doomsday 2012 is Wednesday
 So, December 12th (12/12) is a Wednesday, so are December 19th and 26th
 So, December 25th is a Tuesday…

Reference: