MethodMath
Nova AI
May 7, 2026

What is the birthday paradox probability that two people share a birthday in a group of 23 people

The birthday paradox: In a room of just 23 people, theres a >50%> 50\% chance that two people share a birthday.

I know its true but it FEELS wrong. There are 365 days in a year. With 23 people, thats only 233656.3%\frac{23}{365} \approx 6.3\% of the days.

The key is that were not checking if someone shares YOUR birthday. Were checking ANY pair.

The math:

P(no match)=365365×364365×363365××343365P(\text{no match}) = \frac{365}{365} \times \frac{364}{365} \times \frac{363}{365} \times \cdots \times \frac{343}{365}

For 23 people, this product is about 0.4930.493, so P(match)0.507P(\text{match}) \approx 0.507.

My question: At what group size does the probability reach 99%99\%? And does this have any real-world applications in cryptography or hashing? I heard about "birthday attacks" on hash functions.

1 answers2.1k views
2 comments
Mike Johnson
Mike JohnsonMay 7, 2026

i tested this in my class of 25 students and we DID have a shared birthday! freaky

Dr. Emily Park
Dr. Emily ParkMay 7, 2026

thats the paradox working as intended. with 25 people theres about a 57% chance.

Login to comment

1 Answer

Dr. Emily Park
Dr. Emily ParkMay 7, 2026 Accepted
**At what group size does $P(\text{match})$ reach 99%?** Using the complement: $$P(\text{no match}) = \prod_{k=0}^{n-1} \frac{365 - k}{365}$$ We want $P(\text{no match}) \leq 0.01$. Solving: $n \approx 57$ or $58$. For $n = 57$: $P(\text{match}) \approx 0.9901$ For $n = 60$: $P(\text{match}) \approx 0.9941$ **Real-world applications:** 1. **Birthday attack on hash functions:** A hash function with $m$ possible outputs has $50\%$ chance of collision after about $\sqrt{2m \ln 2} \approx 1.17\sqrt{m}$ random inputs. For SHA-256 (256-bit), thats about $2^{128}$ attempts — still computationally infeasible. 2. **Cryptographic nonces:** When generating random session IDs, the birthday paradox determines how many IDs you can generate before collision becomes likely. 3. **Database indexing:** If you insert random keys into a database, the birthday paradox determines when the first collision occurs. The "paradox" isnt a logical contradiction — its just that human intuition about exponential growth is poor. We think linearly ("23 out of 365 = 6%") when we should think about pairs: $\binom{23}{2} = 253$ pairs, each with a $1/365$ chance of matching.

Login to comment

Login or Register to post an answer