3 ms·
The funniest example of how that's just probability was when this problem was discussed in my bachelor's class of about 60 people, and the prof confidently star
by param 17y ago
The funniest example of how that's just probability was when this problem was discussed in my bachelor's class of about 60 people, and the prof confidently starts asking us for our dates of birth, and there was not even 1 matching pair. The probability is apparently around .01%
- swillden 17y ago365! / ((365-60)! 365^60) = 0.0059 So it's about 1%, assuming uniform distribution of birthdays. Since they're not quite uniformly distributed, the actual odds of 60 people with no common birthdays is a little lower than that. However, given the thousands of people reading HN who experienced such a classroom exercise, the odds are very good that someone like you will pipe up ;-)
- jonknee 17y agoWe discussed this in an Algebra class during highschool--she actually sat us by birthdate. Turns out two people shared my birthday and she made us take out our IDs because she thought it was some sort of ruse. 10% of the class with the same birthday is a bit odd, but we all had fun calculating the actual odds.
- paulgb 17y agoOut of curiosity, how did the class determine whether anyone shared a birthday? The best way I can think of is lining up by order and then seeing if your neighbors share your birthday. Is that how you did it? Is there a better way to do it?
- param 17y agoeveryone says out their birthday in order of seating(randomly seated). If someone hears their birthday, they shout out of turn. I guess you were expecting an algorithm faster than O(n)? That was the best we could do, given n processors with O(1) space each :-D