Created
July 12, 2013 23:59
-
-
Save garrettr/5988727 to your computer and use it in GitHub Desktop.
Probability of a specific hash collision
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: from __future__ import division | |
In [2]: n = 2**32 | |
In [3]: p = 1 - ((n-1)/n)**1000000000 | |
In [4]: p | |
Out[4]: 0.2077122589016286 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment