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 04:11 pm (UTC)
From: [identity profile] hatam-soferet.livejournal.com
Is that about right?

You now know a good deal more about it than I do.

Date: 2009-01-16 05:17 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
:) *hugs* Thanks.

(In fact, it doesn't really help me calculate dates, because I'd still have to look up how long Kislev and Tevet are anyway, but I'm glad I (mostly) understand...)

Date: 2009-01-16 05:49 pm (UTC)
From: [identity profile] hatam-soferet.livejournal.com
Here's how most of us see it:
Months go by the moon. More or less. Every few years we have an extra month before Pesach so that Pesach and Spring coincide. To know what the hell's going on, you look at an ecclesiastical calendar, otherwise known as a luach. There is one of these at kaluach.net.

Date: 2009-01-20 12:01 pm (UTC)

Date: 2009-01-16 04:19 pm (UTC)
From: [identity profile] naath.livejournal.com
WAH! ETOOCOMPLICATED.

See, this is why we have this 4 years thing. Because *dividing by four* is real easy.

The easiest way to cause every date to be always the same day is to (as described in Tolkien) make one day per year (or two in leap years) a day without a day-name; thus causing the year to have 364 days that have day-names, 364 divides exactly by 7. Of course that doesn't work with Shabbat because that is presumably meant to be *every 7th day* rather than *every Saturday*.

Date: 2009-01-16 04:22 pm (UTC)
From: [identity profile] hatam-soferet.livejournal.com
Yeah...when you have divinely-mandated weekdays (or postmodern atheist equivalent) you can't go messing about changing them.

Date: 2009-01-16 04:26 pm (UTC)
From: [identity profile] naath.livejournal.com
I think the postmodern atheists would be happy with a non-day-name day *so long as* it were a weekend-day/public-holiday :-)

Date: 2009-01-16 04:32 pm (UTC)
From: [identity profile] hatam-soferet.livejournal.com
Of course.

But seriously, the postmodern atheist might not dick with the days of the week either, recognising that having predictable weeks is something that's pretty fundamental to us, and dicking with weekdays is a terribly powerful thing to do, witness politics over official calendar changes in history. Messing with months or seconds isn't as challenging to the people we are. Speaking as a postmodern atheist who likes her holidays. :)

Date: 2009-01-16 05:15 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yeah. It _ought) to work just fine (most things can be postponed a day, anything which actually has to happen every 7 days ought to have its own clock anyway), but as it stands the days of the week are the only thing which is infinitely predictable, so I'd probably rather make the leap-year system more complicated (since you need to check special-cases on that anyway) than change the days of the week.

Even though I like the extra-day idea in principle. (And if we're long-term trying to transition to people-working-fewer-days-economy, there are worse ways than by adding extra days :))

Date: 2009-01-16 04:37 pm (UTC)
andrewducker: (Default)
From: [personal profile] andrewducker
The reason to go for the 4/100 rule is that 99% of the times you get to February 28th you only have to divide by 4. Once in your life you also have to divide by 100 - and this will be well publicised.

Division by 33 is (a) harder and (b) has to be done multiple times during your life at intervals that don't match up with anything else.

Date: 2009-01-16 05:12 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Indeed. At first I was puzzled; only as I was writing it did I work out the pros and cons of each.

(Of course the Jewish calendar I was looking at had extra corrections for the day of the week and to keep it in line with the moon, so you probably need pencil and paper to work out which years have extra days ANYWAY, so they might as well be spaced the rational-approximation way.)

Date: 2009-01-16 04:51 pm (UTC)
ext_8103: (Default)
From: [identity profile] ewx.livejournal.com
A modest proposal for calendar reform (http://www.chiark.greenend.org.uk/~damerell/birthdaycal.html).

Date: 2009-01-16 05:04 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
LOL. Wow :) But *headache* I don't get it. I expected all those names to be leading up to a horrendous pun at the end, but it didn't seem to :)

Date: 2009-01-16 05:27 pm (UTC)
darcydodo: (Default)
From: [personal profile] darcydodo
The names themselves are the pun, I presume (although I would have used Pothos rather than Epithumia), leading up to Gaiman.

Not sure about the cheese days.

Date: 2009-01-16 05:27 pm (UTC)
simont: A picture of me in 2016 (Default)
From: [personal profile] simont
This is the sort of description which makes me prone to allergic overreactions along the lines of "Good grief, this is all hopelessly doomed to endless refinements and fiddling and complexity, let's move to a really simple metric calendar which has no necessary connection to either the moon or the seasons, and thereby localise the pain of tracking either of the latter into some sort of specialist subcalendar that only people who care about those things have to bother with".

Trouble is, then I start to feel that as long as we're doing that, self-consistency also demands that we organise the length of the day without regard for synchronisation with the day and night cycle, and that's a step too far :-)

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 :)

Date: 2009-01-16 05:53 pm (UTC)
ext_29671: (Default)
From: [identity profile] ravingglory.livejournal.com
It makes sense to me not to have two days in row when you can't cook anythting. (even if you fast on one those days -- you still have to eat after the fast)

Date: 2009-01-20 12:05 pm (UTC)
From: [identity profile] cartesiandaemon.livejournal.com
Yeah, that was the most coherent explanation I saw, but some people seemed to think it was an explanation worked out after the fact, or something.