"JS" == Josef Schugt <Josef> writes:
JS> Saluton! * Harry Ohlsen; 2003-07-28, 21:35 UTC:
JS> Nobody did ask this so far: What kind of random numbers do you
JS> need and for what purpose.
JS> Ruby's RNG may be nice for Monte Carlo simulations (because it
JS> has a very large period) but it is NOT SECURE for CRYPTOGRAPHY
JS> as it is. You may wish to visit
JS>
http://www.math.keio.ac.jp/matumoto/emt.html
JS> Gis,
JS> Josef 'Jupp' Schugt -- N'attribuez jamais à la malice ce que
JS> l'incompétence explique ! -- Napoléon
Actually, Ruby's RNG isn't so great for Monte Carlo or discrete event
simulations. I'd only use it for games. The problem isn't the
quality of the generator (I think Matz is using the Mersenne twister
algorithm). It's that "randomness" is obtained by a method rather
than a Random class which can instantiate Random objects. If there
were separate random objects, each of which maintained its own seed
state, it would be much easier to create designed experiments with
common or antithetic random variates which you could exploit for
variance reduction. Having a method restricts you to a single stream
of randomness unless you're willing to go through contortions.
--paul