# The Probability of an event occuring an exact amount of times

Suppose there are 40 people in a room and I want to know the probability of exactly 2 people having the same birthday (excluding leap years). The probability of two people having the same birthday is $\displaystyle \left(\frac{1}{365} \right)^2$. So out of the 40 people, if I only want 2 people to have the same birthday, then the probability should be $\displaystyle \left(\frac{1}{365} \right)^2 \binom{40}{2}$.

Could someone check my reasoning?

-
Use the same reasoning with the population of the entire earth. Do you think the probability $$\left(\frac{1}{365}\right)^2\binom{\approx 7\times 10^9}{2}\ggg 1$$ makes sense? –  Zev Chonoles Feb 10 '13 at 0:14
@ZevChonoles: No you're right, my reasoning is definitely off. Could you give me a hint as to how to proceed? –  Student Feb 10 '13 at 0:16
It requires a Permutation and the number of days in a year raised to an exponent. –  user42538 Feb 10 '13 at 0:20
Once you've choosen two people to have the same birthday, you're not taking into account that the other 38 people have distinct birthdays (both amongst themselves and from the two people with the same birthday). Also, the probability that two people have the same birthday is $1/365$, not $(1/365)^2$. –  David Mitra Feb 10 '13 at 0:21
Actually, give two people, the probability for them to have the same birthday (using the standard idealizations about birthday problems) is $1/365$, not $(1/365)^2$. The latter is the probability that both are born on February 10, and doesn't count the possibility that they may share a different date. –  Henning Makholm Feb 10 '13 at 0:23
I see that the first question is $365^{40}$. Would the second be $\binom{40}{2}$? –  Student Feb 10 '13 at 0:43
Think about how you answered question 1, and you will see that $\binom{40}{2}$ is not giving the same information. If exactly 2 people share the same birthday, that means that the remaining 38 people must have different birthdays from each other and from the two who have the same birthday. Think of a simpler case where you have three people, can you answer the question then? –  Carl Morris Feb 10 '13 at 23:49