This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients christian.heimes, dstufft, martin.panter, rhettinger, tim.peters, vstinner
Date 2016-06-10.17:01:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1465578120.96.0.483387893793.issue27272@psf.upfronthosting.co.za>
In-reply-to
Content
With anything less than than full seeding of the 19937-bit state space, we lose all the guarantees (proved properties) documented at http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/ARTICLES/mt.pdf .  It is very nice to be able to rely on those properties and I don't think we should abandon them because glibc currently has lower standards (the trend is towards making seeding stronger rather than weaker).

"Good enough" for random number generators is in the eye of the beholder.  If your agenda is to reduce the number of bytes extracted from urandom(), it is easy to not care how well the MT is seeded, but there are people who do care (or should care).

Note that sampling and shuffling both eat entropy like crazy.  Currently, we have enough to shuffle 2000 elements.   With 128 bits, we run out at 34 elements, not even enough to shuffle a deck of cards and have each permutation as a possible outcome.

Over time, the random module has evolved away from "good enough" and traded-away speed in return for equi-distribution (i.e. we use _randbelow to get a balanced choice over ranges that aren't an exact power-of-two).

We should not allow a regression in quality.  In particular, I object to the cavalier assertion, "random.Random doesn't need a very high quality entropy."  If you're running multiple simulations, this is something you should care about.  And to defend against criticism of random samples, it is nice to be able to say you were properly seeded (see RFC 1750) and that you have some basis for believing that every outcome was equally likely.
History
Date User Action Args
2016-06-10 17:02:01rhettingersetrecipients: + rhettinger, tim.peters, vstinner, christian.heimes, martin.panter, dstufft
2016-06-10 17:02:00rhettingersetmessageid: <1465578120.96.0.483387893793.issue27272@psf.upfronthosting.co.za>
2016-06-10 17:02:00rhettingerlinkissue27272 messages
2016-06-10 17:01:59rhettingercreate