Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes. How many people do you need in a room to be confident that one of them has the same birthday as you?


Assuming a uniform distribution, the probability is 1/365 for any person#. Those probabilities add up linearly if the people are guaranteed to have different birthdays (union/OR). Otherwise the probability of NOT having someone with the same birthday goes down exponentially as a an exponential power of the fraction 364/365 (intersection of complement/AND NOT)

It’s exactly what you would expect from classical combinatorics with cards with or without replacement. Your term “confident” is vague.

I produced a series called Thinking Mathematically on youtube that makes all of this and other related topics clear for anyone... I recommend checking it out!

https://m.youtube.com/channel/UCuge8p-oYsKSU0rDMy7jJlA

And here are the notes for it

http://magarshak.com/math/numbers.pdf

http://magarshak.com/math/sets.pdf

http://magarshak.com/math/logic.pdf

# if we exclude all people born leap years


> Assuming a uniform distribution, the probability is 1/365 for any person#. Those probabilities add up linearly if the people are guaranteed to have different birthdays (union/OR). Otherwise the probability of NOT having someone with the same birthday goes down exponentially as a an exponential power of the fraction 364/365 (intersection of complement/AND NOT)

Why would we assume a uniform distribution of birthdays? For example, birthdays occurring on the 31st of a month are probably less likely to occur on average given that every month does not have 31 days. This is just one example and doesn't even go into seasonality of conception cycles.


To simplify. Mathematical models don’t perfectly capture all the details usually.


You need 253 people in the room to have > 50% probability that one will have the same birthday as you.

1 - ((365 - 1)/365)^253 = 0.5005


If birthdays are assumed to be distributed symmetrically. If you were born in august you'd need ~12 fewer people and for April you'd need ~12 more.[1]

Not sure how that looks for the worlds population probably averages out pretty well regardless.

[1]: https://www.panix.com/~murphy/bday.html


How confident? Even with an even distribution of birthdays it's possible to have a billion people in the room that don't share your birthday. Very unlikely, but as there's only about 20 million people with your birthday, and 7 billion without, it's quite doable.


"Very unlikely" is a severe understatement. With only 100k people, the odds of no one else having your birthday is 10^-120. With a million people, it is 10^-1192.

And with a billion people... apparently, there are over a million zeroes between the decimal place and the first non-zero number. That is a pretty damn small probability.

Here is the code I used in python 3:

   from decimal import Decimal
   print((Decimal(364) / Decimal(365)) ** num_people)


quite, hence "how confident"

There's other things as play. Imagine you, born on July 15th, walked into a room with 1000 people. You'd be fairly confident someone will be born on July 15?

What if I then told you it was the annual astrology get together of Capricorns?


Sure, but you did say "even distribution".




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: