Last updated:

The birthday paradoxThe math behind the birthday problemCalculating the birthday paradox: general approachAn example of calculations of the birthday paradoxThe birthday paradox calculatorIs the birthday problem a paradox?Why do results seem weird?Extensions of the birthday paradoxFAQs

The birthday paradox calculator allows you to determine the probability of at least two people in a group sharing a birthday. All you need to do is provide the size of the group. Imagine going to a party with 23 friends. What is the probability that at least two of them were born on the same day of the year? Assume that there are no leap days or twins, and each date is equally likely.

The analysis of this problem is called the birthday problem, and it yields some fairly unintuitive results.

The birthday problem concerns the probability that, in a group of randomly chosen people, at least two individuals will share a birthday. It's uncertain who formulated it first. Some suspect Harold Davenport - an English mathematician specializing in number theory. An American scientist and mathematician - Richard von Mises -introduced an earlier version of the paradox. The math behind the birthday problem is applied in a cryptographic attack called the birthday attack.

Going back to the question asked at the beginning - the probability that at least two people out of a group of 23 will share a birthday is about 50%. Moreover, with 75 people in the room, the probability rises from a 50/50 chance to a 99.95% probability. Those numbers may seem odd, considering that there are 365 possible dates and only 75 people.

If you are unconvinced, let's look into the logic of the birthday problem in the next section of this birthday paradox calculator.

## The math behind the birthday problem

At any party organized on Earth, at least two people in the group share a birthday or no one matches with anyone. So the probability that the first or the opposite scenario will occur is 100%.

As it is much easier to do, we begin by calculating the probability of the situation in which no one shares a birthday - the event complementary to the one described in the birthday problem. It is simpler because for the case of at least two people sharing a birthday, we would have to calculate the probability of two people sharing a birthday, three people sharing a birthday, two people sharing a birthday, and the other two sharing another birthday, and so on. We would have to consider all these situations, from having one pair of people sharing a birthday to all having the same date. Notice that this formulation is valid only if the question asked is at least two people sharing their birth date.

## Calculating the birthday paradox: general approach

To calculate the probability of at least two people sharing their birthday in a given number $n$ of people, we work out the probability of no people sharing birthdays at all. To do so, we start with a random person. They have probability $P_1$ to not share their birthday with another person:

$\footnotesize P_1 = \frac{365}{365}=1$

this value, of course, depends on the fact that they are alone, for the moment.

The next person in has only $364$ possible days where they can be born without sharing the birthday with the previous person:

$\footnotesize P_2 = \frac{365-1}{365} = \frac{364}{365}$

We proceed this way until we reach the last person in the group. Notice that in the eventuality, we reach the person number $365$, $P_{365}=0$, making the event "two people sharing a birthday" unavoidable!

Anyway, for a group of $n$ people, with $n<365$, the probability of no people sharing a birthday is:

$\footnotesize\overline{p}(n) = \frac{365}{365}\cdot\frac{364}{365}\cdot...\cdot\frac{365-n+1}{365}$

At the denominator of this formula, we can quickly identify $365^n$. At the numerator, we need to introduce the factorial operator and see that:

$\footnotesize \begin{split} 365&\cdot364\cdot...\cdot(365-n+1)=\\ &=\frac{365!}{(365-n)!} \end{split}$

This reminds us of the binomial coefficient expression:

$\footnotesize\binom{n}{k} = \frac{n!}{k!(n-k)!}$

With this knowledge, we write the last expression as:

$\footnotesize \begin{split} \frac{365!}{(365-n)!}=n!\cdot\binom{365}{n} \end{split}$

This expression corresponds to the possible permutations of $n$ elements over a set of $365$ possible items. The complete formula for the birthday problem is as follows:

$\footnotesize \overline{p}(n) = \frac{n!\cdot\binom{365}{n}}{365^n}$

As this quantity answers the question "what's the probability that no one shares a birthday out of $n$ people", we find the probability that at least two people share a birthday with the complement:

$\footnotesize p(n) = 1- \overline{p}(n) = 1- \frac{n!\cdot\binom{365}{n}}{365^n}$

## An example of calculations of the birthday paradox

Let's see how to use the previous formula in an example.

1. Imagine you are alone in a room (no horror plot following, just maths). The chance that you will share a birthday with no one in the room is 365/365.

2. Your friend Balthasar comes in. You've already taken one day, so to have a unique birthday, he has 364 options to choose from out of the 365 possible days. The probability that he won't share a birthday with you is 364/365.

3. Cosmo joins. You and Balthasar have already taken two dates, so he has 363 options - the probability of him not sharing a birthday is 363/365.

4. Delphine - the 4th person - will have the probability equal to 362/365 and Emma - the 5th person - 361/365. These values form an arithmetic sequence. Its last element can be calculated in this way:

$\footnotesize \begin{split} \mathrm{last\ element} &= \frac{365-(\text{people}-1)}{365}\\[1em] &= \frac{365-4}{365}=\frac{361}{365} \end{split}$
1. Now, we have to multiply the probabilities for each person:
$\footnotesize P(B)=\frac{365}{365}\cdot\frac{364}{365}\cdot\frac{363}{365}\cdot\frac{362}{365}\cdot\frac{361}{365}$

365/365 equals 1, so we can omit that one. It's presented to you to see that there are five people and five probabilities assigned to them. The result is:

$\footnotesize P(B)\approx0.9729$
1. As we did above, we should now calculate the complementary event:
$\footnotesize \begin{split} P(B') &\approx 1-0.9729\\ & = 0.0271 \end{split}$

Hence $P(B')\approx 2.71\%$.

You don't have to do the maths by yourself. You can simply input the number of people into the birthday paradox calculator, and voila! - you have the result.

The values are rounded, so if you enter 86 or a larger number of people, you'll see a 100% chance when in fact, it is slightly (very slightly) smaller. If we don't consider leap years, we reach 100% certainty once the group has 366 people. If you want to calculate probability taking into account leap years, toggle the radio button "With leap years" in the "days in a year" field. The number of days will then equal 365.25 (there is one extra day every four years, so that's an average of 1/4 of a day every year). In this case, you would need 367 individuals to be 100% sure no one shares a birthday.

## Is the birthday problem a paradox?

A paradox is a statement in which, despite using true premises and valid reasoning, the conclusion is illogical or self-contradictory.

One of the best-known paradoxes is the liar’s paradox. Imagine a scenario - John says to you, "I am lying," or "this sentence is a lie." Now, this statement should be either true or false. If it's true, then he's lying, but he isn't because it's true. If the statement is false, it means he isn't lying, but then it would mean he is. Either way, we end up with a contradiction.

Coming back to the birthday problem - it is not a paradox. The logic behind it is valid. It's only called a paradox because it's very unintuitive, and most people find it strange. It's sometimes called a veridical paradox - a result that seems absurd but is demonstrated to be true.

## Why do results seem weird?

In the birthday problem, as the number of people in the group rises, the chances increase exponentially - and humans aren't very good at comprehending nonlinear functions. To understand the relationship better, try drawing five dots, connecting each one with a line, and then counting the lines. Then draw another group of six dots and do the same. Can you see the difference?

You may think that you've been to so many parties, and rarely has it turned out that somebody shares a birthday. But how many times have you asked everyone at the party for their birthday? Maybe next time you have an occasion, you can determine the probability with the birthday paradox calculator and check if this situation occurs.

You can also try it by looking at your Facebook account and checking the birth dates of your friends - you'll probably find quite some people that celebrate on the same date as somebody else.

## Extensions of the birthday paradox

Let's see how we can explore the birthday paradox a bit more.

#### Chances of at least two people sharing a specific birthday

In this case, after we choose a specific birthday, every person will have 364/365 chances of not having the birthday on that date. The related expression is:

$\footnotesize{\overline{p}(n) = \frac{364}{365}\cdot\frac{364}{365}\cdot}\begin{gather*}\scriptsize{\text{n times}}\\[-1em]...\\[-1em] \ \end{gather*}\footnotesize{\cdot\frac{364}{365}}$

From this formula, we can find the probability of at least two people sharing a birthday on a given date:

$\footnotesize p(n) = 1-\overline{p}(n) = 1-\left(\frac{365-1}{365}\right)^n$

#### Number of days with at least one birthday

The previous formula can be easily adapted to find the number of days where we can expect to find at least a birthday. The probability of a day not corresponding to a birthday is equal to the probability we've seen above:

$\footnotesize \overline{q}(n) = \left(\frac{365-1}{365}\right)^n$

To find the number of days that don't match any birthday, we multiply this result by the number of days:

$\footnotesize \overline{N}_\text{days}= 365\cdot\left(\frac{365-1}{365}\right)^n$

To find the number of days occupied by a birthday, we find the proper complement:

$\footnotesize N_\text{days}=365- 365\cdot\left(\frac{365-1}{365}\right)^n$

#### Number of people that share a birthday

By slightly tweaking the expressions we found above, we can calculate the probability of a person meeting someone that shares the same birthday:

$\footnotesize p(n) = 1-\left(\frac{365-1}{365}\right)^{n-1}$

We can find the number of people that shares their birthday with the following formula:

$\footnotesize N_\mathrm{shares} = n\cdot\left(1-\left(\frac{365-1}{365}\right)^{n-1}\right)$

You got the gist: explore these and more variants of the birthday paradox in our tool!

FAQs

### What is the birthday paradox?

The birthday paradox is a mathematical puzzle that involves calculating the chances of two people sharing a birthday in a group of n other people, or the smallest number of people required to have a 50/50 chance of at least two people in the group sharing birth date.

### What's the chance of sharing a birthday between 100 people?

The chance of at least two people sharing a birthday in a group of 100 people is 99.9999%. To find this result, you can follow this reasoning.

1. The first person has probability 1 of not sharing the birthday.
2. The second one has probability (365 - 1)/365 to not share the birth date.
3. The third one, (365 - 2)/365, and so on.
4. Calculate the product of these probabilities.
5. Subtract the result of step 4. from 1 to find the probability of at least two people sharing the birthday: 99.9999%.

### How do you calculate the birthday paradox?

To calculate the birthday paradox, that is, the number of people, follow these easy steps:

1. Compute the probability of no people sharing the birthday. This means finding the probability that all birthdays happen on different days (hence the pool of available dates reduces) and multiplying the results.
2. Find the complement of this probability. The complement of no people sharing a birthday is the probability of at least two people sharing the birth date.

### Is the birthday paradox correct?

Yes: even though the answer may seem counterintuitive, the solution to the birthday paradox is entirely correct. This happens because the pool of available dates shrinks rapidly as the number of people increases. The probability involved multiplies, scaling with an exponent equal to the number of people involved. As exponential growth happens to be relatively fast, we should not the surprised by this seemingly counterintuitive solution.