# At least two people have the same birthday

If there are 85 students in a statistics class and we assume that there are 365 days in a year, what is the probability that at least two students in the class have the same birthday?

I tried solving it by taking into account the fact that it will be extremely difficult to solve for the probability of at least having the same birthday and started off by solving it in the complement fashion, where P(at least two people having the same birthday) = 1 - P(every person's birthday is unique), but have been trying to the possible numerator/denominator for this problem.

Hint: your approach is a good one. What is the chance if there are only two people? Three?

• I did not get the question sorry! only 2 people in total? May 4, 2013 at 5:18
• @pepperjack: I was trying to get you thinking down the line that the chance of a match with only two people is $1-\frac{364}{365}$, the chance of a match with three is $1-\frac {364\cdot 363}{365^2}$ and so on. It is in the link from Jared. May 4, 2013 at 14:15

You can read all about this famous problem here to learn how to calculate the probability that at least two of $n$ people share a birthday. In your case at least two of $85$ people will share a birthday with a probability of approximately $99.998\%$.

• That makes sense, thank you! May 4, 2013 at 6:25

Here is a simulation written in python. It may help you to analyse the problem and understand it.

    import random

def birthdayMatched(members):
numYearDa
ys = 365 # Number of days
s = range(numYearDays)
matched = False
membersList=[None] * members

for i in range(members):
membersList[i] = random.choice(s)
if len(set(membersList)) < members :
matched = True

return matched

def sim_birthdayMatched(numTrials):
numMatches = 0
numPeopleInParty = 23
for i in range(numTrials):
if birthdayMatched(numPeopleInParty):
numMatches += 1
return numMatches/numTrials


Call: The function takes the number of people as an input

sim_birthdayMatched(10000)


Output:

0.5077

• though that is for $23$ people rather than $85$ Jan 13, 2018 at 15:22