Teaching Mathematics in Yeshivot using RMBM's Hilchot Qiddush Hachodesh

Primary tabs

Secular subjects are taught with various approaches in Jewish schools. Some take the approach that they are a necessary evil, and are taught only because they are required to do so by the civil authorities. They believe that only really worthwhile learning is that of limudei qodesh. Others take a more positive attitude toward limudei chol, considering them important at least for purposes of earning a living. Others go even further and consider all knowledge to have some intrinsic value. Scientific truth has sanctity in that it attests to the wisdom of the Creator.

Mathematics stands out somewhat from other subjects. Not only is the truth in mathematics not merely empirical but provable by reason, but there are also many areas in limudei qodesh for which an understanding of mathematics is essential. In some cases, the mathematics may even be considered part of limudei qodesh. An excellent example of this is the study of RMBM’s Hilchot Qiddush Hachodesh. There RMBM presents what is essentially a mathematical algorithm for determining the Jewish calendar.

Hilchot Qiddush Hachodesh of RMBM’s Mishneh Torah is divided into 3 distinct parts, which were almost certainly written at 3 distinct times in RMBM’s life. The first 5 chapters describe how the calendar was set during Talmudic times. It follows the rest of Misheneh Torah in relying on Talmudic sources. Chapters 6 through 10 comprise the second part and in chapters 6-8, contain the algorithm for determining the calendar in our times. It is this material that we are concerned with here. [1] The last part deals with astronomical calculations useful for determining when the new lunar crescent may be observable. This is only relevant for when the calendar is determined through observation, and has no direct bearing on the previous 5 chapters.

We will first sketch an outline of the ideas in Chapters 6-8 of RMBM. The summary we give will take advantage of our modern notation for numbers and some modern terminology. RMBM used the common gematria notation, which makes the explanation more cumbersome. We will then examine some of the mathematics that we can learn by studying RMBM.

A Summary of RMBM’s Calendar Algorithm

The modern Hebrew calendar is fixed, so that it is generated by a mathematical algorithm which is based on approximations to the lengths of orbits of celestial bodies. The Hebrew calendar is lunisolar, which means that it is based on approximations to the length of the month and the length of the year. [2] The day is divided into 25920 units, called helakim or parts. Thus there are 7 x 25920=181,440 parts in a week. A month is considered on average to have 29 days plus 13753 parts. Thus a month has on average 29 plus 13753/25920 days, or about 29.5305941 days. This is remarkably close to the modern astronomical value (29.5305888 days).

The length of the solar year is based on the assumption that nineteen years have 235 months. Multiplying the number of parts in a month by 235 gives 179,876,755 parts in 19 years, or 6939 days plus 17,875 parts. Dividing by 19, gives an estimate of 365 days plus 6397 and 12/19 parts in a year. In decimals, this is about 365.2468 days. The modern astronomical value of the mean tropical year is about 365.2422 days, so this is closer to the modern astronomical value than that of the Julian calendar estimate (365.25 days), but not as close as that of the Gregorian calendar (365.2425 days).[3]

The calendar is divided into 19-year cycles. The 235 months in each cycle are apportioned to the years so that 7 of the years have 13 months while the other 12 have 12 months. This is known as the Metonic cycle and was used in the ancient Babylonian calendar. The Jewish calendar version has the 3rd, 6th, 8th, 11th, 14th, 17th and 19th months in the cycle as the ones with 13 months.

What remains is to set the calendar for each particular year. This is done by first setting the day of week that Rosh Hashanna of each year falls on. Since we know the approximate length of the year, knowing the days of the week of 2 successive Rosh Hashannas determines the exact length of the intervening year.

The determination of the day of the week for Rosh Hashanna is done through the calculation of a number called the molad.[4] This is a number associated with every month of every year, and is defined by an inductive algorithm. An epochal molad is associated with the first month of the first year, and the molad for any subsequent month is calculated by adding the number of parts in a month to the molad of the previous month, modulo the number of parts in a week.[5] The day of week that Rosh Hashanna of a particular year falls is determined by the range of values in which the molad for Tishrei of that year falls, according to some precise rules. Generally, these rules say that the day of the week should correspond roughly to the number of days that the molad value represents. Adjustments are made so that Rosh Hashanna never falls on days 1, 4 or 6, and so that the length of year is always within certain parameters.

The actual calendar for a given year depends on the length of the year and the day of the week on which it starts. The algorithm is formulated so that there are only 3 possible lengths for a 12-month year and for a 13-month year respectively.[6] The lengths of months within the year are determined by the length of year. The final refinement of the calendar is a function of the days of week of Rosh Hashanna of 2 successive years, which determines Torah readings.

It is evident from the above description that the calendar algorithm is a purely mathematical one. The terms year, day etc, are purely notional ones, and should be thought of as numbers consisting of the number of parts which the algorithm assigns to them. To be sure, in implementing the algorithm, we use actual days. However, this involves a simple process of counting these days by observing sunrises and sunsets. Anyone who knows the current year, the position of the current day in that year and the current day of week can implement the algorithm.

Mathematics of the Calendar

Joseph Justus Scaliger was a 16th century French scholar. In his De Emendatione Temporum (1593) he writes: “Of all methods of intercalation that exist today, the Jewish calculation is the oldest, the most skillful, and the most elegant." There is indeed much interesting mathematics in the calendar that is well worth studying. Here we give an outline of some such topics.

1)Representations of numbers and their operations.

We learn about our number representation at an early age. As a consequence, we tend to identify a number with its representation. In truth, a number has an intrinsic meaning apart from its representation, and it is only comparatively recently in human history that our current way from representing it has become widely accepted.

The modern representation of numbers is a decimal (base ten) positional system. There are ten symbols:0,1,..,9 which are strung together, and their position in the string determines their value. The rightmost symbol has the value assigned to the symbol if it were standing alone. The one to the left of it has ten times this value, the next one a hundred times its value, and so on. These values are then added together to get the value of the string.

The operations of addition and multiplication on numbers are straightforward using this system. If an operation results in a number greater than ten, it is divided by 10, the symbol for the remainder , being between 1 and 9, is put in the rightmost column, and the quotient is carried over to the remaining columns. We continue this way, going column to column.

An alternative system of representing numbers is the gematria system used in many ancient societies. This is an ordinal system, where numbers are represented by the letters of the alphabet, the value of a letter being dependent on its position in the alphabet. Larger numbers are formed by stringing together smaller numbers. A disadvantage of this system is that very large numbers must be formed using very lengthy strings. The rules for operations on numbers using this system are also much more complicated.

The decimal positional system originated in India. It became known to Persian and Arab scholars in the 9th century, and it greatly facilitated their study of mathematics and astronomy. RMBM, erudite scholar that he was, surely was familiar with it and must have used it in his private computations. Nevertheless, in Mishneh Torah he uses the gematria system which his readers would be familiar with. [7]

A close examination of RMBM however reveals that he actually is using the essential ideas of positional notation, albeit in a different form. After all, he has to use numbers as large as 181,440 (the number of parts in a week). When he says that an hour consists of 1080 parts, he is really saying that he is using another unit to handle numbers greater than 1080. Similarly, the unit of a day is used to handle numbers greater than 24 hours, or 25920 parts. Thus, instead of using position to deal with large numbers, he simply gives special names to the numbers 1080 (an hour) and 25920 (a day). And instead of using a uniform base 10 system, he uses a system with mixed bases (1080, 24 and 7).

All this is explained by RMBM in 6.9. where he states:

When in doing the computations for the molad, whenever the parts add up to 1080, you discard them, and add 1 to the count of hours.

This is the analogue in our notation of carrying over values greater than ten to the next column. RMBM gives a similar algorithm for handling values greater than 24 hours.

These days, the use of the decimal position system is widely accepted. Even the purists among Jewish educators appreciate its simplicity, elegance and ease of use, despite its foreign origin. Most translations of RMBM's Hilchot Qiddush Hachodesh render his numbers using our decimal notation. It certainly makes the computations easier to follow, but is somewhat misleading, as his original readers would mostly have had to do these calculations solely within the gematria system. For someone whose goal is to study RMBM for its own sake, an interesting exercise is to try to reconstruct these calculations. It takes patience, but can be done.

At the other extreme, if one's goal is to understand the calendar as efficiently as possible, it makes sense to abandon RMBM's day-hour-part system completely and represent all values using decimal notation. Although this loses some of the significance of the role of the numbers in setting the calendar - the day of week of Rosh Hashanna is primarily determined by the day-value, but with notable modifications - it certainly makes the algorithm easier to analyze and program.[8]

2)The Euclidean Division Algorithm

The division algorithm is taught in grade school. So much attention is focused on the mechanics of carrying out the algorithm with modern number representation that the essential simplicity of the idea behind it and its justification is lost. Euclid did not use
positional representation , and the algorithm is independent of the particular representation of the numbers involved.

The algorithm says that if a and b are whole numbers, then either b divides a evenly, or b can be divided into a to produce a quotient q and remainder r, with the property that r is
smaller than b. The method for finding q and r is as follows: If b is already less than a, then q=0 and r=b. Otherwise, start subtracting multiples of b from a. The differences become smaller as the multiples increase, so eventually we must reach a point where it is less than b. This is the remainder r.

When determining the representation of a number greater than 10 in the decimal positional system, by moving multiples of ten a position to the right, one is implementing this algorithm by dividing by 10. Likewise in RMBM's algorithm, when converting
parts larger than 1080 to hours and parts, one is dividing by 1080 to get the quotient (hours) and the remainder (parts). Thus RMBM is giving a clear statement of the algorithm in the quote from 6.9 above.

3)Modular Arithmetic

At the end of 6.9, RMBM says:

When the days add up to more than 7, you discard 7 from the count and keep the rest. For we do not calculate to know the actual number of days, but to know on which day of the week, and in which hour and in which part the molad will be.

The concept that RMBM is introducing is that of congruence modulo an integer m.

If m is a positive integer, we say that 2 integers are congruent modulo m if their
difference is divisible by m, or, equivalently, if they have the same remainder when they are divided by m. For a given integer a, the set of integers congruent to it modulo a is called the congruence class of a. The set of all such congruence classes is a finite set, called the integers modulo m, and denoted Zm. Thus multiples of m are considered to be equivalent to 0 in this set. We deal with Zm when we are interested, not in the number itself, but in its remainder when divided by m.

So, RMBM says, the relevant set of values for the molad is not the integers (Z), but Z181440 .

Another instance where modular arithmetic arises in calendar calculations is in the 19-year Metonic cycle, where the relevant set is Z19 .

4) Functions

The notion of function is essential to modern mathematics. If to every value in a domain, a value is assigned in another domain, we say that we have a function from the first domain to the second. An example is the assignment of a Tishrei molad value to each year, which is a function from Z to Z181440. Another example is the assignment of day of week to a molad value. This assignment depends on the position of a year in the Metonic cycle, so is a function from Z181440 x Z19 to Z7. The composition of these two functions gives the assignment that we are really interested in, from Z to Z7. (The function from Z to Z19 is reduction modulo 19, the assignment of an integer to its congruence class modulo 19.)

5) Induction

The principle of mathematical induction says that if one has a function assigning a value to the integer 1, and a rule telling how to define a value for an integer provided that the value for the previous integer is known, that one has a function assigning a value to all positive integers.

In 6.8 RMBM states:

If you know the molad of the current year, and add to it the appropriate remainder [depending on whether it is a regular year or a leap year], you will obtain the molad of the following year. And so it is year after year until the end of time. The first molad is that of the first year of creation (2 days, 5 hours 204 parts).

Thus RMBM is giving a precise application of the principle of induction.

6)Other mathematical topics

A more detailed analysis of the calendar gives rise to several other interesting mathematical topics.

One can ask for the periodicity of the calendar, that is how often the calendar repeats itself. It turns out that the period is 19 x 181440 /d years, where d is the greatest common divisor of 181440 and 69715 (the number of parts mod 181440 in a 19-year period, which is 5. Thus the period is 689472 years. As a consequence we can consider the molad function as one from Z689472 to Z181440.

One can ask for the inverse of this function, that is, which years have a given molad. The answer uses a concept that is known as the extended Euclidean Greatest Common Divisor algorithm. It turns out that for a given molad there are either 3 or 4 values in Z689472 which take on that molad value, depending on its congruence modulo 5.

Details of these and other topics can be found in the reference in footnote 8.


The calendar plays a central part in Jewish ritual life, yet the principles behind it are generally not well understood.[9] From the point of view of Jewish studies, mathematics is essential for a thorough understanding of its calendar. RMBM’s superb understanding of the mathematics involved and his lucid exposition come through in the study. The contemporary student has the advantage of modern notation and terminology which makes the mathematics considerably more accessible than previously.

From the point of mathematics education, the calendar offers motivation for studying several important topics. The mathematics teacher often encounters skepticism from students as to the usefulness of the subject, and studying the calendar makes the mathematics come to life and gives it meaning. There is a natural symbiosis between the two subjects, and serious thought should be given to find a way to integrate them.

[1] A description of the Jewish calendar was by the Muslim scholar al-Birundi in the early 10th century. An earlier work by Saadia Gaon exists only in fragments. The mathematician R. Abraham b. Hiyya (also known as Savasorda), in his Sefer Ha’Ibbur, described the calendar about 50 years before RMBM. His work closely resembles that of RMBM, who may have used him as his source.

[2] The lengths are of necessity approximations, since they are not constant over time.

[3]The discrepancy between the approximate length of the calendar year and the length of the tropical year implies that the calendar dates in our days occur about a week later in the season than when the calendar was first instituted. If instead of using the metonic estimate for the number of months in a year, we used the astronomical value, the average year length would be about 365.242256 days. Thus about 99% of the discrepancy in year length is due to the error in the metonic estimate. However, the sages in instituting the calendar had to find a small integral number of months to fit into a small integral number of years. Given this constraint, the choice of Metonic cycle was probably optimal.

[4] Molad is usually traslated as lunar conjunction. RMBM distinguishes beteween molad amiti, the true molad, and molad emtzai, which is best thought of as a theoretical number. It doesn’t correspond to any real time, but is a value used to determine the calendar.

[5] This concept is presented in more detail below.

[6] Since the difference between the moladim of 2 subsequent months equals the number of parts in a month, the difference between the moladim of 2 months which are 19 years apart will differ by the number of parts in 19 years. This guarantees that, although there is much variation in the length of the year, the average length of the calendar year will be exactly 365 days plus 6397 and 12/19 parts.

[7] In contrast, al-Biruni used Indian decimals in his description of the Jewish calendar.
His readers had already been introduced to this representation of numbers by the mathematician
Al-Khwarizmi. RMBM's readers, on the other hand, were mostly not familiar with this notation.

[8] See “A Mathematical Analysis of the Hebrew Calendar”, http://www.math.uga.edu/~lenny/papers/PaperList.html, where this is done.

[9] The mischaracterization of the molad as a physical event in the Artscroll siddur and the Chabad web site attests to this. This is also seen in the way the molad is described in printed calendars and announced in synagogues. Instead of using the natural, Jewish way of referring to the week day by its number, it is translated into its secular equivalent. For example, Day 2, 5 hours becomes Sunday evening at 11 PM. The purpose of such a translation eludes us, since to use the molad for its intended purpose, one would have to translate it back into a number. What is even more bizarre, some calendars adjust the molad in summer for daylight savings time!