CSE 312 – Birthday “Paradox” Notes 


Spring 2026

We will explore a well-known probability problem that leads to some unintuitive outcomes. It is called the birthday “paradox” (even though no logical contradictions will occur).

How many people would you expect you would need in a room to have a 50% chance of having two people with the same birthday? There are a lot of possible birthdays (365), so you might expect you would need a lot of people to make it just as likely than not to have two people with a birthday in a room. It turns out, you only need 23 people! If you have at least 23 people, there is a greater than 50% chance that two people in the room have the same birthday. Let’s explore this formally and try to find out why.

Problem

Suppose we have a collection of \(n\) people in a room. What is the probability that at least 2 people share a birthday? We will assume there are 365 possible birthdays, with uniform probability for each day.

Solution

Here we will walk through the steps introduced in class today to solve one of these probability problems when working with uniform probability spaces.

a)
Define the sample space \(\Omega \) and event \(E\)
b)
Count the number of outcomes in \(\Omega \)
c)
Compute \(\Pr (E)\) by counting \(E\)

(1) Define Sample Space \(\Omega \) and event \(E\)

For convenience, define the set \(U=\{1,2,3,\dots ,365\} = [365]\) to be the set of possible birthdays each person can have. If we have a collection of \(n\) people in the room, we can think of their birthdays as being a list of \(n\) birthdays \((b_1, b_2, \dots , b_n)\), where each birthday \(b_i\) is drawn from \(U\). Importantly for the space of all possible birthday assignments, we should let the birthdays be drawn from \(U\) with replacement so that it is possible for two people to have the same birthday.

In other words, let our sample space \(\Omega \) be the set of all possible birthday assignments: \begin {equation*} \Omega = \{ (b_1, b_2, \dots , b_n) \mid \forall i, b_i \in U \} \end {equation*}

We will then define the event of interest \(E\) as the set of birthday assignments where at least two people share a birthday. If we wanted to write this out mathematically, we could write: \begin {equation*} E = \{ (b_1, b_2, \dots , b_n) \mid \forall i, b_i \in U, \exists i \exists j \neq i \text { such that } b_i = b_j \} \end {equation*}

(2) Count the number of outcomes in \(\Omega \)

The number of outcomes in \(\Omega \) is the number of possible birthday assignments in total. We can think of counting this set as applying the product rule over all choices in an assignment: \begin {equation*} |\Omega | = (\text {Choices for } b_1) \cdot (\text {Choices for } b_2) \cdots (\text {Choices for } b_n) \end {equation*}

Since each birthday is chosen from \(U\) (with replacement), we have 365 options for each choice. This means: \begin {equation*} |\Omega | = \underbrace {365 \cdot 365 \cdots 365}_{n \text { terms}} = 365^n \end {equation*}

This then means that each individual outcome (possible birthday assignment) occurs with probability \begin {equation*} \Pr (\omega ) = \frac {1}{365^n} \end {equation*} since we are working with a uniform probability space.

(3) Compute \(\Pr (E)\) by counting \(E\)

Unfortunately, counting the size of \(E\) is quite difficult, since we might have to account for every possible number of people that have colliding birthdays (e.g., number of ways to have only 2 people share a birthday, number of ways for only 3 people to share a birthday, etc.).

Like we saw with the dice example in class, a common trick to trying to solve problems with “at least” is to flip it around and try counting the complement. In other words, instead of trying to find \(\Pr (\text {at least 2 people have same birthday})\), we will compute: \begin {equation*} 1 - \Pr (E^C) = 1 - \Pr (\text {no two people share a birthday}) \end {equation*}

The sample space for this probability is the same as above, but now we need to consider the set of birthday assignments such that no two people share a birthday. Solving this approach is similar to counting the sample space \(\Omega \), but now we can’t re-use a birthday once we have chosen it earlier. This is the same as taking 365 possible birthdays, and finding the ways to permute \(n\) of them. \begin {equation*} |E^C| = 365 \cdot 364 \cdots (365 - n + 1) = \frac {365!}{(365-n)!} \end {equation*}

A very important question here is: Why do we use permutations here instead of combinations? Does the order of the birthdays matter?

Order does matter here! Our sample space \(\Omega \) is defined to be all the possible assignments of birthdays, and we accounted for 365 possible choices for each person’s birthday. If you consider \(n=3\), our counting of \(|\Omega | = 365^3\) counts (Jan 1, Feb 2, March 3) as a different outcome than (March 3, Feb 2, Jan 1). Convince yourself that’s true by writing out the sample space for a smaller number of possible birthdays (e.g., everyone can only be born on day 1, 2, 3).

So now we can compute the probability of interest, \(\Pr (E)\): \begin {equation*} \begin {aligned} \Pr (E) &= 1 - \Pr (E^C) && \text {(1)}\\ &= 1 - \frac {|E^C|}{|\Omega |} && \text {(2)}\\ &= 1 - \frac {365!/(365-n)!}{365^n} \qquad && \text {(3)} \end {aligned} \end {equation*}

Step (1) is true from Corollary 1 (Complementation), (2) is from the definition of the probability of an event, and (3) is plugging in the values for \(|E^C|\) and \(|\Omega |\) from our earlier work. That’s it! We have now calculated the probability as a formula in terms of the number of people \(n\).

Exploring the Solution

So while the math is all laid out, what does it mean? Well we now have this formula we can plug \(n\) into to find the probability of having at least 2 people in a room of \(n\) people sharing a birthday. This formula is exactly how we got the number shared in the intro paragraph. If we let \(n=23\), then plugging this formula into a calculator yields \(\Pr (E) \approx 0.507\).

What’s even more surprising, is this probability grows very quickly! If you double the number of people in the room to \(n=46\), \(\Pr (E) \approx 0.948\)! This is pretty shocking since 46 people is much smaller than the total number of birthdays (365) but has such a high probability of having people with the same birthday. You actually only need to go up to \(n=57\) to get a probability of \(\ge 0.99\).

If you plug this formula into WolframAlpha, you can see how this probability grows as \(n\) increases.

A line graph showing the probability of a shared birthday rapidly
increasing from 0 to 100 percent, hitting the 50 percent mark around 23
people, and plateauing near 100 percent by the time n reaches 60 people.

Why does the math betray our expectations? There are two main reasons for why our intuition does not match reality.

First, thinking in probabilities is not always the easiest thing for our brains to do. We like certainty and so it takes lots of practice to think of things as probabilities. This is precisely why we need formal systems like probability theory to analyze random processes to find correct conclusions, even if they aren’t intuitive.

For this problem in particular, one reason we underestimate the likelihood of conflicting birthdays is that we generally think a bit selfishly. You probably thought something like "I’ve met a lot of people in my life and only a handful of them have the same birthday as I do, therefore it’s unlikely if we had a room of random people, they would share my birthday." In fact, that’s somewhat true, it’s not very likely that someone will share your birthday (check yourself: there is a \(\frac {1}{365}\) probability that someone else will have your particular birthday).

However, the question had nothing to do with your birthday! It asked if there were any pair of people that have the same birthday. As we increase \(n\), we quickly increase the number of pairs of people possible that could have conflicting birthdays. The number of pairs of people from \(n\) is exactly \(\binom {n}{2}\), which grows quadratically in \(n\). This is exactly why we see this number approach \(\Pr (E) \rightarrow 1\) so quickly!