Michael D. answered 06/21/25
PhD in Math; 15+ years teaching Probability within various courses
This is a standard probability question with some necessary assumptions that aren't often stated explicitly. We usually assume 365 days in a year and that the probability that a randomly-selected person's birthday is on a given day of the year is equally likely for all days of the year (which is completely invalid in the real world, but other the problem is not solvable without further information).
Instead of directly computing the probability that (at least two people have the same birthday), it's easier to compute the probability that (no two people have the same birthday), then use the Complementary Events Rule. With that in mind....
If there are two people in the room, the probability that they do NOT have the same birthday is 364/365 (once you know the first person's birthday, there are 364 valid days for the second person, out of 365 total days.
For three people in the room, what you actually compute is the probability that (person 3 has a different birthday) AND (persons 1 and 2 have different birthdays). This is done by the Multiplication Rule:
P(A AND B) = P(B) x P(A|B)
We computed P(B) = P(persons 1 and two have different birthdays) = 364/365 above. The probability that p(person 3 has a different birthday) GIVEN (persons 1 and 2 have different birthdays) is, by the same idea as above, 363/365. Thus the probability that 3 people all have different birthdays is
(364/365) x (363/365)
This idea extends to 4, 5, ..., 23 people. The probability that 23 people all have different birthdays is
(364/365) x (363/365) x (362/365) x ... x (343/365) = 0.00135...
Thus the probability that at least two have the same birthday is 1 - 0.00135 = 0.99865...