Re:Calculate the day of the week for any date in your head
by rovr138 on Wednesday January 01, 2020 @11:51AM
(#21928886)
Got tricked during a CS course with this. I bet a lot of the people in that class will remember the full rule. It then came back on the final.
[ Parent
| on HN ]
Re:Calculate the day of the week for any date in your head
by bumbledraven on Wednesday January 01, 2020 @11:58AM
(#21928928)
What do you mean, “tricked”? The method is original to me and I don’t think it has spread very far. Is there a Gregorian calendar year for which the GP algorithm gives the wrong result?
Re:Calculate the day of the week for any date in your head
by htfu on Wednesday January 01, 2020 @12:07PM
(#21928991)
The two methods are exactly - exactly - the same. Just different ways of phrasing.
Don't fool yourself.
Re:Calculate the day of the week for any date in your head
by firethief on Thursday January 02, 2020 @11:57AM
(#21937053)
It's algebraically equivalent, but it's not the same procedure. The insight in Bumbledraven's Algorithm is that by factoring out an unconditionally-performed mod-4 step, the problem can be reduced to two cases.
Re:Calculate the day of the week for any date in your head
by bumbledraven on Wednesday January 01, 2020 @12:16PM
(#21929034)
The standard method and mine give the same result, and I believe that mine is simpler to carry out in your head.
In what way do you believe that I am fooling myself?
Re:Calculate the day of the week for any date in your head
by stinos on Wednesday January 01, 2020 @12:33PM
(#21929147)
Not so much as fooling yourself, but I agree with the OP your method isnt really 'original' in the sense that it's indeed exactly the same as the 'standard' one, just a tad different in how you explain the math. E.g. 'if not ending in 00 throw away...' is really just the same thing as 'except when divisable by 100'.
Re:Calculate the day of the week for any date in your head
by jolmg on Wednesday January 01, 2020 @12:53PM
(#21929312)
To add to your comment, being divisable by 400 is also the same thing as throwing away the 00 and checking the remaining is divisable by 4. One explanation is just a rephrasing of the other for the exact same method.