Python random.random - chance of rolling 0
<p>As described in the <a href="https://docs.python.org/3.4/library/random.html#random.random" rel="nofollow">documentation</a>, random.random will "return the next random floating point number in the range [0.0, 1.0)"</p>

<p>So what is the chance of it returning a 0?</p>

<p>As per the documentation, it </p>

<blockquote>
  <p>It produces 53-bit precision </p>
</blockquote>

<p>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.</p>

<p>The probability of getting precisely 0.0 will be 1 in 2^53 (assuming an unknown internal state)</p>

python random