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?

  • $\begingroup$ It's a reasonable question to ask either way, but it's possible that the question you want to answer didn't expect you to be that specific, and just wants the probability you've found so far. $\endgroup$ Dec 8, 2021 at 16:12
  • $\begingroup$ But if we want to calculate the probability that I'm looking for, how can we do that? $\endgroup$ Dec 8, 2021 at 16:14
  • 1
    $\begingroup$ This is far more complicated. To clarify : You mean the event that there are two people having the same birthday and all the other people have another birthday and moreover distinct birthdays, so that we have just one "collision" ? $\endgroup$
    – Peter
    Dec 8, 2021 at 16:17

2 Answers 2


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}$$

  • $\begingroup$ I understood. The explanation was too clear. Thanks a lot!!:) $\endgroup$ Dec 8, 2021 at 17:00

The denominator is still going to be $365^k$.

In the numerator, we have:

  • $365$ ways to choose the repeated birthday;
  • $\binom{364}{k-2}$ ways to choose the birthdays that are not repeated;
  • $\frac12 k!$ ways to permute the resulting days, dividing by $2$ because the two repeated birthdays can be swapped.

So we get a probability of $$\frac{365 \cdot\binom{364}{k-2} \cdot \frac12 k!}{365^k} = \frac{k! \binom{364}{k-2}}{2 \cdot 365^{k-1}}.$$ Set $k=23$ to get the probability you want.

Another option for the numerator, which will get an equivalent answer. First, there are $\binom k2$ ways to choose which two people have the same birthday. Then, we can take the same product $365 \cdot 364 \cdot 363 \cdots$ to fill in the birthdays, but there is one difference. Once we pick the birthdays of one person in the repeated pair, we get the other one for free. So instead of having the $k$-factor product $365 \cdot 364 \cdots (365-k+1)$, we get the $(k-1)$-factor product $365 \cdot 364 \cdots (365-k+2)$.

The result is $$ \frac{\binom k2 \cdot 365 \cdot 364 \cdots (365-k+2)}{365^k}. $$

  • $\begingroup$ What do you mean by "365 ways to choose the repeated birthday"? $\endgroup$ Dec 8, 2021 at 16:24
  • $\begingroup$ We're looking for a situation in which one birthday occurs twice, and $k-2$ other birthdays only occur once, right? There are $365$ ways to choose the birthday that occurs twice. $\endgroup$ Dec 8, 2021 at 16:25
  • $\begingroup$ Honestly, this is too complicated to understand. But thanks for the help:) $\endgroup$ Dec 8, 2021 at 16:27
  • $\begingroup$ I've added another way to think about the answer; maybe that one will make more sense? $\endgroup$ Dec 8, 2021 at 16:32
  • $\begingroup$ Yes, it is making more sense now. Thanks a lot!! $\endgroup$ Dec 8, 2021 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .