Day of the week, given the date

I am sure there are multiple ways to do this, however I’d like to share with you this “algorithm” to find the week day of a date in the 20th century.
It involves much modular arithmetic, couldn’t be otherwise.
I’ve devised it this morning, btw…:slight_smile:
The 2 main problems are: months, which have a “random” number of days in them, and the leap years.
The base point is that 01/01/1900 was a Monday (easy, first day of century, first day of week)
However… the calculation in split into 2 main parts. I called them DATE and LEAP.
DATE is further split into Y, M, D (obvious meaning).
Year:
You have to get the reminder of the division by 7. E.g. 36 mod 7 = 1. Keep that number.
That number will advance the day of the week. Count the years from 1900.
E.g. 1936 --> 36

Months:
let’s write them and the reminders of the number of days in that month by 7.
J F M A M J J A S O N D
3 0 3 2 3 2 3 3 2 3 2 3
Then we “sum” cumulatively the reminders (and take always the reminder)
J F M A M J J A S O N D
0 3 3 6 1 4 6 2 5 0 3 5
You have to memorize that table, using some mnemonic trick (you know well which), and use it
as a look up table. There’s no shortcut to it. Keep that number.

Day:
Keep the reminder of the day divided by 7. Take away 1.
E.g. 8… 8 mod 7 = 1. Take away 1 --> 0.
Why take away 1 ? Because the day in the date should begin by zero. The first day of the month should be 0. But it’s actually 1, so take away 1.
Watch: 0 take away 1 --> 6. Always use modular arithmetic.

Leap years:
every leap year is a day more in the year, the day of the week will advance by one.
Divide the year (counting from 1900) by 4.
Take the whole part e.g. 7 / 4 = 1.
Take the reminded by 7.
Take away 1 if the month is Jan or Feb itself.
Note: 1900 is not a leap year, because it’s a secular year.

Sum all the numbers collected. Always take the reminder by 7. Advance Monday to get the day of the week. E.g. Monday advanced 5 is Saturday.

Example:
1973 march 17

1973 --> 73 --> 73 / 7 => 3
march --> 3
17 --> 17 / 7 => 3, take away 1 => 2
leaps: 73 /4 = 18 --> 18 mod 7 => 4

3+3+2+4 = 12 --> 12 mod 7 = 5

Monday + 5 = Saturday…

It looks a daunting task but it’s not really. With some exercise you should be able to get the day in less than 1 minute, with mental calculation.
:slight_smile:
Or if you are Kim Peek, you don’t need all that.

It’s… remainder, i.e., that which remains!

1 Like

With some more extra exercise, I should able to get each weekday
in less half of a second ( around 500 milliseconds on average).

Nodas

2 Likes

It is so hard not to say that it’s good of you to remind him, but I am going to stifle the urge. :grin:

?,наистина,ли правите над 60 дати за минута?


[via Google Translate]

really, do you make over 60 dates per minute?

it’s only…

…so no century code to consider. Makes things a bit faster… plus, no “century mod 4” to consider for leap year exception-exception.

Shouldn’t be a problem to get to 60+ per minute. You can also see that @Nodas has 90+ dates on the regular range (1600-2100) in 2018… to answer your question.

https://www.recordholders.org/en/list/mental-calculation-rankings.html

2 Likes

How is this possible?? It seems like it would take a few seconds for me to comprehend what I heard haha

Look at May 2000… 1 is Monday, 2 is Tuesday, etc.

If I told you 23, you’d divide it by 7 and get a remainder of 2 (Tuesday). That’s it for days… always. How long would it take you to get that to under half a second for May 2000? Look at May 2006 / 2017 / 2023 / etc… same thing, right?

Now look at May 2001 / 2007 / 2012 / 2018 / etc. and you’ll find everything moved in by one… so here your year code is [1] instead of [0] above. Create 7 memory palaces where you put the ones from above, these ones in a different one, and the same for +2, +3, etc.

Look at the whole year 2023 where May starts on a Monday and you’ll see that August is +1; Feb/Mar/Nov are +2; June is +3, etc. Simply create month mnemonics accordingly. May-0 as in mayonnaise, etc… and done!

Nov 25, 2021 is a Thursday (Thanksgiving)… you know this because 20-- (century) is always 0 this century. --21 is in your [5] memory palace, so you got 5. November is a 2, so the total is 7 and 25 has a remainder of 4 when divided by 7. The total is then 11, which you divide by 7 again to get 4 (i.e., Thursday). Alternatively, you could have just dropped the 7 along the way, because it has a remainder of 0.

That’s all… ignore century, year code (memory palace), month code (mnemonic), day, and divide everything by 7 and take the remainder.

ps: quickly compare 2000 and 2006 for Jan/Feb codes… when you have a leap year and the month is either Jan or Feb, subtract 1 from your result.

1 Like

That’s really cool if you managed to figure out a method by yourself!

As you say, there are several ways to calculate it - and when you use all the shortcuts possible, you the fastest people can do this calculation in about one second!

My official record is 59 in one minute, Nodas is faster, and the world record holder is Yusnier Viera, who once did 140 dates in just sixty seconds!

If you’re curious about the method that’s used by most people in competitions, I’ve described it in detail here - mental calendar date algorithm - and there are many shortcuts through that method!

As Parkouristx asks - how is this possible when it takes over a second to read the question? The answer is that most calculators are reading the task and then doing this task using visual parts of their brain, which is must faster.

2 Likes

I agree with Daniel and Bjoern.

I talked with Freddy a few weeks ago (A Cuban in Germany), who is the ex-WR holder in calendar. He trains an Indian kid called Jay Jain (winner of Memoriad 2016 in Calendars with 125 dates in 57").

So, Freddy showed me a screenshot of Jay’s score of 125 dates in less than 45 seconds, and I believe that he can sustain such a fast rate ( 45 / 125) = 0.36 " (=360 milliseconds). But the software does not allow more than 125 dates at the moment. This 0.36 " rate would yield a score of 166 dates per minute. But to do 166 D1M , he would have to sustain, 0.36" for the whole minute (60") , which is arguably harder than 125 in 45", so his rate could fall to 0.37" (=162 D1M) , or 0.38" (=158 D1M ) οr 0.39" (154 D1M)

For reference the minute οfficial WR as mention is 140 D1M by Yusnier (Cuba/USA), and this yields around 0.42" per date.

Of course, all people IRL cannot tell the difference between 0.39" and 0.42". Βut in competition and in the training between top competitors, it all happens in a flash. A faster rate accumulates more dates per minute. Some of us, use metronomes to keep the rate steady. At least, Yusnier uses it, because he told me that. The method is simple. Set the metronome to your desired speed. So BPM (Beats Per Minute) become D1M (Dates Per Minute).

As Bjoern mentioned, I personally have a Top-10 official score in the world (92 D1M/dates per minute), my unofficial is around 103 D1M, and which correspond to 0.65" and 0.58" per date respectively. But that’s my rate for the whole minute. For 10 and 20 dates, my PB (personal best rates are around 0.43" and 0.45" respectively, because one can focus much more for 4.3" or 9" seconds, instead of holding focus for 60 seconds. And despite that the initial date, always slows me down, when I rarely get less than 0.8" for this first date. So, for the dates between the 2nd and the last one, my actual rate is even faster.

It is similar to 100m and 800m in athletics for example. In the 1st sprint, the WR is 9.58" per 100m (Bolt) , and in the 2nd WR, it is 100.9" / 8 = 12.61" per 100m (Rudisha) . As you can see, the split times of David Rudisha are around 30% slower than Usain Bolt, and this happens if one competes for 1-2 minutes instead of 10 seconds.

This kind of fatigue is almost similar for my own rates, because my fastest 1 minute rate (0.58" per date = / 103 D1M) is also about 30% slower than 0.45" which is my fastest rate for 9 seconds (My personal best for 20 dates is around 9 seconds).

In Vegas, I gave my computer Jay to train 20 dates in k-train and even though he had not trained before in k-train, he was able to do about 7.7". So, if he trains, I am sure he can beat 7 seconds (=0.35" per date). And Yusnier can also beat 8 seconds for 20 dates, easily, probably 7.5" as well. But for me, the 9 seconds, 2 years ago, was pretty much a barrier, and only if I did not get any leap years (in Jan/Feb), I could do something like 8.9".

So, what wrote about 'with a little training I can get less than 0.5" per date", maybe sound a bit “flexing and over the top”, but before my last 4 competitions I was actually reaching such short-term speeds in my training with k-train. During 2013, my personal best was 82 D1M, I saw I had a bit potential in that category so I started training a bit more seriously for the next competition, and I stopped training many mental square roots. So in Calendar calculation, I reached 5th place in MCWC 2014, then 4th place in Memoriad 2016, and 3rd place in MCWC 2016 and finally 2nd place in MCWC 2018.
And in both MCWC '14 and Memo '16, for just only 1 date, I lost the Top-3 position, (e.g. 82 vs 83 in Memo '16) so I was actually very close to get a Top-3 place in calendars in all the last 4 competitions. I don’t know how much other people train, but I guess, if one wants to get such high positions in the competitions, then training is inevitable, at some point.

I have not tried to improved my scores since 2018 due to the lack of competitions (which is a huge motivation). But of course, I believe in my potential to break them. Everyone can break their own records, if willing to do so.

Daniel is also very fast and holds the British record in calendar, and can also easily go over 60 or 70 and Bjoern is one of the best mnemonists/ mental calculators in Germany (hard these days to find people who compete both in memory and calculation)

Regards,
Nodas.

2 Likes

Вие сте шампион!Нашият учител Георги Георгиев също ,е сред най-добрите.А Калоян ,моят син е засега с 36 за 60 сек.

Auto translation:

1 Like

Hello. I talk with Georgi very often. He won the Calendars in MCWC 2016. It is very good that his students are making very good scores. I hope you can do great in the the Junior Mental Calculation World Cup.

By the way! -->

26101 = 43 x 607

Regards,
Νοdas

2 Likes

И ние се надяваме .Дано всичко се развие добре! Желая Ви успешен ден!

And we hope. Hope all goes well! Have a nice day!

1 Like

Автоматичния превод е ужасен!

Automatic translation is terrible!

Wow that is really cool! But for me, is seems like the actual math would make me slow because you have to do math! haha

I totally know what you mean because it is similar when memorizing but you are doing math! I have done all sorts of math and I have to read a problem over and over just to make sure I know what it wants haha I feel like I would be slow trying to do mental math fast

Actually I find that Mathematics and Mental Calculation have only a small overlap.

For calendar dates it is the logic of why the method works (why do we divide by 7 and take the remainder? As 18-Aug-1990 is a Saturday, how can we know immediately that 18-Aug-1991 is a Sunday?)

Some university students in Mathematics have weak ability to handle numbers in their minds, and some human calculators have little knowledge of the Mathematics that makes their methods possible!

And both Mathematics and Mental Calculation can of course be trained using the right methods - so @Parkouristx it’s possible to have success in one without the other :slight_smile:

2 Likes

Hi Daniel. I agree. Most of this overlapping happens in :

  • Elementary Arithmetic (basic operations, +, -, x, %, as taught in elementary schools) and
  • Number Theory. ( primes, modulars, remainders etc)

Hi Johnny. We met at the Las Vegas during Memoriad 2016, I think you were also somewhere in the Golden Nugget Hotel in Fremont Street.

To be honest, when you check the top of all calendar calculation scores, there is a combination of both memory and calculation involved.

  • Huge Memory for codes, that correspond to years (Doomsday, or other code system
  • Also Calculation for division modulo 7 , division. ( example, instantly finding remainders from 0 to 6, and adding them. Example 5+5= 3 mod7 ).
    As one gets better scores, then the memory part becomes more important than the calculation mod7, whice can be mastered easily.

Many of the winners of calendars come from a memory contest background.
Both the Mongolian guy who won Calendars in Memoriad 2012, and also Jay the Indian who won in Memoriad 2016, used to participate in memory competitions, before achieving success in Calendar calculation.

Also, many other top scores in calendars, are from people who are also involved in memory somehow. For example, Yusnier Viera holds also the national Pi/π memory record for Cuba. And I also hold, the national Pi/π memory record for Greece.

Also, Bjoern, who comes from a memory background, has created a nice Calendar calculation App for i-Phone. I was happy to provide him , the Greek translation for his App:


If you have iPad or iPhone, check that out.

Nodas

You have a good memory! haha Ah okay I can see what you mean when it comes to doing the calculation. Are you picturing anything when doing the math? Or is it more of second nature when it comes to the codes?

No, I usually don’t use pictures. (99% of the time).
I only imagine the calculations between numbers, based on timetables. ( I personally master the 30x30 times table by heart, but other people in mental calculation master the 50x50, or even more rarely the 100x100 times table (Jerry Newport, Willem Bouman etc).

But in case , I could need to use a ‘carry-on’ string of digits in short term memory , I also have my own Major system (only about 100 items, assigned for every 2 digit number 00-99). I actually used this system in order to memorize and break my country’s national pi memory record.

I have also used this system occasionally in the Calculation World Cup, in some surprise tasks.
Example 3 x 3 x 3 digits, such 987 x 654 x 321 , I do the two first, and then convert this partial 6 digit result into 3 items or just 1 PAO (Person/Action/Object). Then I proceed to multiple this 6 digit by the final 3 digits, usually by criss-cross.

And because we are not allowed to write any intermediate result, then my only point of reference for the criss-cross multiplication is just this 1 PAO that I have in short-term memory. So, 1 or 2 PAO is cool to have for lengthy "carry-on’ digits. Βut most of the times, the carry-on digits are just 1 or 2 digits, so any PAO or item conversion is not really needed.

Also, in remembering logarithms to 5 digit accuracy, such kind of memory is often very helpful. Of course 100 items, is very small compared to Ben or other card systems who go up to 5000 or 10 thousand numbers (0000-9999). But my own Major system is only supplementary, because I am mainly a calculator and not a guy who goes into memory competitions. ( WMC , IAM etc).

I come from a math background, so pure calculation is more fun to me, than creating lengthy memory palaces and long stories. Maybe , I don’t have such extreme interpersonal imagination. I am more fascinated by pure numbers and not by objects or stories. Numbers are universal truth. Stories are just some person’s local special imagination.

But like some overlapping happens between Math and Mental Calculation, I believe similar overlapping happens also between Memory and Mental Calculation.

For example, when one wants to practice Binary digits,
and groups by 6 digit strings, then some mental calculation can easily convert a binary string like 1011001 into 2^6 + 2^4 + 2^3 + 2^0 = 64 + 16 + 8 + 1 = 89 and then remember the association with 89. (because the exponents correspond to the 7th, 5th, 4th, and 1st digit respectively)

Of course, most memory people do not convert live, binaries into decimals, but with a few mental calculation of exponents, this could be a possibility.

Example, assign 7 digit strings with item/person/objects from 000 to 127,
(7-bit) or 8 digit strings from 000 to 255, (8-bit) , or 9 digit strings from 000 to 511 (9-bit) or possibly 10-digit string from 000 to 1023. (10-bit)

Daniel is also a mathematician and mental calculator who has competed in memorizing Binary Digits during the Las Vegas Memoriad 2016, and maybe he can elaborate further on this topic.

I am sure the people who win the Binary Digits memory contest, already have such categorizations for all the binary possibilities up to a certain string length, but everyone has a different style of doing this.

Nodas

3 Likes