Birthday Problem for 3 people

24.8k Views Asked by At

I know that, in a room of 23 people, there is a 50-50 chance that two people have the same birthday. However, what I want to know is: How many people do you need to have a 50-50 chance that 3 people share the same birthday?

Note: Assume for this question, that birthdays are equally distributed

2

There are 2 best solutions below

9
On BEST ANSWER

The question linked in the comments, while not your exact question, is very relevant. In particular, reading the answers posted there will tell you that an exact computation for triples is gross. However, Byron Schmuland's answer gives us a useful estimate: $$ P(\text{at least one triple with } N \text{ people}) \approx 1 - e^{-{N \choose 3}/365^2} $$ From this we can simply solve for what $N$ makes this value $\frac12$. We need \begin{align*} 1 - e^{-{N \choose 3}/365^2} &= \frac12 \\ e^{-{N \choose 3}/365^2} &= \frac12 \\ e^{{N \choose 3}/365^2} &= 2 \\ {N \choose 3} &= 365^2 \ln 2 \\ N(N-1)(N-2) &= 6 \cdot 365^2 \ln 2 \\ N^3 - 3N^2 + 2N - 6 \cdot 365^2 \ln 2 &= 0 \end{align*}

A computer calculation reveals that the only real root of this cubic polynomial is $N \approx 83.13$. Hence we would expect to need $83$ or $84$ people in the room before having a 50-50 chance of getting three people with the same birthday.

UPDATE: This is only an approximation, and it turns out it's off by more than I expected. To get an exact answer, I used the exact formula given here, and found that $N = 87$ is actually closest, with a probability of $.49945$ that three people have the same birthday.

5
On

Empirically the answer seems to be $87$ or $88$.

More precisely, the probability of at least three people sharing a birthday is very close to $0.50$ if there are $87$ people in total (making the standard assumption of an i.i.d. uniform distribution over $365$ days).

Using the following R code to test a million cases for $87$ people in a room

days   <- 365
people <- 87
cases  <- 1000000
set.seed(1)
maxhits <- function(x){ max(table(x)) }
eg <- matrix(sample(days, people*cases, replace = TRUE), nrow=cases)
table(apply(eg, 1, maxhits) )

the sample distribution for the most people sharing a single birthday was

 1      2      3      4      5      6      7 
13 500212 461918  36116   1688     50      3