display | more...
The other version of this birthday paradox is 'How many people do you need in a room to have a fifty-fifty chance of one of them sharing your birthday?'. The correct answer is about 250
p(one person in N shares your birthday)=1-(364/365)n

This writeup basically just works out the probabilities involved in the situation. To simplify let us assume that each year has 365 days uniformly .

Now what is the chance that two people selected at random will have the same birthday. The total possibilities for the birthday of the first person are 365 and this is also true for the birthday of the second person. Therefore the total number of possibilities for both their birthdays are 365 2 . Of these, 365 possibilities involve the two people having the same birthday. So the probability of two people having the same birthday is 1/365.

Now comes the second problem. Instead of calculating the probability of two or more people having the same birthday(which is difficult) let us instead calculate the probability that no two people have the same birthday. When subtracted from 1 this probability will give us the answer we want. If you have n people the total no. of possibilities for their birthdays is 365 n . Let us choose one person and label him person 1. He can have a birthday on any of the 365 days. Now let us take another person(person 2). In order that the birthdays dont clash person 2 has only 364 possibilities for his(her) birthday. Similarly there are only 363 days of the year left for person 3. We can continue this way but note that if there are 366 people in the room two of them have to share the same birthday

Anyway with the above calculation we find that the probability is

1- (365 P n / 365 n )
The distribution is not a binomial distribution.

I must make a correction here. In my previous WU, I accused The Cow of being wrong. However, thanks to hobyrne, I now realise that this was unfair. The Cow is addressing a different problem, namely the probability of one person in a room having a birthday on a particular day. My WU deals with the probability of any two people sharing a birthday.

Suvrat is perfectly correct, but in the interest of clarity, and yes pedantry, I'd like to add my \$0.02.

It may not be clear from above how to combine probabilities. You should associate AND with multiplication and OR with addition. Thus the probability of the person 1 having a unique birthday AND person 2 having a unique birthday AND etc. is

``` 365   364   363         365-(n-1)     365!     1
--- X --- X --- X ... X ---------  = ----- X -----
365   365   365            365         n!     365^n
```

Indeed, using this formula, here are the probabilities that in a group of n people there will be at least two people sharing the same birthday.

```    n     probability
-----  -------------
10       11.6948%
20       41.1438%
23       50.7297%
30       70.6316%
40       89.1232%
50       97.0374%
```

Well, what we neglected was leap day. This is a good approximation, but let's see if we can get the absolutely correct answer including leap day. Person X has one of 366 possible birthdays, but not with equal weight. To make it easier, let us group 4 consecutive years together. The chance of his/her birthday being January 21 is 4/(3*365 + 366) vs. the chance it's February 29 which is 1/(3*365 + 366) since there are 3*365 + 366 (=1461) days in 4 years, with 4 Jan 21th's and 1 Feb 29th. Note 3*365+366 = 4*365+1.

OK, remember we are going to compute the probability that every one of the n people have unique birthdays, than subtract that probability from 100%. So in our computation we have two cases to consider: (A) one where no one is born on Feb 29 and (B) one where 1 person is born on Feb 29. Let me drop the denominator, which will be n factors of 1461.

Case (A) is the same as our approximation before, except over 4 years instead of 1:

Num(PA) = (4*365 + 1)*(4(365-1)+1) *(4(365-2)+1)*...*(4(365-(n-1))+1).
Believe it or not, this product has a name, and is called the Pochhammer function, a ratio of Gamma functions.

Case (B) is more complicated. Let's say that the k'th person is the one with the Feb 29th birthday. Then

Num(PB)(k) = (4*365 + 1)*(4(365-1)+1)*...* (4(365-(k-2))+1)*(4(365-(k-2))+0)*(4(365-(k-1))+0)*...* (4(365-(n-2))+0).
This is so convoluted it's just a unnamed ratio of Gamma functions, as far as I know.

OK, I'm getting tired. Still, we aren't done since we have to sum over all possible k's. I'm not going to write that down, since there isn't a pretty closed form that would be enlightening. Schematically, it looks like

Prob = (1460/1461)*Num(PA)/1461 + (1/1461)SumkNum(PB)(k)/(1461*n)
Instead I wrote a python program to compute both the inexact and exact results. /msg me and I'll e-mail it to you. Someone checking it would be useful. In fact I'll check it more when I get time. Here's a table of the EXACT results (to 6 digits)
```    n     probability
-----  -------------
10       11.6867%
20       41.1213%
23       50.7045%
30       70.6056%
40       89.1057%
50       97.0297%
```

As a physicist I have to question my sanity and priorities in life for spending 1.5 hours of my life to compute a 10-3% effect in such an academic problem, but I did actually enjoy it.

More pedantry: what makes this a paradox??? Nothing! It's just farking cool!

Even more pedantry: derobert reminds me that leap day is suspended on years divisible by 100 unless the year is also divisible by 400, so my calculations are only exact for a room full of people born no earlier than 1 January 1901. Since 2000 had a leap day, you can use my code reliably until 2100, when your grandkid can add the appropriate correction factor.

Log in or register to write something here or to contact authors.