About that Party Day of Week Trick

in #math7 years ago (edited)


Image Credit

About finding the day of week for any date, for example birthdays! Check out this video in this post for the trick in action:
https://steemit.com/math/@kizzbonez/how-to-find-the-day-of-the-week-from-any-date-math-trick
I found the video to be oddly satisfying to watch. It is about how to determine the day of week for a range of dates as a party trick.

As I was watching a couple questions bubbled up in my mind:

  1. How does this work?
  2. Is this practical to carry out on the fly?
  3. Is it interesting? As in, would anyone at a party really be interested?

The trick

To summarize the trick, the formula is, for a date in the century C, year Y, month M, day D, computing the following:

and finding the corresponding day for that day code. I've summarized the formula compactly above, which has a few elements needing of explanation, but it's exactly the method described in the video.

  • The funny looking brackets means "floor", what you get when you take the number and throw out its decimal, e.g. the floor of 2.5 is 2. So the floor of Y/4 is what you get when you divide Y by 4 and throw out the remainder.
  • The "mod" means take the remainder when you divide (in this case by 7), but the great thing is that as soon as a number gets large you can immediately divide by 7 and take the remainder and continue the computation. For example... 4+ 5 + 6 mod 7 is the same as 9 + 6 mod 7 is the same as 2 + 6 mod 7 is the same as 8 mod 7 which is the same as 1. You don't have to add them all up first, which would give you 15 mod 7 = 1. (This property, and this trick, hinges on Modular Arithmetic)

The codes are quoted below for reference:

Month:

January = 0
February = 3
March = 3
April = 6
May = 1
June = 4
July = 6
August = 2
September = 5
October = 0
November = 3
December = 5

Century:

1700s = 4
1800s = 2
1900s = 0
2000s = 6
2100s = 4
2200s = 2
2300s = 0

Day

Sunday = 0
Monday = 1
Tuesday = 2
Wednesday = 3
Thursday = 4
Friday = 5
Saturday = 6

How it works

I won't go into a full derivation, but I want to point out the useful "mod" property above and referenced in the wikipedia article. I'm going to borrow the same picture from the article, because in fact everyone already uses it without thinking:

If you are ever computing what time it is in another time zone on Earth, you are doing modular arithmetic. All this trick is, is a codification of the same thing, where you imagine instead of counting up to 12 and starting over again, you are labeling for reference Sunday as 0, up to Saturday as 6, and as you count up through the days of the calendar.

You'll notice that the need for month codes comes from the fact that our calendar is irregular and each month has a different number of days (otherwise the formula would be much simpler!)

What we do know is that a whole year as 365 days (except ....). So supposing that say January 1st of 2017 is a Sunday (day code 0), you can shortcut to figure out what day it's going to be on January 1st of 2018 easily by adding 365 mod 7, which is 52 * 7 + 1 mod 7, or just 1. That means the day code of January 1st of 2018 is 1, which means it's a Monday. Actually I think this is one of the first things that most people inadvertently notice, because "Why is my birthday shifting by 1 every year to a different day of the week?". Well, that's why!

Notice the "except" earlier. For leap years, which happen every 4 years and adds an additional day, we have to factor that in, which is why in the formula you see the part where we divide the number of years by 4 and take the floor ( throw out the decimal).

A quick googling leads to where one can find a full derivation (good thing they use Sunday = 0 also :) ): http://mathforum.org/dr.math/faq/faq.calendar.html

Is it practical to carry out?

The referenced post mentions:

This is easy — just memorize the number 033614625035

This made me chuckle! Why don't I just make that my bank account pin and it can double as a party trick? Probably you'd write it down on your hand ahead of time... or on your phone.... and then at that point you may as well just google "What day of the week is ____ ?".

But the nice part about the modular arithmetic property is that given the codes, it's relatively easy to do the computation mod 7.

Is it interesting?

Surprisingly, I think it might be of interest. Not many people know what day of week their birthday is. You can always tie in to astrology, because that's usually pretty popular. For example, googling "horoscopes about the day of week you were born" gives this gem of an adage from http://www.elbertwade.com/page84.html :

Sunday's child is full of grace,
Monday's child is fair of face;
Tuesday's child loves to race,
Wednesday's child is kind of heart;
Thursday's child is very smart,
Friday's child will never part;
Saturday's child is good of heart.

So you can just ask...

"Hey... you know what day of the week you were born?"

and then

"I've got a trick for that..."

Well, probably the party will have to be very boring before it gets to that. Oh well. Happy birthday!

(As I write this, I realized that I don't know what day of the week I was born. Let's see... carry the 1.... Ah screw it, google tells me... Wednesday! So I'm kind of heart. Yay.)

Sort:  

Great trick. Thanx for sharing.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 65359.95
ETH 3492.90
USDT 1.00
SBD 2.51