http://qs321.pair.com?node_id=962888


in reply to Re^2: [OT] The statistics of hashing.
in thread [OT] The statistics of hashing.

You'd need a floating-point number with a mantissa of about 128 bits to hold the value of (1-1/2**128)

Luckily there are other ways to evaluate the expression. If we set x = 1/2**128, we can do a taylor series to evaluate (1-x)**n around x = 0 (and since x is very small, it's a good approximation:

(1 - x)^n = 1 - n * x + 1 / 2 * n * (n - 1) * x ** 2 + ...

Where higher orders can be neglected. If you chose an n that is high enough, you can get non-1 values as the result.

Though I'm not sure if that's really helpful. What you'd really need is the expectation value of the number of collisions (the lambda symbol in Poisson Distribution, then you could easily calculate everything you wanted.