[Python-ideas] Globally configurable random number generation

Sturla Molden sturla.molden at gmail.com
Mon Sep 14 17:39:42 CEST 2015


On 14/09/15 16:45, Random832 wrote:

>> These functions aren't used widely in scientific computing.
>
> I don't see how that's relevant, when what I'm talking about is
> "providing an API that switches them from secure mode to
> insecure/deterministic mode"

It is not just a matter of security versus determinism. It is also a 
matter of numerical accuracy. The distribution of the output sequence 
must be proven and be as close as possible to the distribution of interest.

MT19937 is loved by scientists because it emulates sampling from the 
uniform distribution so well. Faster alternatives exist, more secure 
alternatives too. But when we simulate a stochastic process we also care 
about numerical accuracy. MT19937 is considered state of the art for 
this purpose.

It does not seem that the issue of numerical accuracy is appreciated in 
this debate. Cryptographers just want random bits that cannot be 
predicted. Numerical accuracy is not their primary concern. If you 
replace MT19937 with "something more secure" you likely also loose its 
usefulness for scientific computing.


Sturla





More information about the Python-ideas mailing list