[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about RNGs used in oct files, and multiple instances of Oct
From: |
Francesco Potortì |
Subject: |
Re: Question about RNGs used in oct files, and multiple instances of Octave |
Date: |
Mon, 02 Jun 2014 00:51:41 +0200 |
>If you are using multiple generators in parallel, if at some point the
>internal states of some generators become the same, they are now
>dependent. They are perfectly correlated with each other.
>
>It is also possible for generators to become in step with each other,
>which is just as bad (one sequence becomes the other sequence after a
>lag).
>
>I would suggest that if you are running a stochastic program on a
>cluster of machines, and need to be sure about randomness, you get
>hardware random number generators to generate true random numbers. If
>nothing else, they are probably faster (or could be).
From a mathematical point of view, you are right. From a human point of
view, that depends on numbers. The Mersenne twister used by Octavés
rand function has a period of 2^{19937}-1, which is about 1e6000.
Unless I'm mistaken, this means that if you run, say, 1e5 independent
generators each choosing a different seed and generating 1e9 random
numbers, the collision probability is around 10^-(6000-9-5-5), which is
incredibly low.
--
Francesco Potortì (ricercatore) Voice: +39.050.621.3058
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Skype: wnlabisti
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it