FYI.

This story is over 5 years old.

Tech

The Doomsday Rule: An Algorithmic Classic

Mind Your Decisions explains.
​Image: Dafne Cholet/Flickr

​Any budding computer scientist is eventually going to come across this particular problem: given a date sometime in the future (or past), calculate what day of the week it will fall on (or did fall on).

The solution is not exactly simple (and there are several): The day/date correspondence changes year by year, obviously. To get the answer requires a few concepts common in computer science and programming, such as the modulo operator and "floor" notation, but mostly the general idea of "doomsday," which is probably not what you expect. The creator of the Doomsday solution, the mathematician and game of Life creator John Conway, can reportedly solve day of the week problems in a snap mentally. The math/puzzle blog ​Mind Your Decisions offers an explanation above.