[Python-ideas] random.choice on non-sequence

Ian Kelly ian.g.kelly at gmail.com
Thu Apr 14 04:03:00 EDT 2016

On Thu, Apr 14, 2016 at 12:03 AM, Greg Ewing
<greg.ewing at canterbury.ac.nz> wrote:
> Steven D'Aprano wrote:
>> A formal and precise treatment would have to involve calculus and limits
>> as the probability approaches zero, rather than a flat out "the probability
>> is zero, therefore it's impossible".
> The limit of p = 1/n as n goes to infinity is zero.
> Events with zero probability can't happen. I don't
> know how it can be made more rigorous than that.

This only holds true if the sample space is finite. The mathematical
term for an event with zero probability that nonetheless can happen is
"almost never".

See https://en.wikipedia.org/wiki/Almost_surely

As usual, infinity is weird.

More information about the Python-ideas mailing list