Dealing with huge and tiny numbers

Consider a process which has a tiny probability of success. When we say tiny, we are talking about numbers at the order of \(10^{-15}\) or smaller. The process might be repeated many times, and when we say many, we are talking about numbers at the order of \(N\sim 10^{15}\) or more. How do you compute the probability of being successful at once?

Such problems appear in quantum mechanical tunneling processes or data durability calculations with rare unrecoverable errors (see this post for an example). A direct numerical computation will require operations on \(p\) which may be beyond the default numerical precision. One can probably increase the precision. However, as we will show below it may not be necessary.

At any attempt, the probability of failure is \(1-p\). The probability of failing at all \(N\) attempts is \((1-p)^N\) which means that being successful at least once is \(1-(1-p)^N\). \[\begin{equation} P=1-\left(1-p\right)^N=e^{N \text{ln}\left(1-p\right)}= e^{N(-p+\mathcal{O} (p^2))}\simeq e^{-Np}. \tag{1} \end{equation}\] Note that the large number \(N\) and the small number \(p\) are nicely combined into a multiplication, which will neither too small nor too large. It won’t require special treatment. If \(p\) and \(N\) are numbers to be provided by user, one can request the user to enter them in certain units. For example \(p\) can be measured in the units of \(10^{-15}\), and \(N\) can be measured in \(10^{15}\) so that the units cancel out leaving only the coefficients to multiply.

And that is how you can handle very large and tiny numbers in cases similar to this one.

Related