jack: (Default)
[personal profile] jack
Leap things

OK, so that's the history. Let's see if I actually understand the Hewbrew calendar.

As I understand it, the Gregorian calendar is defined to use an average year length of 365.2425, or 365*400+97 days in every 400 years. That is, even if you're not quite certain of the distribution of leap years, if the Gregorian calendar were to be used forever, if you knew a date was 1000000000000 days in the future, you could predict the year simply with that value, and always be right. (Maybe a day off if you didn't know which year the leap years came in).

The actual distribution of those days is semi-arbitrarily chosen. There's two major approaches to that. You normally want the changes to be roughly equally spaced so the intermediate years don't drift too far, and you don't get a sudden 97 days you're not sure what to do with at the end of the 400 year cycle.

The way we actually choose is to chose the best short-term approximation (every four years), and then make sure further exceptions are subsets of those exceptions. This has the advanctage that you can see at a glance if you need to worry about it at all -- if the year is not a multiple of four, it's DEFINITELY not a leap year, and if it's a multiple of 4 and not a multiple of 100, it definitely IS, for even if someone adds a future, extra correction, it must happen at some multiple of all of 4, 100, 400, etc.

It has the disadvantage that the cycle is 400 years long. Mark Dominus points out that a much shorter cycle could do just fine. If you're happy to say that leap years are every four years, but that if instead of sometimes postponing a leap year to the next multiple of 4, you postpone it by only one or two years, and then resume the cycle four years following that, you can get a cycle which works perfectly in only 33 years instead of 400, at the expense of always needing to divide the year N by 33 to work out if it's a leap year.

On the other hand, if you've committed yourself to some calculation anyway, and are willing to use simple fractions, you can make it a really simple calculation. If you define January 1st to be every 365.2524 years, whatever day that occurs on, then your years are guaranteed to have the correct average. Your year is 365 days long, except roughly every four years when new year changes from late night on Dec 31st to early morning on January 1st, requiring an extra day in the previous year. The year is always 365 or 366 days long, and these are automatically as equally spaced as possible.

0.2524 is a rational number, so every 400 years the new year is exactly midnight Jan 1st again, and the same sequence of leap years will repeat. Although I won't bother working out exactly what sequence is, other than that it's something 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4, 4, 5, etc.

This sounds more confusing to people used to treating leap years as fundamental concepts, but is very natural if you treat "start of year" as an atomic concept.

Dominus' calendar is the same except that his rational approximation to year length is 365 8/33, which is a much simpler one (except for decimal or binary based minds). This version would have the sequence 4 4 4 4 4 4 4 5, which then repeats.

Jewish Calendar

The Jewish calendar is defined in these terms. The length of a month is defined to be 29 and 13753 / 25920 days. (That's defined in terms of hours, minutes, and an old unit of eighteenths of minutes.) That's an exceptionally close approximation, although the pattern of leap years it causes will not repeat exactly for thousands of years (even excluding the subsiduary fiddles below), by which time the system will have to change anyway.

This cycle defines a notional "start of month" called a molad, which corresponds to the new moon. (But is defined in terms of the average length 29 and 13753 / 25920 days, even though the lunar cycle varies a bit.) These are fixed and predictable, and will be easily calculatable for thousands of years (or forever). The start of the month is always approximately near the molad. However, calculating the actual date from the molad is a little bit involved:

(1) The 1st of the month isn't defined in terms of the molad for this month. Each of the twelve or thirteen months in the year has a fixed length (apart from a point in winter where leap days are added or removed), and only the 1st of the first month is defined to be that day on which the molad falls.

(2) In fact, the 1st of the first month (1st Tishrei, aka Rosh Hashanah aka New Year) is the day when the molad falls between noon of the previous day and noon of today. The idea being that this is approximately the day when the new moon might be visible that night. (It's not exact because if the new moon is 11am, it wasn't any more visible last night than it would be if it were 1pm.)

(3) In fact, the day is considered to start at sunset, or at 6pm, or sometimes midnight, depending. But this makes no difference as long as you're consistent. The day is defined in terms of when the molad appears relative to noon.

(4) To work out which month Tishrei is, you have to know how many months in the year. Then you know which molad the next year starts from, although you may have to pad the year by a day. A year is defined to be 12 7/19 months, however the months fall out. That follows a pattern of years of 13 months every two or three years, otherwise 12, which repeats on a simple 19-year cycle.

(5) OK, now we have short years which should average 354.3xx days, and so the number of days between Tishreis will be either 354 or 355 days, and long years similarly (but longer). We do this by padding a month in winter when there aren't any important festivals to make the year either 354 or 355, whichever is exactly the distance between two 1st Tishreis, as defined by the corresponding molad.

(6) Perfect! However, now let's get overconfident. As it stands, any anniversary can happen on any day of the week. Instead, lets fiddle our system so the year always starts on Monday. OK, that's way overconfident, because we'd have to have both short and long years a multiple of 7, and add in seven days padding when the 1st Tishrei drifted a whole week away from the new moon. OK, how about monday, tuesday, thursday or saturday?[1]

(7) To arrange this, we simply postpone the 1st Tishrei by a day. Because the forbidden days of the week are non-adjacent, this always makes it ok. So sometimes it occurs on the day with the molad, and sometimes the following day. If we happen to postponse two (or more) adjacent Tishreis, the year in the middle is the same length. Otherwise the previous year is one day longer and the following year one day shorter. Assuming the previous year had 354 (or 384) days and the following year has 355 (or 385) days, we can simply pad the previous year with an extra day in the same way we did before when the molads were 355 (or 385) days apart, and unpad the following year. If the following year was 354 (or 384) days long already, we'll have a day we can take OUT. As long as the previous year wasn't already 355 (or 385) days long, everything'll be jake.

(8) Oh fuck. OK, ok, if the previous year was ALREADY 355 (or 385) days long, instead of trying to double-pad it, we'll pad the year BEFORE that AS WELL. (Either by adding an extra day, or putting back in a day we removed if that year were shorted by postponing it.) They can't BOTH be long-molad years, because those occur every two or three years. And we know that postponing the previous year can't make it start on an invalid day (see below).

(9) We hadn't postponed the previous year already, so it must start on mon, tue, thu or sat, and we are postponing this year so this year must start on wed, fri or sun, and the previous year was 355==5 mod 7 or 385==0 mod 7 days long. The only possibility is tue->sun. Thus the year before THAT must have started on xxxx or xxxxx, so must be an xxxxx year, and if we postpone previous year by two days to thu by padding the one before, then the current year will be successfully postponed without making the previous year too long. Oh, who am I kidding. This is where I've lost it, and I haven't even considered the corresponding case of avoiding under-padding a too-short leap-year. Now see what you've done. All over the internet people are saying "I don't understand" and "Yay, mysticism" and "No! Passover is one day wrong, we must run around in little circles waving our hands in the air."

Is that about right?

[1] Why those? Because Yom Kippur happens shortly afterwards, and (supposedly[2]) shouldn't be ADJACENT to a Saturday (because Saturday is shabbat and you don't want the prohibitions of shabbat directly abbutting those of yom kippur). And the festival of knocking things over occurs shortly after that, and shouldn't be ON a shabbat (because you can't knock things over on a shabbat). Fortunately, these dates are a fixed number of days away from each other, and away from 1st Tishrei, so both of these commitments can be honoured at once.

[2] Apparently people aren't completely sure why this fiddle exists.

Date: 2009-01-16 06:08 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yeah, I know what you mean. (Both the instinct, and the redaction :))

Although now it occurs to me to observe that all the over-corrections in the Jewish calendar are local -- if you don't know them, you'll be off by a day or two for next year, but off by the same day or two for a year 1000000 in the future. Of course, the same applies to the Gregorian/Julian calendar, if you don't know when year 0 was, you'll still know the 400 year sequence, and be at most a day off if you stick to it, even if you're wrong in the middle.

For the first, you need to know the time of the molad; for the second the ordinal number of the year. The first does bear the slight advantage that if you suddenly lose all your records you can resynchronise it to the astronomy :)