Talk:Calculating the day of the week
From Wikipedia, the free encyclopedia
Contents |
[edit] Errors
Khennacy changed Alaska's previous owner from Russia to Canada as part of other changes. The sentence is awkward (Russia switched when Alaska was bought by the US from Russia) so I left it alone.
Comment: Whoever entered this statement is falsely reporting the change.
[edit] Algorithms
I don't agree with the pages claims concerning all algorithms. They could always be an algorithm that is a counterexample.
I don't this the paragraph heading The Algorithm. There are other algorithms.
I'd like the page to be about various algorithms and perhaps have a sepate page for each algorithm that is described in detail.
Other algorithms include the Doomsday algorithm which take avantage of the fact that 4 April, 6 June, 8 August, 10 October and 12 December are all the same day of week in a given year.
Also the article may be in violation of copyright. See [[1]], but actually appears to be quite different.
User:Karl Palmen 29 April 2004
- Hi, Karl, I'm the one who mentioned the copyright issue. This actually applied to just a section that was added by a user sometimes known as Hosamsherif who just copied that text from that page. It appears he has now readded that section, but rephrased it enough not to be a copyvio.
- If we add another algorithm, this page could get quite large. Maybe it should just discuss the general idea, and link to a few different algorithms? Kevin Saff 14:50, 29 Apr 2004 (UTC)
Kevin Saff said that if we add another algorithm, this page could get quite large. That is why I suggested putting detailed algorithms on separate pages. The page itself could talk about various ways in which the day of the week is or has been worked out without having to show all the details there.
To be comprehensive and encyclopeadic, it should mention all reasonably well known algorithms.
User:Karl Palmen 30 April 2004
[edit] Lazy alternatives using Wikipedia itself
Now that some brilliant programmers at Wikipedia have done lots of legwork - er - fingerwork, most dates that most people could really want to check up on can be checked with a 4-digit search for the year then (if the calendar isn't displayed) a click on the link that goes to the calendar.
And now we have the marvellous new system of showing month calendars whenever we want to with a deceptively simple set of templates. I'm translating them into Maori, starting with mi:2005. Gets easier as you go on, for at least two reasons, one being that you find shortcuts if your lateral thinking is up to scratch. Talk to me if you want to do it for your language and can't find a guide anywhere. But if anyone has seen such a guide, please point me to it! Where's the best place to create such a guide if we don't have one? Robin Patterson 01:30, 6 Jun 2005 (UTC)
[edit] Centuries error?
The method of calculation in the "Centuries" heading is wrong. You can't obtain correct values using that method. —Preceding unsigned comment added by 129.97.233.144 (talk • contribs)
- It is correct: In the article you stated that you could not obtain 6 from 20xx using the Centuries method. 20/4 yields a quotient of 5 and a remainder of 0. 3−0=3, 3×2=6. QED. You have probably confused the quotient with the remainder. — Joe Kress 04:39, 5 October 2006 (UTC)
-
- The wording was confusing - I made the same mistake. I've reworded it. --... and m@ (talk) 01:14, 31 January 2008 (UTC)
-
-
- I've rewritten the section explaining the algorithm. The part calculating the months was inconsistent with the examples below it, so I deleted that explanation. For the year and month, I've put mathematical equations in, because they are easier to read than an English sentence. I've removed examples in the instructions, the examples which already are included below are sufficient. I personally would refactor this section so that the explanation of the algorithm is separate from the definition, but I think I've modified the article enough for now. --... and m@ (talk) 02:11, 31 January 2008 (UTC)
-
[edit] Another one
I got this one out of a maths book: ![x = (date + (year - [\frac{14 - month}{12}]) + [\frac{31 \times (month + 12[\frac{14 - month}{12}]}{12}] + [\frac{year - \frac {14 - month}{12}]}{4}] -](../../../../math/5/a/6/5a6526319b23610e961322580a5237c9.png)
![[\frac{year - \frac {14 - month}{12}]}{100}] + [\frac{year - \frac {14 - month}{12}]}{400}])\operatorname{mod} 7](../../../../math/d/0/8/d082796d9305434da45ef9b50ed2e34b.png)
Then convert x to day:
| x= | day |
|---|---|
| 0 | Sunday |
| 1 | Monday |
| 2 | Tuesday |
| 3 | Wednesday |
| 4 | Thursday |
| 5 | Friday |
| 6 | Saturday |
Obviously the formula is a bit big and scary, but you can get rid of a lot of it by doing the algorithm in five steps.
![f = [\frac{14 - month}{12}]](../../../../math/7/b/9/7b964191e1b95b500c3bc337af2558df.png)
- y = year − f
- m = month + 12f − 2
- Then put into new formula:
![(date + y + [\frac{31m}{12}] + [\frac{y}{4}]-[\frac{y}{100}]+[\frac{y}{400}])\operatorname{mod}7](../../../../math/6/e/8/6e8172b09a8680fc83444e8ef12f03c9.png)
- Convert (see table)
Jake95(talk!) 16:00, 20 January 2007 (UTC)
[edit] Extending the century table
Could someone extend the century table backwards to 1000 ? —Preceding unsigned comment added by 74.230.150.150 (talk) 19:58, 9 September 2007 (UTC)
- If you didn't notice, there's a pattern for centuries. You could fill it in yourself. Reywas92Talk 20:04, 9 September 2007 (UTC)
- I noticed, but before 1700 the pattern is different (due to calendar changes). I added in the new values from 1000 to 1600, however years between 1699 and 1752 are going to produce incorrect results. Someone else should check this. —Preceding unsigned comment added by 74.230.150.150 (talk) 20:24, 9 September 2007 (UTC)
- If you use 1 for 1700-1752, and 4 for 1753-1799 then everything seems to be okay. I'd appreciate it if someone else would check on this. —Preceding unsigned comment added by 74.230.150.150 (talk) 02:38, 10 September 2007 (UTC)

