Generating a large random string
Sean Ross
sross at connectmail.carleton.ca
Thu Feb 19 20:14:08 EST 2004
"Jeff Epler" <jepler at unpythonic.net> wrote in message
news:mailman.88.1077235934.27104.python-list at python.org...
> I'm pretty sure that the two methods you mention don't give results with
> the same distribution.
[snip]
Yep. I made an error choosing random.sample() as its sampling is
done without replacement. See my subsequent post with a sample
function that uses replacement and allows for sampling beyond the
population size. That version has a better distribution:
{'11': 266, '10': 251, '00': 245, '01': 238}
More information about the Python-list
mailing list