The math for two people sharing a birthday is pretty simple, but the math for three is a bit more of a chore, but Monte Carlo simulations are easy.

The odds of 3 (or more) people sharing a birthday among 12 people, assuming that birthdays are randomly distributed (not true) and that leap years don’t exist (also not true), are about 0.16%.

The number of people at which the odds of having three share a birthday is 50% or greater under the same assumptions is 88.

My code if anyone wants to check it:

#!/usr/bin/python
import random
N = 100000
n = 88
m = 3
successes = 0
for i in range(N):
days = dict()
for j in range(n):
day = random.randint(1,365)
if not days.has_key(day):
days[day] = 0
days[day] += 1
if (days[day] == m):
successes += 1
break
print successes * 100.0 / N

No need to simulate anything, it’s as easy as for 2 people, just compute 12! times the coefficient of x[sup]12[/sup] in (1 + x/365 + (x/365)[sup]2[/sup]/2)[sup]365[/sup]

There’s a simple way to get a good-enough approximation when there are n=12 people.

Start by counting the number of distinct trios in the room. This is
C(12,3) = 121110/(321) = 220
Multiply that by the chance the other two members of a trio have the same birthday as the first member, which is (1/365)(1/365)
The approximate answer is therefore 220 * (1/365)(1/365) = .00165
or 0.165%.

Note that this is only an approximation. There is a 0.001% chance that the room contains a quadruple birthday, and the simple calculation shown above counts those quadruplets 4 times instead of just once. We can subtract out these over-counts to get a better approximation:
0.165% - 3*0.001% = 0.162% (aka 616-to-1 odds against)
(There’s also a minuscule chance of TWO trios; again these are over-counted in the formula above.)

If n is much larger than 12, there will be much more over-counting — you’ll have to worry about quintuplets, three trios, two trios and a quadruplet and so on. Horrible; you’d want to use the method of DPRK or of iamthewalrus(:3= instead.

But for n=12, the 0.162% estimate (or even the simpler-yet 0.165% estimate) may be good enough.

Here’s a calculator for generalizations of the birthday problem:

Suppose you have c different categories and x different objects which each belong to exactly one of those categories. Suppose you expect that the chance that any one of those objects will be in any one of those categories is the same as the chance that it will be in any other one of the categories. Suppose you want to know what the chances are that at least n of the objects will be in one of the x categories. Then put c in for number of days in a year, x in for number of people in the room, and n in for number of people sharing the same birthday. Fill in the “That at least n people” dot in the probability section. Then click “Calculate”.

I knew somebody that had three children with the same birthday (no multiple births). But, if you do the math, they were “Christmas presents”.
There would be slightly different odds for the birthday being on a specific day of the year.

Yep. 0.162% and the probability calculator agrees given by Wendell Wagner agrees with you, as does iamthewalrus(:3='s Montel Carlo sim and septimus’s approximation.

I guessed that adding that third person would greatly raise the odds to over 1 in a million. So it’s surprising that the odds are only about 1 in 617. I’ll let everyone else at the party know!

I would image if we were talking about not only the same birthday, but also the same birth year, the odds would go off the charts.

If you were at a party of 12 people, most likely, you would have individuals of similar ages, so the odds would be better than simply 12 random people off the street where you might have individuals from new born babies to the elderly.

I was waiting to get on a plane that held 12 people. We all had our passports out and I noticed that the guy in front of me had the same birthday and birth year as me. (He was Australian, I’m from the US.) However, the airport was in Lukla, Nepal and we were flying to Kathmandu. This limits the ages of the individuals involved because its unlikely that you would have young or elderly people in an extremely high altitude location as Lukla (9383’). Anyway of coming up with odds of such an occurrence?

I was once at a popular math lecture and the speaker mentioned the birthday problem and decided that to actually test it with the audience of maybe 100. I interrupted to point out that two people in the audience were twins. However it turned out that someone else in the audience shared their birthday. I once directed a research group of about 10 and two of the members were born on the same day, one in Chile, one in Argentina. It was Halloween, 1938.

Sorry, I can’t help mentioning that Feb. 12, 1809 was a very auspicious day for the world. Abe Lincoln and Charles Darwin were born on that day.

I had a high school teacher with a somewhat-photographic memory, so that he could call roll on the first day (the roll sheet somehow listed everyone’s birthday) and be able to note all the duplicate birthdays. There were three people having one birthday. And I was one of them. (One of the others I had already known about.)

AND they were all in the same year! How about that! Well, that’s not surprising. It was a high school class, where everybody was in the same year, thus all about the same age.

It depends on how you look at it. I’m going to start simple with just birthdays. If you’re asking what are the odds that one specific person (the person in front of me) shares the same birthday as me, it’s about 1/365, as you would expect (or 1/365.25 if you want to be a little more precise.) If we’re going birthdate, then we’d have to estimate how many possible birthdates we have, and the odds are 1 in that number. So, let’s assume a 30 year range, so we have about 10950 possibilities (let’s forget leap years, it’s not that important to get a general sense), ergo 1 in 10950.

Now, if we’re talking what’s the possibility that one of the 11 other passengers share your birthdate, well, that should be 1-(10949/10950)^11, which is about 1 in 1000. Each person has a 10949/10950 likelihood of not sharing your birthdate (given a 30-year span of birthdates). And if we want to add all these probabilities together, we multiply them.

Now, if you’re asking what are the odds that any two people in a group of 12 with 10950 possible birthdates share a birthdate, it’s 1 in 166. That’s a different question than trying to match up your specific birthdate with someone else in the group. (Which is the distinction that is the essence of the birthday problem.)

The opposite of the “birthday problem” is: how many people do you need to gather in order to have a chance (for instance, 50%) to cover every single birthday? For 365 days you already need over 2000 people on average.

I was actually also surprised to find, assuming I did my math correctly, that you need about 253 people in a room for there to be just over a 50% chance somebody shares a particular birthdate (like, say, your own.)