Skip to content

Commit 442a170

Browse files
authored
Computus revisions (#806)
* adding small changes to chapter before video * adding video to chapter
1 parent 1aa0dc9 commit 442a170

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

contents/computus/computus.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22

33
Though the word *Computus* can technically describe any sort of computation {{ "bede725" | cite }} or else a set of medieval tables for calculating various astrological events {{ "dictcomputus" | cite }}, it is also one of the most common historical names for the calculation of the Christian holiday of Easter every year.
44
Nominally, Easter happens the Sunday after the first full moon after the spring equinox (roughly March 21st).
5-
This particular full moon is known by a number of names, such as the Pink (strawberry) Moon, Hunter's Moon, and the Snow Moon, along with several others.
5+
This particular full moon is known by a number of names, such as the Pink (Strawberry) Moon, Hunter's Moon, or the Snow Moon, along with several others.
66
The most common name for it is the paschal full moon, which translates to "Passover" in Greek and signifies an important Jewish festival.
77

88
For the first few centuries, the date of Easter each year was dictated by the Pope; however, after the church grew, it was no longer straightforward to communicate this date to all of Christendom.
9-
As such, the church did what they could to algorithmically generate tables for clergy to determine the date of Easter each year.
9+
As such, the church did what it could to algorithmically generate tables for clergy to determine the date of Easter each year.
1010
To this day, the calculation of Easter still poses a problem, with western and eastern (orthodox) churches celebrating on different dates approximately 50% of the time.
1111

1212
I'll be honest, there is a lot of good, Christian drama surrounding the calculation of this event and it's remarkably interesting to read about {{ "bien2004" | cite }}.
1313
Suffice it to say that the date of Easter bamboozled many historical scholars, with at least one algorithm appearing in the early archives of the now famous scientific journal of *Nature* {{ "computus1876" | cite }}.
1414
The calculation was so complicated that even Frederick Gauss had to try his hand at it (and failed before being corrected by one of his students).
1515

16-
As an important note, because Easter depends on the lunar cycle, the date of the paschal full moon is static in the lunar calendar.
16+
Essentially, the date of Easter depends on both the lunar and solar cycles
17+
The date of the paschal full moon, for example, is static in the lunar calendar, but it is not in the solar calendar.
1718
In this way, computus is the act of mapping a lunar cycle onto the Gregorian (solar) calendar everyone knows and loves.
1819
Because many different calendar systems have existed throughout history, there was a natural question as to *which* calendar system would be used to calculate the precise date of Easter.
19-
The western churches chose the Gregorian calendar and the eastern chose Julian.
20-
The Gregorian calendar more accurately represents the true date of the paschal full moon; however, this is one reason why western and eastern churches sometimes celebrate on different dates.
20+
The western churches chose the Gregorian calendar and the eastern churches chosethe Julian one, and this is one reason why western and eastern churches sometimes celebrate on different dates.
21+
That said, the Gregorian calendar more accurately represents the true date of the paschal full moon, so the western church's approach ended up being more precise.
2122

22-
Though there are many methods to calculate Easter, for now, we will focus only on Gauss's algorithm; however, we will certainly come back (in subsequent years) to incorporate other Easter algorithms.
23+
Though there are many methods to calculate Easter, for now, we will focus only on Gauss's algorithm; however, we mayl certainly come back (in subsequent years) to incorporate other Easter algorithms if there is demand.
2324
These algorithms are some of my favorite gems in the history of algorithm design because of all the drama surrounding the calculation of something that seems trivial!
2425
After all, how hard could it be to calculate Easter?
2526

@@ -32,7 +33,7 @@ The legend goes that Gauss actually did not know his real birthday in the Gregor
3233
Apparently, his mother only told him that he was born on a Wednesday 8 days before Ascension Day in 1777, which corresponds to April 30th {{ "bien2004" | cite }}.
3334

3435
Honestly, Gauss's Easter algorithm was the 19th century equivalent of undocumented code.
35-
I could imagine Gauss grumpily "patching" his method when users complained that it did not work on dates past 4200 or certain dates within his own era.
36+
I could imagine Gauss grumpily "patching" his method when users complained that it did not work on dates past 4200 or even certain dates within his own era!
3637
When some of his compatriots (such as Johann Lambert and Jean Joseph Delambre) expressed their concern over the method's performance, Gauss replied by saying,
3738

3839
> The investigation by which the formula [...] is found is based on higher arithmetic, for which I presumably cannot refer to any publication.
@@ -45,7 +46,7 @@ One of the most important fans of Gauss's work was Servois, who created a calend
4546
<img class="center" src="res/servois_1800.png" alt="Servois' 1800 table" style="width:80%">
4647

4748
This calendar shows the date the paschal full moon, indicating that Easter will be the following Sunday {{ "servois" | cite }}.
48-
In this table, a value greater than 22 indicates the full moon will be on the presented number in March and a value less than 22 indicates the full moon will be on that date in April.
49+
In this table, a value greater than 22 indicates the full moon will be on the presented number (date) in March and a value less than 22 indicates the full moon will be on that date in April.
4950
The $$y$$-axis of this table indicates the decade and the $$x$$-axis indicates the precise year.
5051
Admittedly, the notation is a bit funky, but it was 1813.
5152
Times were different then.
@@ -59,14 +60,15 @@ For this reason, before discussing the algorithm, itself, we must first introduc
5960
The Gregorian (solar) calendar has been created to mark Earth's full revolution around the Sun, which is approximately 365.2425 days.
6061
Unfortunately, days are based on the Earth's rotation about its axis, not its revolution around the Sun, so the number of days in a year is not an integer number (such as 365).
6162
This discrepancy has actually lead to a large number of calendar systems, including one invented by Gauss, himself {{ "standish2004" | cite }}.
62-
Before the Gregorian calendar, there was a correction was made from the old Roman calendar to be 365.25 days, creating the Julian calendar.
63+
Before the Gregorian calendar, there was another correction made from an old Roman calendar to set the days in a year to be 365.25 days.
64+
This was called the Julian calendar.
6365
From there, the Julian calendar was further corrected to the Gregorian calendar with 365.2425 days.
64-
Though there is a small change necessary to use Gauss's Easter algorithm for the Julian calendar, this will not be covered here; however, if you want to see this, we can add it in upon request.
66+
Though there is only a small change necessary to use Gauss's Easter algorithm for the Julian calendar, this will not be covered here; however, if you want to see this, we can add it in upon request.
6567

6668
To account for the non-integer nature of the Gregorian year, a leap day is celebrated on February 29th every 4 years, with exception of when the year is a multiple of 100, where no leap-day is observed; if the year is divisible by 400, however, a leap day is still observed.
6769
This means that every 400 years, there are 97 leap days.
68-
This is why a leap day was celebrated in 2020 and 2000, but was not celebrated in 1900.
69-
If at this point, you feel like the calendar system you know and love is held together by duct tape and string, you would be right.
70+
This is why a leap day was celebrated in 2020 and 2000, but was not in 1900.
71+
If at this point, you feel like your favorite calendar system is held together by duct tape and string, you would be right.
7072

7173
In addition to the solar year, Gauss's Easter algorithm also needs to keep the lunar year into account.
7274
A lunar month corresponds to the time it takes the Moon to complete one full revolution around the Earth.
@@ -82,26 +84,36 @@ Below, we also show a snapshot of this simulation after 6 synodic months:
8284
<img class="center" src="res/synodic_half_year.png" alt="Synodic half year" style="width:90%">
8385

8486
Here, we show an outline of the Earth and Moon in an arbitrary initial position, each with an angle of $$-\frac{\pi}{4}$$ from the horizontal axis.
85-
In addition, we show the location of the Moon and Earth again after 6 synodic months.
86-
In both positions, the Moon is hidden behind the Earth, creating a full moon phase.
87+
In addition, we show the location of the Moon and Earth again after 6 synodic months and additional outlines for each intermediate synodic month.
88+
Red lines are drawn from the center of the sun to the moon to indicate the positioning of the moon in relation to the sun and earth.
89+
In all positions, the Moon is hidden behind the Earth, creating the full moon phase.
8790
In this way, the synodic month is the time between two consecutive phases, which is slightly longer than the time it takes to revolve around the Earth and return to the same angle (here $$\frac{\pi}{4}$$).
8891
Each synodic month is approximately 29.5 days, so a synodic year of 12 lunar months is 354 days, which is 11 days shorter than the normal 365 days in a Gregorian year.
8992
The following is a pictorial representation of offset between a solar and lunar year:
9093

9194
<img class="center" src="res/orbit.png" alt="Full year" style="width:90%">
9295

9396
Here, we see the Sun at the center, with the Earth and Moon starting the year at an angle of $$-\frac{\pi}{4}$$ from the horizontal axis.
94-
The initial location of the Earth and Moon are initially shown as an outline with an A at their center.
97+
The initial location of the Earth and Moon are shown as an outline with the letter "A" at their center.
9598
After a full synodic lunar year (12 lunar months), another outline of the Earth and Moon are shown at position B, and after a full Gregorian year, they are shown in position C.
9699
An arc is then drawn showing the difference of 11 days between the Earth's position after a synodic year, and another arc is drawn to show the difference between the Moon's position after a full Gregorian year.
97100

98101
Because the synodic month and the solar year are not synchronized, the phase of the Moon will be different on the same day of the Gregorian year.
99102
That said, the lunar and solar calendars will re-synchronize roughly every 19 years.
100-
For example, if there is a new moon on January 1st, 2020, there will not be a new moon on January 1st, 2021; however, there will be a new moon on January 1st, 2039.
103+
For example, if there is a new moon on January 1st, 2020, there will not be a new moon on January 1st, 2021; however, there *will* be a new moon on January 1st, 2039.
101104
This 19-year cycle where the Moon and Sun are waiting to re-synchronize is known as the Metonic cycle and has been studied for centuries.
102105

103-
As a final note, there is a small offset in the Metonic cycle of 1 hour and 45 minutes every 19 years, so in 2500 years, it will be 8 days off.
104-
With this in mind, we should be able to start discussing the algorithm, itself.
106+
This cycle allows us to somewhat easily transition between solar and lunar calendars.
107+
If we imagine any Gregorian date (let's say January 1st again for clarity), the moon could be in one of 19 different phases, as shown below:
108+
109+
<img class="center" src="res/metonic.png" alt="Metonic cycle" style="width:90%">
110+
111+
Here, we show each possible phase of the moon as an outline, but the actual phase as a grey circle.
112+
Essentially, by knowing what year we are on in the Metonic cycle, we can single out which phase of the moon we will see on any given date.
113+
This is powerful and will allow us to find the next full moon by looking ahead a few days.
114+
115+
As a final note, there is a small offset in the Metonic cycle of 1 hour and 45 minutes every 19 years, so in 2500 years, it will be 8 days off, but that's a problem for people in 2500.
116+
For now, we should be able to start discussing the algorithm, itself.
105117

106118
## The algorithm
107119

@@ -130,7 +142,7 @@ From here, we also need to calculate an offset to $$a$$, and for this we need th
130142
$$
131143
k = \left\lfloor\frac{\text{year}}{100}\right\rfloor,
132144
$$
133-
where $$\lfloor\cdot\rfloor$$ is a flooring operation of rounding the value down to the nearest integer.
145+
where $$\lfloor\cdot\rfloor$$ is the flooring operation of rounding the value down to the nearest integer.
134146
With this, we can calculate the shift in the Metonic cycle to be,
135147

136148
$$
@@ -197,9 +209,10 @@ For this computation, we do similar operations, but for the weekly calendar of 7
197209
The first step is calculating the correct offset each century based on the fact that Jan 1st, in year 1 was a Friday and then accounting for all the non-observed leap days ($$k-q$$),
198210

199211
$$
200-
N = (4+k-q)~\%~7
212+
N = (4+k-q)~\%~7.
201213
$$
202214

215+
From here, things get a little tricky.
203216
There are 52 weeks in a year, but $$52\times7=364$$, meaning we are essentially one day off every year, with exception of leap years where we are two days off.
204217
As an example, look at the following table
205218

@@ -247,7 +260,7 @@ $$
247260
$$
248261

249262
Remember that March 22nd would be the first possible day to celebrate Easter because March 21st would be the first possible full moon of spring.
250-
All said, there are a few exceptions that are somewhat tricky to understand.
263+
All said, there are a few exceptions that are somewhat tricky to understand, namely:
251264

252265
$$
253266
e = \left\{
@@ -273,6 +286,14 @@ The sheer complexity of this calculation both baffles and astounds me -- especia
273286

274287
Sure, this can be done straightforwardly with a calculator, but it is no doubt an algorithm worth discussing and celebrating for its ingenuity at the time of creation.
275288

289+
## Video Explanation
290+
291+
Here is a video describing key elements of Gauss's Easter Algorithm:
292+
293+
<div style="text-align:center">
294+
<iframe width="560" height="315" src="https://www.youtube.com/embed/x6Yud882QKE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
295+
</div>
296+
276297
## Example Code
277298
Unlike many other chapters in the Algorithm Archive, this particular method can be described almost entirely by mathematical expressions.
278299
As such, it should be relatively straightforward to implement in a number of different languages, and I heartily encourage you to do so!
@@ -326,5 +347,6 @@ The text of this chapter was written by [James Schloss](https://github.com/leios
326347
- The image "[Servois 1800 Colored Table](res/servois_1800.png)" was created by [James Schloss](https://github.com/leios) and is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
327348
- The image "[Relative Orbits](res/orbit.svg)" was created by [Xadisten](https://github.com/lockcmpxchg8beax) and was provided during a discussion on Twitch. It is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode).
328349
- The image "[Synodic Half Year](res/synodic_half_year.png)" was created by [James Schloss](https://github.com/leios) and is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
350+
- The image "[Metonic shadows](res/metonic.png)" was created by [James Schloss](https://github.com/leios) and is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
329351
- The image "[Full Year Orbit](res/orbit.png)" was created by [James Schloss](https://github.com/leios) and is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).
330352
- The image "[Servois 2000 Colored Table](res/servois_2000.png)" was created by [James Schloss](https://github.com/leios) and is licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/legalcode).

contents/computus/res/metonic.png

105 KB
Loading
143 KB
Loading

0 commit comments

Comments
 (0)