by ColinWright · 2y ago · 0 comments
JH Conway used a different technique[1] which I have swutch to when computing days in the current year. It's quicker and easier, but I find that it's harder to compute "The Doomsday" for other years (it's Thursday this year), so I revert to my standard method[2].
Example: Today is 2024/05/24
Years since 2012 is 12
Leap years is 12/4 = 3
Magic month number = 2
Date is 24
Add mod 7 is (12+3+2+24) = (-2)+3+2+3 = 6 = Friday
[0] A "magic number" for each month. There are mnemonics, and they can be computed from first principles if needed. It's also easy to remember a few and then compute the others. 144 : Jan, Feb, Mar
025 : Apr, May, Jun
036 : Jul, Aug, Sep
146 : Oct, Nov, Dec
[1] https://en.wikipedia.org/wiki/Doomsday_rule[2] All values computed mod 7. Take years since 1900. Add number of leap years since 1900 (so (YYYY-1900)/4 rounded down). Add the magic number for the month. Add the day of the month. Then Sunday=1, Wednesday=4, etc.
Because the calendar repeats every 28 years, for more recent dates you can start with 2012 instead of 1900.
That's a past participle I've never seent before
I'm going to go with swutcheted
On the other hand, Chinese verbs are even easier. They don't even have a tense!
(i.e. past perfect, I think?)
Perfect: "to which I have swutch"
Pluperfect/past perfect: "to which I had swutch"
Compilation error at line 173.
144 : Jan, Feb, Mar
025 : Apr, May, Jun
036 : Jul, Aug, Sep
146 : Oct, Nov, Dec
You mean: Jan = 1, Feb = 4, Mar = 4, etc.I remember them in this table because they are squares (except for December), as well as "highlights" ... May=2 and August=3 are two that I have "to hand".
Years since 2012 is 20
Leap years is 20/4 = 5
Magic month number = 4
Date is 7
(20 + 5 + 4 + 7) % 7 = 1
So I was expecting Sunday, but the answer is Saturday. After some thought I realised: 2032 is a leap year and the chosen date is before February 29th. In those cases (on or before that day), it is necessary to subtract 1.> Leap years is 20/4 = 5
... but because you are in February you have not yet had that leap year, so it's only 4, and then the sums work.
> 144 : Jan, Feb, Mar
025 : Apr, May, Jun
036 : Jul, Aug, Sep
146 : Oct, Nov, Dec
It can be useful to combine mnemonics and computation. Consider this sequence: 0, 1, -1, 0, 0, 1, 1, 2, 3, 3, 4, 4
It is the offset between the day of the year of the 1st of each month and the day of the year the 1st would be if the preceding months had all been 30 day months. For example if the first 11 months had all been 30 day months Christmas, December 25, would be day 30 x 11 + 25 = 355. Add the 12th item from the offset sequence, 4, to that to get the real day of the year for December 25th, which is 359.The offset sequence is fairly easy to memorize.
Once you have that sequence memorized its easy to get the month magic numbers for day of week calculations. There are a few different sets of month magic numbers in use, but for all of them:
Magic(n) = 2 n + Offset(n) + c
where Magic(n) is the magic number for month n (1 ≤ n ≤ 12), Offset(n) is the n'th item in the offset sequence, and c is a constant that depends on just what set of magic month numbers you use. For the 1 4 4 0 2 5 0 3 6 1 4 6 magic numbers c = -1.For example for month 12, December, we get 2 x 12 + 4 + -1 = 6 mod 7.
By memorizing the offset sequence and using that to get the month magic numbers you get, at the cost a small amount of calculation to get the month numbers, easy day of year and days between dates calculations.
Of course it works both ways. Given memorized month magic numbers you can compute Magic(n) - 2 n - c and that will equal Offset(n) mod 7. As long as you remember that Offset(n) is in [-1,4] and so adjust anything outside that range by adding/subtracting multiples of 7 to get into range it should be fine.
1: A calculation for the Century-Item ... divide by 4, take overplus from 3, multiply remainder by 2.
2: A calculation for the Year-Item ... Add together the number of dozens, the overplus, and the number of 4’s in the overplus.
3: A calculation for the Month-Item ... alternatively, memorise a table: the required final numbers after division by 7 are January, 0; February, 3; March, 3; April, 6; May, 1; June, 4; July, 6; August 2; September, 5; October, 0; November, 3; and December, 5.
Note that these numbers are exactly those in my table, minus 1.
4: Include the Day-Item.
Then add them all (mod 7) and convert the number to a month.
It's exactly equivalent to what I described, except the Carroll method has additional calculations for the year.
For example, what day of week was September 2, 1945?
45/4 = 11 (mod 7 = 4)
45 mod 7 = 3 (easy to work out from 7 times table)
September = 6
2
So you've got 4 + 3 (disappears under mod 7) and 6 + 2 mod 7 = 1. So, the second world war ended on a Sunday.That's a helpful encoding because it matches up with numbering that's routinely used in Portuguese, Hebrew, Greek, and by Quakers, among many others.
https://en.wikipedia.org/wiki/Names_of_the_days_of_the_week#...
These are mostly ultimately because of the Hebrew Bible account in which Sunday is the first day of creation (e.g. Genesis 1:5, 1:8, 1:13, ...).
Sunday is the day of creation in the Bible because it was the first day in the calendar being used where Genesis was written and translated, so "Day 1" became "Sunday" because to the translator "Sunday" was the first day. That calendar itself was not mathematical - the Hebrew calendar was an empirical lunisolar calendar with arbitrary intercalarion for thousands of years until it was fixed in 2CE in Judea, and it took another thousand years for this practice to become consensus, so Sunday being the day of creation is purely incidental and not a necessary intersection.
Ascribing the Bible into it is gratuitous and useless. While it might be a reason why a small proportion Christians use it, it only explains a tiny minority of its usage, not most of it. It's just explained by it being an obvious way to name days.
I'm pretty curious about this question, which I've previously asked in the form of "for how long has there been a worldwide consensus about which day of the week it is?". One answer that I heard is sort of akin to sudosysgen's account, in that some people suggested that the question might not be meaningful: there may have been different cultures with a seven-day week and, when they made sustained contact, instead of debating with each other about "which day of the week it is", they may have understood themselves to be translating their existing names for the weekdays -- some of which were based on numbers.
To the extent that that's a good way of talking about it, I also don't have a good understanding of when those translations would have happened, or who would have made them.
(E.g. 1900 is not a leap year but 2000 is)
So Jan=1, Feb=4, Mar=4
> 025 : Apr, May, Jun
So Apr=0, May=2, Jun=5
... and so on.
And we can substitute 2012 for 1900 because we make a correction in Jan and Feb in leap years. Knowing that 1900 was not a leap year means we don't make the correction, but 2012 was a leap year so we do.
> 1,4,4 : Jan, Feb, Mar.
> Even months aside from February, same date as the month, so 4/4, 6/6, 8/8, 10/10, 12/12.
> “Working 9 to 5 at 7-11”: 5/9, 7/11, 9/5, 11/7
> Jan–Mar are a bit arbitrary: Feb is the last day of the month (so 2/28 or 2/29), March is the 0th day (same), and Jan is 1/31 or 1/“32” depending on if it’s a leap year.
-- https://www.rudy.ca/doomsday.html
Likely that sprung to mind because of the "Domesday Book":
"Domesday Book (/ˈduːmzdeɪ/ DOOMZ-day; the Middle English spelling of "Doomsday Book") is a manuscript record of the Great Survey of much of England and parts of Wales completed in 1086 at the behest of King William the Conqueror."
A statement I find to be true in general.
No, you don't need to do it relentlessly as you go, but it can be used in an ad hoc manner to keep the numbers small.
Having said that, if you have 24, you can reduce it (mod 7) to 10, which you might find it easier to work with rather than reducing it to 3. Similarly if you start with 27 you can reduce it to -1 (mod 7). You don't always need to reduce things to the range [0..7).
(Note, by convention the square bracket implies "included" and the round bracket implies "excluded", so [0..7) is the collection {0,1,2,3,4,5,6}.)
That way when using the system you don't have to care about leap years except during January and February. The formulas always give February 28th as the day before March 1 which in leap years is one day too late because of February 29th, and so as you surmised you need to adjust by -1 for dates in those months.