As described in the documentation, random.random will "return the next random floating point number in the range [0.0, 1.0)"
So what is the chance of it returning a 0?
As per the documentation, it
It produces 53-bit precision
And the Mersenne Twister it is based on has a huge state space, many times large than this. It also routinely passes statistical tests of bit independence (in programs designed to spot patterns in RNG output). The distribution is essentially uniform with equal probability that any bit will be 0 or 1.
The probability of getting precisely 0.0 will be 1 in 2^53 (assuming an unknown internal state)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With