Doomsday algorithm

o algoritmo del día "reshulo"

Do you know what day of the week were you born in? Can you tell what day of the week will be the next 1st of May? Or what about the day when Iniesta scored the goal for the victory of Spain in the World Football Cup?

You will be able to do it if you read carefully the following instructions. It's a long algorithm that can be performed using mental calculations and a bit of memory and training. You will need to know something about multiples of 4, multiples of 7 and multiples of 12.

Finally, you need to know that leap years are multiples of 4. This rule has some exceptions, but it's not important now.

Preliminars

1. Write on the board your date of birth. What day of the week was it?

2. What day of the week is today? What day of the week will be same day next year?

3. How many days has a year? How many weeks? Can you know what day of the week will be a day like today next year?

To answer those questions you need to know that a year is equal to 52 weeks plus 1 day. Because 365 = 52 · 7 + 1

So every year you "go forward" one day of the week (except for leap years +2days).

October, 10th 2023 is Tuesday, then

October, 10th 2024 will be Thursday (because 2024 is a leap year, 366 days = 52 · 7 +2),

October, 10th 2025 will be Friday, 

October, 10th 2026 will be Saturday, 


A. Every year you "go forward" one day of the week (except for leap years).

Doomsday is how we call the last day of February (28th or 29th in a leap year (you know, those multiples of 4)). This is a special day and the base of our algorithm.

4. Have a look at a calendar. Find out what day of the week is doomsday for this year. What about next year? Look at the rest of the days like doomsday in a calendar. Has anyone of them something special for you?

So, in 2023, Doomsday is Tuesday.

Even months

5. What day of the week is 4/4, 6/6, 8/8, 10/10 and 12/12? What do they have in common?

Exactly! They are all the same than Doomsday and this thing happens every year. That is because there are an exact number of weeks from the 28th of February. A multiple-of-seven number of days.

There are, exactly, 5 weeks (35 days) from the 28th of February to the 4th of April (4/4); exactly 14 weeks (98 days) to the 6th of June (6/6), and so on.

For even months (not including February), the Nth of that month (if N is the number of the month) is the same day than Doomsday. Easy to remember.

B. 4 - 4, 6 - 6, 8 - 8, 10 - 10 and 12 - 12 are doomsday every year.

6. What day of the week was April, 5th 2023? What day was June, 13th?  What day was last 3rd of August? What day will be next Christmas Day?

Odd months

But what about odd months. Doomsday for March is easy, knowing 28th or 29th of February. May, July, September and November has 9th, 11th, 5th and 7th, respectively. It's easy to remember if you use this mnemonic: 

"I work 9-5 at 7-11", that is, "I work from 9 a.m. to 5 a.m. in a 7-eleven" which means that

9 - 5, 11 - 7, 5 - 9 and 7 - 11 are doomsday every year. 

Did you know that the day of the week of every date in February in any non-leap year is the same than the same day of the month in March?

7. What day of the week will be next Pi-day?

Years

We know that every year goes forward one day (two if it's leap year). Knowing that we can go forward or backward a few years, but not many.

Talking about that you need to know that leap years are multiples of 4. This rule has some exceptions, but it's not important now.

And look what happen with doomsdays.

Doomsday

Every 12 years doomsday goes forward one day.

So if you want to know the day of the week of some date a few years ago, you have to count "twelves" and subtract or add days for every 12 years.

Exercises

8. Find out what day of the week of the following dates:

9. Find out the day of the week you were born. Correct the days of the week written on the board.

10. Find out the day of the week 5 members of your family were born.



Links