Showing posts with label Probability. Show all posts
Showing posts with label Probability. Show all posts

Thursday, May 14, 2026

What are the odds?

Since this week's parsha deals at length with first-borns, I thought I'd share a rather interesting family fact:

I have an aunt and uncle who have six children (בלי עין הרע) and every single one of those children made a פדיון הבן!

I once tried to calculate the odds of that happening. To calculate the odds of anyone making a פדיון הבן there are a number of factors that must be calculated. We can try to approximate:
  1. Let's assume that the child themselves is a ישראל, otherwise it's a non-starter. So we need to know the odds of their spouse not being a Levite (80% based on my snooping of our shul's membership database.)
  2. The first fetus has to be male (let's just say 50%)
  3. The baby must be delivered and not miscarried (let's use 90%)
  4. The baby must be born without a Cesarean (again, 90%)
So the odds of any non-Levite making a פדיון הבן are only about 32%. The odds of going 6-for-6 are a mere 0.12%
WOW!

Friday, July 26, 2024

The Probability of the Goral


In pasuk 26:54, the Torah explains how the land was divided amongst the tribes. Rashi explains exactly how the lots were picked to determine each tribe's portion.

Even though the portions were Divinely predetermined, a lot-drawing process was used to assign each tribe their portion. Rashi explains that one drum was filled with 24 pieces of paper. On 12 pieces of paper were written the names of the 12 tribes. On the other 12 were written the 12 portions that were to be assigned to the tribes. Each Nasi approached the drum and picked out two pieces of paper. One paper had the name of his tribe written on it and the other the prescribed portion of land in Eretz Yisrael. The purpose of this exercise was to prove the Divinity of division plan that allotted each tribe its portion and appease any tribe who felt it might be unfair. As such, I believe that a miracle of this type may be more greatly appreciated if we knew exactly how unlikely it would have been to happen naturally.

Suppose we had a prescribed list of which portion was to be assigned to which tribe. What would be the odds of each Nasi picking out both the name of his tribe and also the corresponding piece of land that had already been prescribed? Let us start with the first Nasi. He has 24 pieces of paper to choose from. He must pick two specific pieces of paper out of the drum. The odds of taking the first one correctly would be 1/24 and then the odds of taking the second correctly would be 1/23. However, since the two papers were taken together, the order does not matter. The rules of probability theory state that if the order of the choices is not relevant, than the odds must be multiplied by the number of possible sequences which, in this case, is two. So the odds of the first Nasi picking the right pieces is 2/(24 x 23). With 22 pieces of paper remaining, the odds of the second Nasi picking correctly will be 2/(22 x 21). And so on. The last Nasi's odds will be 2/(2 x 1) which is 1. That means that he will definitely pick the right ones. That is understandable. By the rules of probability theory, in order to find the odds of all the Nesiim picking correctly, we must multiply each Nasi's odds together. Thus, the odds may be generalized as
212
(24 x 23 x 22 x 21...x 2 x 1)

24 x 23 x 22 x 21....x 2 x 1 is referred to as 24 factorial and expressed as 24! Thus the final expression is 212/24!. When all is totalled, the odds of the draw falling out exactly as planned without any Divine intervention would have been one in 151,476,000,000,000,000,000.

This calculation is based on Rashi's explanation in the chumash according to the Midrash Tanchuma. However, Rashi (actually written by Rashbam, Rashi's grandson,) in the gemara (Bava Basra 122a) states clearly that two drums were used. This will alter the calculation somewhat. The first Nasi would have a 1/12 chance of picking his tribe's name from the tribe drum and a 1/12 chance of picking the correct portion from the portion drum. The fact that the order does not matter will not affect the odds in this case because the choices are made from two separate groups. The odds for both drums are multiplied and thus, the first Nasi's odds will be 1/122. The odds of the second Nasi will be 1/112. And so on. The total odds will be:

1
122 x 112 x 102 x 92 x 82 x 72 x 62 x 52 x 42 x 32 x 22 x 12


This can, in fact, be simplified as 1/12!2. The final odds will be one in 229,442,532,802,560,000. This is approximately 660 times more probable than the odds according to Rashi on the chumash.


Just to get an idea of the extent of this improbability, the odds of winning the Powerball Jackpot are approximately one in 175 million. That is over 1.3 billion times more likely to happen than this, according to Rashi on the gemara, and over 860 billion times more likely according to Rashi on the chumash. The odds of getting fatally hit by lightning in a given year are approximately 1 in 2.4 million. In fact, it is more likely for one to win the Powerball twice in one week or get fatally hit by lightning two-and-a-half times in one year than for the goral's results to have been produced naturally. This is a veritable testimony to the extent of the miracle that occurred and the Divinity of the apportioning of Eretz Yisroel to the twelve tribes.

תשע"ד: A similar drawing came up this week in דף יומי on :תענית כ"ז regarding the גורל used to determine the order of the משמרות in the בית שני. According to רש"י's understanding, there was a similar miracle at play. The probability associated with that drawing is discussed here.

1

Friday, March 11, 2016

Frequency of חזק's and סיומי דפ יומי

This coming שבת, the סיום דף יומי מסכת גיטין coincides with the חזק of finishing ספר שמות. See this fascinating article by R' Dovid Heber of the Star-K. In it, he shows that since the beginning of דף יומי there have in fact been the same number of סיומים as חזק's and goes through the numbers to show exactly why that is. עיין שם,

I decided to take this matter a little further and investigate how many times this has actually happened or will happen, assuming the exact structure of דף יומי remains the same. This is what I found, going back to the beginning in 1923 all the way to the year 2050:

Beitzah 40 1/16/2044 16 Teves 5804 Vayechi
Avodah Zarah 76 7/7/2040 26 Tammuz 5800 Matos Masei
Moed Katan 29 7/14/2029 2 Av 5789 Matos Masei
Gitin 90 3/12/2016 2 Adar II 5776 Pekudei
Shabbos 157 3/9/2013 27 Adar 5773 Vayakhel Pekudei
Kesubos 112 12/22/2007 13 Teves 5768 Vayechi
Yevamos 122 12/24/1977 14 Teves 5738 Vayechi
Temurah 34 7/7/1945 26 Tammuz 5705 Matos Masei

It is interesting to note that it does not occur on בחוקתי at all in this time, nor does it ever land on שמחת תורה. In fact, looking even further ahead, the only time it will ever land on שמחת תורה between now and the year 2200 will be the following on שמחת תורה in ארץ ישראל:

Horiyos 14 Thu Oct 26, 2062 22 Tishrei, 5823
For anyone curious as to how I was able to figure all this out, I wrote a very short and simple Java application and made use of the brilliant Zmanim API by KosherJava.

And if you're even more curious, here's my code:


import java.util.Calendar;
import java.util.Date;

import net.sourceforge.zmanim.hebrewcalendar.HebrewDateFormatter;
import net.sourceforge.zmanim.hebrewcalendar.JewishCalendar;


public class Daf {

      public static void main(String[] args) {
            int daf;
            HebrewDateFormatter hdf = new HebrewDateFormatter();
            Calendar day = Calendar.getInstance();
            day.set(Calendar.YEAR,2050);
            //System.out.println(day);
            boolean siyum=false;
            // While loop to expose all siyumim that happen on Shabbos. I have to go in manually afterwards to identify the chazaks.
            // I could have possibly used getParshaIndex() and played with that to expose just the chazaks but that would have been clunkier
            while (day.get(Calendar.YEAR) > 1922){
                  JewishCalendar jewCal = new JewishCalendar(day);           
                  try{
                      daf = jewCal.getDafYomiBavli().getDaf();
                  } catch (IllegalArgumentException iae){
                      break;
                  }
                  if (siyum){
                        if (day.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY){
                       
                        System.out.println(jewCal.getDafYomiBavli().getMasechtaTransliterated() + " " +
                                    daf + ", " + day.getTime() + "," +  jewCal + "," + jewCal.getParshaIndex());
                        }
                        siyum=false;
                  }
                  if (daf == 2) siyum = true; //If today is the beginning of the masechta, yesterday was the siyum of the previous
                  day.add(Calendar.DAY_OF_YEAR, -1);
            }
            day.set(Calendar.YEAR,2200);
            //Separate loop to identify Simchas Torah since it isn't usually on Shabbos
            while (day.get(Calendar.YEAR) > 1922){
                  JewishCalendar jewCal = new JewishCalendar(day);           
                  try{
                      daf = jewCal.getDafYomiBavli().getDaf();
                  } catch (IllegalArgumentException iae){
                      break;
                  }
                  if (siyum){
                        // If the 22nd or 23rd day of Tishrei
                        if (jewCal.getJewishMonth() == 7 && (jewCal.getJewishDayOfMonth() == 22 || jewCal.getJewishDayOfMonth() == 23)){
                        System.out.println(jewCal.getDafYomiBavli().getMasechtaTransliterated() + " " +
                                    daf + ", " + day.getTime() + "," +  jewCal + "," + hdf.formatParsha(jewCal));
                        }
                        siyum=false;
                  }
                  if (daf == 2) siyum = true;
                  day.add(Calendar.DAY_OF_YEAR, -1);
            }           
      }
}