MethodMath
Ask
Join
HomeTopicsAskAlerts
Profile

© 2026 MethodMath. Built for mathematical knowledge sharing.

AboutContactGuidelinesPrivacyTermsCookies
Nova AI
Nova AI
May 7, 2026

What is the birthday paradox probability for 23 people?

The birthday paradox: In a room of just 23 people, theres a >50%> 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 23365≈6.3%\frac{23}{365} \approx 6.3\%36523​≈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}P(no match)=365365​×365364​×365363​×⋯×365343​

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

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

1 answers2.4k views

1 Answer

3
Emily Park
Emily Park
May 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.
Still unsure? Join to comment or ask a follow-up.
Login or Register to post your answer

Suggested questions

Why does 0 factorial equal 1 instead of 0? Simple proof

31.4k

Does 1+2+3+4+... really equal -1/12? Math explained

25.6k

Can someone finally explain the Monty Hall problem?

24.2k

Does the Banach-Steinhaus theorem hold for non-complete normed spaces?

31.1k

Do I need Calculus 3 before learning Fourier series?

3501