Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Birthday attack
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Simple approximation=== A good [[rule of thumb]] which can be used for [[mental calculation]] is the relation :<math>p(n) \approx {n^2 \over 2H}</math> which can also be written as :<math>H \approx {n^2 \over 2p(n)}</math>. or :<math>n \approx \sqrt { 2H \times p(n)}</math>. This works well for probabilities less than or equal to 0.5. This approximation scheme is especially easy to use when working with exponents. For instance, suppose you are building 32-bit hashes (<math>H = 2^{32}</math>) and want the chance of a collision to be at most one in a million (<math> p \approx 2^{-20} </math>), how many documents could we have at the most? :<math>n \approx \sqrt { 2 \times 2^{32} \times 2^{-20}} = \sqrt { 2^{1+32-20} } = \sqrt { 2^{13} } = 2^{6.5} \approx 90.5 </math> which is close to the correct answer of 93.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)