Regarding probability and the birthday paradox

combinatoricspermutationsprobabilityprobability theory

I have a question which states that
"In a group of 23 people what is the probability that there are two people with the same birthday? Assume there are 365 days in a year. Ignore leap years and such complications. Assume there is an equal probability of a person being born on each day of the year.". I solved it using the complement. I first computed the number of ways in which we can assign the birthdays to 23 people out of 365 days (without replacement). That gave 365 * (365-1).. (365-k+1). Then I divided this by 365^k. Then I subtracted the result from 1. But, the probability which I have now got may also contain 3 people having the same birthday or 4 people having the same birthday, etc. I want to know the probability of exactly two people having the same birthday. In short, what I have computer is, " what's the probability that AT LEAST TWO PEOPLE HAVE SAME BIRTHDAY" and what I'm looking for is "WHAT IS THE PROBABILITY OF EXACTLY TWO PEOPLE HAVING THE SAME BIRTHDAY".How do I compute that probability?

Best Answer

If by exaclty you mean any two peaople having same birthday and all the rest having different birthday, then we can do it for ingeneral having $i$ peaople out of $k$ with same birthday as follows:

For each fixed day of 365 days there are $\binom{k}{i}$ ways of chosing $i$ people having that day as birthday, by wich there are $364(364-1)(364-2)\ldots(364-k+i+1)$ ways of the rest $k-i$ people having different birthday, so the probability of exactly $i$ having the same birthday is $$P(i)=\frac{365\binom{k}{i}364(364-1)(364-2)\ldots(364-k+i+1)}{365^k}$$