What is the probability that at least 2 people have the same birthday?

One way to find the probability of no birthday match in a room with $n=25$ people is shown in the Wikipedia link of my first Comment. Here is a slightly different way to write it:

$$P(\text{No Match}) = \frac{{}_{365}P_{25}}{365^{25}} = \prod_{i=0}^{24}\left(1 - \frac{i}{365}\right) = 0.4313.$$

In R, this can be evaluated as follows. [In R, 0:24 is a list of the integers from 0 through 24; similarly for other uses of :.]

prod((365:(365-24))/365)
[1] 0.4313003
prod(1 - (0:24)/365)
[1] 0.4313003
prod(365:341)/365^25
[1] 0.4313003

So $P(\text{At least one match}) = 1 - 0.4313 = 0.5687.$

You can use R to make the first figure in the Wikipedia article as shown below. The green line shows that for 23 people or more the probability of at least one birthday match exceeds $1/2.$

n = 1:60
p = numeric(60)
for (i in n) {
  q = prod(1 - (0:(i-1))/365)
  p[i] = 1 - q
  }

plot(n, p)
  lines(c(0,23,23), c(.5,.5,0), col="green2")

What is the probability that at least 2 people have the same birthday?

Some people are surprised that matches occur with such high probability. Maybe they are thinking at it would take 366 people in a room to be sure of a match. But the graph shows that probability does not increase linearly with room size. So it is "nearly sure" (probability 0.9941) to get a match in a room of only 60 people. And the probability of at least one match is above 1/2 in a room of 23 people.

Here is a table of some of these 60 probabilities (truncated at 30):

cbind(n, p)
       n           p
 [1,]  1 0.000000000
 [2,]  2 0.002739726
 [3,]  3 0.008204166
 [4,]  4 0.016355912
 [5,]  5 0.027135574
 [6,]  6 0.040462484
 [7,]  7 0.056235703
 [8,]  8 0.074335292
 [9,]  9 0.094623834
[10,] 10 0.116948178
[11,] 11 0.141141378
[12,] 12 0.167024789
[13,] 13 0.194410275
[14,] 14 0.223102512
[15,] 15 0.252901320
[16,] 16 0.283604005
[17,] 17 0.315007665
[18,] 18 0.346911418
[19,] 19 0.379118526
[20,] 20 0.411438384
[21,] 21 0.443688335
[22,] 22 0.475695308
[23,] 23 0.507297234  # first to exceed 1/2
[24,] 24 0.538344258
[25,] 25 0.568699704
[26,] 26 0.598240820
[27,] 27 0.626859282
[28,] 28 0.654461472   
[29,] 29 0.680968537
[30,] 30 0.706316243
 ...
[60,] 60 0.994122661

Notes: I agree with @Ben (+1) that your equation doesn't work to get the probability of a match between two randomly chosen people. however, suppose you're among the 25 people in a room, then with probability $1 -\left(\frac{364}{365}\right)^{24} = 0.0637$ at least one other person in the room will match your birthday.

Thus, another wrong 'intuitive' approach to the main birthday problem above is to confuse the probability someone will match your birthday with the larger probability that some two (or more) people will have matching birthdays. (Among 25 people there are ${25 \choose 2} = 300$ pairs of people who may have matching birthdays.)

Finally, this Q&A shows a method of simulating the probability of a birthday match. With a slight modification, that method can also be used to find the expected number of matches.

$\begingroup$

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.

Henry

145k9 gold badges115 silver badges232 bronze badges

asked May 4, 2013 at 4:41

$\endgroup$

0

$\begingroup$

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

answered May 4, 2013 at 4:46

What is the probability that at least 2 people have the same birthday?

Ross MillikanRoss Millikan

365k27 gold badges247 silver badges434 bronze badges

$\endgroup$

2

$\begingroup$

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\%$.

answered May 4, 2013 at 5:45

JaredJared

30.6k10 gold badges56 silver badges137 bronze badges

$\endgroup$

1

$\begingroup$

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

What is the probability that at least 2 people have the same birthday?

answered Jan 4, 2017 at 8:21

AmjadAmjad

111 bronze badge

$\endgroup$

1

What is the probability that in a group of 2 people both have same birthday?

now both may have same birthday on one of the 365 days, so P(both have the same b'day) =365/365×365=1/365.

How do you calculate the probability of the same birthday?

The goal is to compute P(A), the probability that at least two people in the room have the same birthday. However, it is simpler to calculate P(A′), the probability that no two people in the room have the same birthday. ... Calculating the probability..

What is the probability of 2 people have the same birthday in a group of 50 people?

If there are 366 or more people, but only 365 possible birthdays disregarding leap year, then two or more of them must share a birthday. ... Probability of Shared Birthdays. or, How to Win Money in Bar Bets..

What is the probability that among 25 people at least 2 have their birthday on the same day of the year?

Answer: The Probability that of 25 Randomly Selected Students, at Least Two, Share the same Birthday is 0.5687.