In Happy Birthday
, the question was if there are N people in a room, what is the probability that there are at least two people in the room who share a birthday?
What if instead exactly two was required? If there are N people in a room, what is the probability that there are exactly two people in the room who share a birthday?
(Note: Assume leap year doesn't exist, and the birthdays are randomly distributed throughout the year.)
So the first n-1 people in the room have different birthdays
and the nth person has the same as one of the prior n-1
Therefore the probability of exactly two having the same birthday is
P = (365!/(365-n)!)*(n-1)/365^n