How many people do you need in the same room for the probability $p$ to be at least $0.5$ for two people to have the same birthday?
My idea is that for every pair of people the probability that their birthday is the same day is $\frac{1}{365}$, thus we need to count the pairs of people we can match and divide by $365$. If there are $n$ people in the same room there are $\binom{n}{2}$ pairs we can match. Therefore if we set $\frac{\binom{n}{2}}{365}=0.5$ and solve for $n$ we should find how many people are needed. $$\frac{\binom{n}{2}}{365}=\frac{\frac{n\cdot (n-1)(n-2)!}{2(n-2)!}}{365}=\frac{n(n-1)}{2\cdot 365}=0.5$$ $$n(n-1)=365$$ $$n^2-n-365=0$$ Using abc formula we get: $n \approx 19.5$ (since n must be positive).
However the correct solution is $n\approx 23$. So I am "close", but wrong. Where is my mistake?