# Understanding the Birthday Paradox: A Deep Dive into Probability

Written on

## Chapter 1: The Fascinating Birthday Paradox

Prepare yourself for an intriguing concept! During my high school years, I stumbled upon a remarkable phenomenon known as the birthday paradox. It suggests that in a gathering of just 23 individuals, the likelihood that at least two share the same birthday surpasses 50%. Surprising, right? With only 23 people and roughly 365 days available, I found it hard to accept without a solid proof.

To clarify this phenomenon, I will present a comprehensive proof along with detailed explanations. We will explore relevant aspects leading up to the proof to ensure a complete understanding. Moreover, I will provide a bound that allows us to express the probability in a more general form, such as: "In a group of n individuals, the probability that at least two share a birthday is a minimum of x."

As always, we will delve into higher-level concepts, covering topics such as probability theory and combinatorics.

### Section 1.1: Understanding Probability

Grasping the concept of probability can be quite complex. Let's clarify what probability truly means and, perhaps more crucially, what it does not imply. When we say that "the probability of being involved in a plane crash is about 1 in 11 million," what does this truly signify? Does it imply that if we fly 12 million times, a crash is guaranteed? Absolutely not!

This notion is tied to the law of large numbers. In simple terms, this law states that if an experiment is repeated enough times, the observed frequency of an event will approximate its actual probability. For instance, if I roll a fair die multiple times and track the outcomes, over a large number of rolls, each number should appear roughly one-sixth of the time.

However, this does not mean that if I roll a die 1,000 times and get all fives, the universe will counterbalance this outcome by ensuring fewer fives in subsequent rolls. That’s the beauty of relative frequency! Even if one gets 1,000 fives initially, future rolls will still stabilize the distribution over a larger sample size.

Thus, probability refers to the relative frequency of an event occurring after numerous trials. The assessment of crash likelihood only holds meaning when repeated many times.

But what about the intuition we develop around probability? We often express statements like "it's very unlikely for your plane to crash." This is acceptable as long as we understand the underlying meaning.

Is there an intuitive explanation for the law of large numbers? Certainly! You can think of the probability of an event as the ratio of successful outcomes to the total possible outcomes. For example, when tossing a coin a thousand times, we expect approximately 50% heads, as sequences yielding 900 heads are far less common than those yielding 500 heads.

### Section 1.2: The Mathematics Behind Probability

To truly comprehend probability, we must explore specific spaces known as probability spaces, which fall under the broader umbrella of measure spaces. However, this discussion will remain straightforward without delving into the complexities of σ-algebras or Borel measures. It's worth noting that there exists a rigorous theory, measure theory, that extends probability theory.

In probability, we define an event as a collection of outcomes, where a single outcome can belong to multiple events. We denote our event space as 𝔽 and the sample space as Ω, representing all possible outcomes.

### Axioms of Probability

Here, I will outline the three fundamental axioms of probability:

- The probability of an event is a non-negative real number, i.e., p(E) ∈ ℝ ∧ p(E) ≥ 0.
- The probability that at least one of the elementary outcomes occurs is 1, so p(Ω) = 1.
- Any countable series of disjoint events satisfies σ-additivity.

Although the third axiom may seem complex, it simply states that if two or more events have no overlap, the probability of one or more occurring equals the sum of their individual probabilities.

For example, if you roll a die, the probability of rolling either an even number or a five is calculated as 1/2 + 1/6 = 2/3.

From these axioms, we derive several familiar probability results, such as the complement rule: the probability of the complement of an event E is defined as ΩE, and its probability is 1 - p(E).

### Independence in Probability

Two events, A and B, are defined as independent if and only if p(A ∩ B) = p(A) * p(B). This concept will be crucial as we proceed. Recall that conditional probability, denoted p(A|B), represents the likelihood of A occurring given that B has occurred. The formula for this is:

p(A|B) = p(A ∩ B) / p(B).

This rule serves as a mnemonic. Since B is assumed to occur, we can analyze the probability of both A and B by examining their joint occurrence relative to the total probability of B.

If A and B are independent, the relationship holds true: knowing B occurred does not alter the probability of A. Thus, we can derive that p(A ∩ B) = p(A) * p(B), validating our definition of independence.

## Chapter 2: Tackling the Birthday Problem

Now that we have the foundation, let's dive into the birthday problem. Our goal is to determine the probability that at least two individuals share the same birthday within a group of n people.

Interestingly, it's simpler to compute the probability of the complement event, which is that no two individuals share the same birthday. Let’s denote this event as B*.

To compute p(B*), we begin by counting the possible combinations of birthdays where no two individuals (out of n people) share the same birthday. For instance, person 1 can have any birthday, while person 2 must have a different one, leading to a count of 365 * 364 if n=2.

Continuing this pattern, the total number of ways for n individuals is represented as 365 * 364 * … * (365 - n + 1) = 365! / (365 - n)!. To find the probability p(B*), we divide this result by the total possible combinations of birthdays, which is 365^n.

Thus, we have:

p(B*) = 365! / (365^n * (365 - n)!).

However, we are interested in the probability of the event B, which is the complement of B*. According to probability theory:

p(B) = 1 - p(B*),

leading to:

p(B) = 1 - 365! / (365^n * (365 - n)!).

Let’s visualize these probabilities. We can utilize a programming language (in this case, Python) to plot the probability for groups ranging from 1 to 80.

The red horizontal line indicates the 50% probability mark. Astonishingly, the minimum number of people required to exceed this probability is 23.

To elaborate, for a group of n people, the likelihood of two or more sharing a birthday is at least 50.7%. We say "at least" due to certain assumptions made in our calculations, such as the uniform distribution of birthdays and the exclusion of twins or leap years. Even with these considerations, the conclusion holds: 23 individuals provide at least a 50% chance.

For larger groups, the probability continues to rise significantly. For example, 50 people yield a 97% chance, while 60 people increase it to a staggering 99.4%.

The formula for p(B) remains valid as long as 0 ≤ n ≤ 365. If we replace the factorial in the denominator with the gamma function, we extend p(B) to:

p(B) = 1 - 365! / (365^n * Γ(366 - n)),

which applies for all non-negative integers n. Here, we must consider limits since Γ has poles at non-positive integers, resulting in p(B) = 1 for all n > 365. This aligns perfectly with the pigeonhole principle: when there are more than 365 individuals, at least two will inevitably share a birthday.

While this overview touches on just the highlights, I hope it empowers you to tackle similar probability puzzles with greater confidence. Stay tuned for future articles where we will explore more fascinating counterintuitive examples within the realm of probability.