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

I don't quite understand how the birthday paradox relates to your example. Your example is how a hash collision is a very low probability event. But the birthday paradox is typically stated as odds being much higher than you expect.

The hash collision problem is a birthday paradox, I suppose, but the probabilities are so low that that part isn't stressed in your post.

I feel like a better example of the Birthday Paradox would be something like:

I automatically give all my users a 5-character random ID. I figure there are nearly 12 million (26^5) combinations, so I should easily be able to support a hundred thousand users, since (naively) I calculate that the probability of the 1001st user matching any existing user is less than 1%. [1]

But if you calculate it correctly has the birthday paradox, you'll see that the probability of having a collision given 100,000 users is ~100%. [2]

[1] 1 - (1-(1/11881376))^100000 < 0.01

[2] 1 - (((11881376-1)/11881376)^((100000 * (100000-1))/2)) = 1



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

Search: