# About Birthday problem: Counting the configurations where people share birthday instead of configurations where people do not share brithday!

About Birthday problem. suppose we have 30 people in the room. Is it more likely that some two people in the room share the same birthday or that no two people in the room share the same birthday?

in the book [Mitzenmacher and Upfal's textbook, p.90] he states the following: one way to calculate this probability is to directly count the configurations where two people do not share a birthday. It is easier to think about the configurations where people do not share a birthday than about configurations where some two people do. So he do the following: $\dfrac{\binom{365}{30}30!}{365^{30}}$. Now, I want to calculate the probabilities by counting the configurations where people do share the birthday exactly.

So, for simpler I suppose I have n=4. Then this is how I do the calculations:

$Pr[\text{two people share the same birthday}]=\dfrac{\binom{365}{1} \binom{4}{2} \binom{364}{2} 2! }{365^4} + \dfrac{\binom{365}{2} \binom{4}{2} \binom{2}{2} \binom{363}{0} 0!}{365^4} = 0.0163259498$

(Notice that in order to calculate the probabilities of event where two people share the same birthday, then we have two cases: one event where one pair (2 people) share birthday and the rest (2 people) have different birthday. The second event is two pairs (4 people) share birthday [each pair have different birthday from each other] and the rest (0 people) have different birthday. In first event, we choose 1 day for the first pair times choose 2 people for this day times choose different days for the rest of people times different way to choose this day. The same analysis in the second event applies) while in the other ways it is: $Pr[\text{two people share the same birthday}]=1-\dfrac{\binom{365}{4}4!}{365^{4}}=0.0163559125$.

Now I was thinking they are not equal exactly? as you see they are equal up to four digits after zero. Thus, I do not know if I did wrong here or miss something or it shouldn't equal. So, my question is: Why it doesn't equal exactly?

**The reason why I do this is I have an exercise says: In a lecture hall containing 100 people, you consider whether or not there are three people in the room who share the same birthday. see solution here. Thus, he used the way where he counts all configurations where people do share a birthday. So, I just want to do it for "two people share birthday" instead of "3 people share birthday".

Thank you!

The probability exactly three out of four share a birthday is $\dfrac{{4 \choose 3} \times 365 \times 364}{365^4} \approx 0.00002994214$
The probability exactly four out of four share a single birthday is $\dfrac{{4 \choose 4} \times 365}{365^4} \approx 0.00000002056465$
Add these together and you get the difference between $0.0163559125$ and $0.0163259498$ (up to rounding). It all depends on what "two people share the same birthday" is intended to mean