Mathwords logoMathwords

Birthday Problem — Definition, Formula & Examples

The Birthday Problem asks how many people need to be in a room before there is a better-than-even chance that at least two of them share the same birthday. The surprising answer is only 23 people.

The Birthday Problem computes the probability that in a group of nn randomly chosen individuals, at least two share the same birthday, assuming 365 equally likely birthdays and independent birth dates. The solution uses the complement: calculate the probability that all nn birthdays are distinct, then subtract from 1.

Key Formula

P(at least one match)=1365365364365363365365n+1365P(\text{at least one match}) = 1 - \frac{365}{365} \cdot \frac{364}{365} \cdot \frac{363}{365} \cdots \frac{365 - n + 1}{365}
Where:
  • nn = Number of people in the group
  • 365365 = Total possible birthdays (ignoring leap years)

How It Works

Instead of counting all the ways people could share a birthday, you calculate the probability that nobody shares a birthday and then take the complement. The first person can have any birthday (365/365). The second person must avoid that one date (364/365). The third must avoid two dates (363/365), and so on. Multiply these fractions together to get the probability of all distinct birthdays, then subtract the result from 1.

Worked Example

Problem: What is the probability that at least two people in a group of 23 share a birthday?
Step 1: Find the probability that all 23 birthdays are different. Multiply the fractions for each person:
P(all different)=365365364365363365343365P(\text{all different}) = \frac{365}{365} \cdot \frac{364}{365} \cdot \frac{363}{365} \cdots \frac{343}{365}
Step 2: Compute the product. This equals approximately 0.4927.
P(all different)0.4927P(\text{all different}) \approx 0.4927
Step 3: Take the complement to find the probability of at least one shared birthday.
P(at least one match)=10.49270.5073P(\text{at least one match}) = 1 - 0.4927 \approx 0.5073
Answer: With 23 people, there is approximately a 50.7% chance that at least two share a birthday.

Visualization

Why It Matters

The Birthday Problem is a classic example of how human intuition about probability can be wildly off. It appears in cryptography, where the same logic (called a "birthday attack") is used to find collisions in hash functions. Understanding this problem builds strong skills in complement counting, a technique used throughout AP Statistics and college-level probability.

Common Mistakes

Mistake: Confusing the problem with the chance that someone shares YOUR birthday.
Correction: The Birthday Problem asks about ANY two people sharing a birthday, not a specific person. The number of possible pairs grows quickly — with 23 people there are (232)=253\binom{23}{2} = 253 pairs to check, which is why the probability is so high.