Exactly 2 People have the same birthday

  • Thread starter hadron23
  • Start date
In summary, the conversation discusses the probability of exactly two people out of m having the same birthday. The formula for this probability is 365!/[(365-m+1)!*365^m]. However, the conversation also raises the question of whether the case where two students are born on different days, with everyone else having different birthdays, falls under the category of exactly two people sharing a birthday. To account for all possible pairs, the formula should be multiplied by (m-1)!, resulting in a final formula of [365!/[(365-m+1)!*365^m]]*(m-1).
  • #1
hadron23
28
1
Hey,

I am trying to find the probability that exactly two people out of m have the same birthday. I know that the probability for at least two people out of m having the same birthday is,

P(X>=2) = 1 - P(X!=2) = 1 - 365/365*364/365*363/365*...*(365-m+1)/365 = 365!/[(365-m)!*365^m]

which is just 1 minus the probability that m people have different birthdays (P(X!=2)).

Now suppose I want to find the probability that EXACTLY two (but no more) share a birthday, using similar logic, this is the probability that no more than two share the same bday,

= 365/365*1/365*364/365*...*(365-m+2)/365 = 365!/[(365-m+1)!*365^m]

but I think I am overlooking something. Does the case where, say, two students born on June 15th and two students born on July 3rd, with everyone else having different bdays, still fall under the case that EXACTLY two share a birthday (since there are no 3 students that share a bday?). If so, how do I do this problem?
 
Physics news on Phys.org
  • #2
hadron23 said:
Hey,

I am trying to find the probability that exactly two people out of m have the same birthday. I know that the probability for at least two people out of m having the same birthday is,

P(X>=2) = 1 - P(X!=2) = 1 - 365/365*364/365*363/365*...*(365-m+1)/365 = 365!/[(365-m)!*365^m]

which is just 1 minus the probability that m people have different birthdays (P(X!=2)).

Now suppose I want to find the probability that EXACTLY two (but no more) share a birthday, using similar logic, this is the probability that no more than two share the same bday,

= 365/365*1/365*364/365*...*(365-m+2)/365 = 365!/[(365-m+1)!*365^m]

but I think I am overlooking something. Does the case where, say, two students born on June 15th and two students born on July 3rd, with everyone else having different bdays, still fall under the case that EXACTLY two share a birthday (since there are no 3 students that share a bday?). If so, how do I do this problem?

I take the problem to be asking the probability that there is exactly one pair of people with the same birthday, so that the case of a pair born on June 15th and a pair on July 3rd does not satisfy the conditions of the problem. All other m-2 people have birthdays differing from each other and the pair who share a birthday. You are really close. What you have calculated is the probability that a specific pair of people share a birthday, while all others have a different birthday (as opposed to "no more than two share the same birthday"). But it could be any pair of people chosen from m people who are the lucky ones who share a birthday. So your answer is too small by that factor. Hope that helps.
 
  • #3
techmologist said:
I take the problem to be asking the probability that there is exactly one pair of people with the same birthday, so that the case of a pair born on June 15th and a pair on July 3rd does not satisfy the conditions of the problem. All other m-2 people have birthdays differing from each other and the pair who share a birthday. You are really close. What you have calculated is the probability that a specific pair of people share a birthday, while all others have a different birthday (as opposed to "no more than two share the same birthday"). But it could be any pair of people chosen from m people who are the lucky ones who share a birthday. So your answer is too small by that factor. Hope that helps.

Thanks for the response. I see what you are saying, but since multiplication is commutative, aren't I calculating the probability that no more than two people share the same birthday? Consider the case with m = 4 (so 4 people in the room).

The first person can have any birthday with probability: 365/365
The second person can have their birthday only on one day (to agree with the first, to make a pair): 1/365
The others need to have different birthdays, so: 364/365 and 363/365 for the last two people

So,
P(no more than 2 people have the same birthday) = 365/365*1/365*364/365*363/365

Now, the way I am thinking about it, it doesn't matter in what order I choose these people, the probabilities will still be the same, meaning I would get the same answer? Does this make sense?
 
  • #4
Okay, here's an idea, since I am only considering one specific pair, but it could me any pair out of m, does that mean I need to multiple the entire thing by (m-1)! since there are m people but two are paired, so there are m-1 "groups", with all but 1 group only having 1 person?
 
  • #5
hadron23 said:
Consider the case with m = 4 (so 4 people in the room).

The first person can have any birthday with probability: 365/365
The second person can have their birthday only on one day (to agree with the first, to make a pair): 1/365
The others need to have different birthdays, so: 364/365 and 363/365 for the last two people

So,
P(no more than 2 people have the same birthday) = 365/365*1/365*364/365*363/365

Your reasoning and calculation are both correct, but neither one corresponds to the situation "no more than 2 people have the same birthday". If you look at the words you used to reason it out, you'll see what I mean. You have calculated the probability that the first person and the second person have the same birthday, while the third and fourth people have birthdays differing from each other and the first two people. But now you also need to consider the possibilities of the first and third, first and fourth, second and third, ...(and so on), people sharing a birthday. There are six such pairs, so you multiply your answer by six.

Now, the way I am thinking about it, it doesn't matter in what order I choose these people, the probabilities will still be the same, meaning I would get the same answer? Does this make sense?

It's true that it doesn't matter what order you use to calculate the probability for the "next person." For instance, let's say you randomly assigned each person a different number 1 through 4. If you wanted to calculate the probability that only persons 1 and 2 share a birthday, you could calculate like this:

There are 365 choices for the birthday that 1 and 2 share, 364 choices for 3's birthday, and 363 choices for 4's birthday. To get the probability, you multiply these together and divide by 365^4, the total number of possible birthday combinations for 4 people. But as you said, the order didn't matter. You could have just as easily calculated it like this:

There are 365 choices for 3's birthday, 364 choices for the birthday that 1 and 2 share, and 363 choices for 4's birthday. You get the same result. But note that it does matter that 1 and 2 are the people who share a birthday. That's why you have to consider all six possible pairs. When you were doing the problem where nobody has the same birthday, you didn't run into this problem because there is only one way for all m people to be unpaired (by birthday).

Okay, here's an idea, since I am only considering one specific pair, but it could me any pair out of m, does that mean I need to multiple the entire thing by (m-1)! since there are m people but two are paired, so there are m-1 "groups", with all but 1 group only having 1 person?

That's almost right. You don't need to worry about the total number of arrangements of different groups. Just think about the total number of ways to form a pair of from m people. In the case m=4, you can list them

12, 13, 14,
23, 24,
34

The order of the people in the pair doesn't matter, so that 13 and 31 are the same pair of people, and are not counted as separate pairs.
 
  • #6
Okay, that makes much more sense. So I guess generally speaking, the final equation would be,

(m choose 2)*365!/[(365-m+1)!*365^m]

Where the (m choose 2) term just takes into account all the possible ways to form a pair. Thanks again for the help.
 
  • #7
no problem :smile:
 
  • #8
Hi, I have problem with your explanation.

Assume that we have four persons.

P(nobody shares same birthday) = 365/365 X 364/365 X 363/365 X 362/365 = 47831784/48627125

P(2 persons share same birthday) = 365/365 X 1/365 X 4C2 X 364/365 X 363/365 = 792792/48627125

P(3 persons share same birthday) = 365/365 X 1/365 X 1/365 X 4C3 X 364/365 = 1456/48627125

P(4 persons share same birthday) = 365/365 X 1/365 X 1/365 X 1/365 X 4C4 = 1/48627125

I think I have included all possible outcomes. If I add up all these 4 probabilities (47831784/48627125 + 792792/48627125 + 1456/48627125 + 1/48627125), the answer will not be exactly 1, it will be close to 1 only (48626033/48627125).

Can anyone explain to me?
 
  • #10
weibing86 said:
I think I have included all possible outcomes. If I add up all these 4 probabilities (47831784/48627125 + 792792/48627125 + 1456/48627125 + 1/48627125), the answer will not be exactly 1, it will be close to 1 only (48626033/48627125).

Can anyone explain to me?

You've missed one outcome: 2 people share a b/day and another 2 people share a b/day on the same day. The case you quoted "2 people share same b/day" implicitly assumes that the other people have different birthdays.

See this for the explicit formula which should give you the missing probability: http://mathforum.org/library/drmath/view/56650.html
 
  • #11
It may be useful if you think the problem with an image of distributing m balls in N cells.
Your problem is equivalent to this one:
You have N=365 cells, one for each day of the year, and you have to distribute m balls (people) into these cells.
What you are asking for is the probability that exactly one cell results with double occupancy.
I think this image can help you to solve the problem.

After that, more questions may arise:

1) Probability of having exactly 2 cells with double occupancy.
2) Probability of having exactly 1 cell with double occupancy and 1 cell with, say, triple occupancy.
3) And so on...
 
  • #12
Suppose we wanted to calculate the probability that at least 2 people share a birthday with someone else. So we don't care about the birthdays of the others.

By the weibing's method, wouldn't this be given by

365/365 * 4C2 * 365/365 * 365/365 ?

This clearly isn't right since adding the result to the probability that no one shares birthday gives a number greater than 1. What's wrong?
 
  • #13
Hi ndrue.
In order to calculate the probability that at least 2 people share a birthday it is easier to calculate the probability of the complementary event, that is, the probability that no birthday coincidences at all.
That is the same as distributing m balls in N cells and ask for the probability of no cell with two or more balls.
In your problem, N=365 and m is the number of people.
 
  • #14
Yes I know that, but my question was why that calculation is wrong when it appears to follow the same logic of another, correct calculation.

Perhaps this would be a better question: what is the probability that at least one cell has exactly 2 balls (people)? For N people, would this not be

NC2 * (364/365)^(N-2) ?
 
  • #15
Hi again ndrue.
Your question is not a trivial one. So, let us proceed from the very beginning:
Let r be the number of balls (people) to be distributed in n cells (n=365).
First of all, let us focus ourselves in a prescribed cell, say cell i.
If you call a success the event that cell i be occupied and a fail that cell i remain empty, then you can see our experiment as the succession of r Bernoulli trials, with probability p=1/n of success and probability (1-1/n) of fail.
So, if we ask for the probability [itex]p_{k}[/itex] that cell i contains exactly k balls, then

[itex]p_{k}[/itex]=[itex]\left(\stackrel{r}{k}\right)[/itex][itex]\frac{1}{n^{k}}[/itex][itex](1-1/n)^{r-k}[/itex] (binomial distribution)

The probability you wrote in your last post is "approximately" this one, with r=N (total people), k=2 (people with the same birthday) and n=365.

From here you can see what your mistake was:

First, you lack the factor 1/[itex]n^{k}[/itex]=1/[itex]365^{2}[/itex], that is the probability of two sucesses in cell i.

And second, [itex]p_{k}[/itex] is the probability that a prescribed cell (cell i) contains k balls. That's still very far away from the probability you were asking for, I mean, the probability that "at least" one cell contains exactly 2 balls.

In order to find the probability you are asking for, you must continue:

Up to now we have the probability that a prescribed cell (cell i) contains k balls, [itex]p_{k}[/itex].

Next step is asking for the probability that at least one cell contains exactly k balls.
Let [itex]A_{i}[/itex] be the event that cell i has exactly k balls.
Then the event that at least one cell contains exactly k balls will be

A=[itex]\bigcup^{i=1}_{n}[/itex][itex]A_{i}[/itex]

in words, this means

At least one cell contains exactly k balls = (Cell 1 contains exactly k balls) or (Cell 2 contains exactly k balls) or (Cell 3 contains exactly k balls) or ... or (Cell n contains exactly k balls).

So the probability you are asking for is p(A).

By the moment, I will stop here.
You may try to go on.

By the way, I recommend you reading some chapters of the book "An introduction to Probability Theory and Its Applications - Vol.I 3rd.Ed." by William Feller.
It is not an easy book, but at the level of this post (say chapters I,II and IV), to me is one of the best books I've ever found on probability. It's not suitable as a classical textbook, but it's very useful in order to clarify and "illuminate" some basic concepts and intuitive ideas that most of the classical textbooks hide behind theorems,lemmas,corollaries and proofs.
 
Last edited:
  • #16
Thanks for your help. Now I understand why weibing's calculation works:

(1/365)^2 * 4C2 * 364/365 * 363/365

is the probability that two people share the some specified birthday d, AND the other two birthdays are different. Because these events are disjoint for each d, we can multiply by 365 to get the probability that 2 persons share same birthday, and the other two birthdays are different. We can't do this for my question because the A_i aren't disjoint.
 

1. How likely is it for exactly 2 people to have the same birthday in a group of 23 people?

The probability of exactly 2 people sharing the same birthday in a group of 23 people is approximately 50%. This is due to the birthday paradox, which states that in a group of 23 people, there is a 50% chance that at least 2 people will have the same birthday.

2. What is the probability of exactly 2 people having the same birthday in a group of 365 people?

The probability of exactly 2 people sharing the same birthday in a group of 365 people is approximately 97%. This is due to the fact that as the group size increases, the likelihood of two people sharing the same birthday also increases.

3. Does the probability change if we consider leap years?

Yes, the probability changes if we consider leap years. In a group of 23 people, the probability of exactly 2 people sharing the same birthday is approximately 49.3% if we consider leap years, compared to 50% if we don't consider leap years.

4. How does the probability change as the group size increases?

The probability of exactly 2 people sharing the same birthday increases as the group size increases. For example, in a group of 50 people, the probability is approximately 97.5%, while in a group of 100 people, the probability is approximately 99.97%.

5. Is the birthday paradox applicable to any other scenarios?

Yes, the birthday paradox is applicable to other scenarios where there is a large number of possibilities and a relatively small number of samples. For example, it can be applied to the probability of two people in a room sharing the same birth month or the same birth year.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
3K
  • Precalculus Mathematics Homework Help
Replies
9
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
5K
  • Precalculus Mathematics Homework Help
Replies
3
Views
941
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
  • General Math
Replies
2
Views
6K
Back
Top