On 02/27/2014 10:04 PM, mpender wrote:
should be some efficient way to extract multiple bits from a single
double-precision floating point value returned by the Mersenne twister.
in general, it's a bad idea to extract bitfields from a
pseudo-random number generators (it's also famously bad to
aggregate consecutive values, as shown by classic Marsaglia paper
http://www.pnas.org/content/61/1/25.full.pdf)
Now, the Mersenne twister may not be subject to those problems, but
one should refrain from using the generators in a way that they
weren't designed or tested for. Hence, it's best to use randi()
which just plain gives integers without any gymnastics.
|