Skip to content

Instantly share code, notes, and snippets.

@garrettr
Created July 12, 2013 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrettr/5988727 to your computer and use it in GitHub Desktop.
Save garrettr/5988727 to your computer and use it in GitHub Desktop.
Probability of a specific hash collision
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