Testing random

random832 at fastmail.us random832 at fastmail.us
Sun Jun 7 21:57:03 EDT 2015


On Sun, Jun 7, 2015, at 21:42, Chris Angelico wrote:
> On Mon, Jun 8, 2015 at 11:34 AM,  <random832 at fastmail.us> wrote:
> > In general, as the number of trials increases, the probability of having
> > e.g. at least one of each value never _reaches_ 1, but it gets
> > arbitrarily close.
> 
> And by "arbitrarily close", you mean any of:
> 
> * So close to 1.0 that IEEE double precision is unable to represent it
> * So unlikely that you could perform one trial every nanosecond until
> the heat death of the universe and still not expect to see it
> * Less likely than that two files could accidentally collide on MD5,
> SHA1, SHA256, and file size, simultaneously
> 
> I think all of the above are true of this case, though I have to guess
> about the heat death of the universe.

Well, yes (assuming, as you say, that the heat death of the universe is
a finite time). More precisely, "arbitrarily close" is a mathematical
term which means that for any desired distance from the limit, there is
an input that will cause the result to get closer. It's entirely
possible to select a number of symbols and a number of trials that won't
get you there.

I also think there may have been some confusion with some of us using
"trial" to refer to each individual random number, and some of us at
some times using it to refer to each attempt to generate a sequence of a
given length.



More information about the Python-list mailing list