Random number generators discussion

Random number generators | www.agner.org

thread Question on seeding - Mike - 2008-01-02
last reply Question on seeding - Agner - 2008-01-03
Question on seeding
Author: Mike Date: 2008-01-02 22:57
Hi Agner,

In your description of the URNG classes you mention they are thread-safe and that each thread should have one instance that is initialised with a different seed e.g. by adding 1 to the seed for each new instance.
I was under the impression that this may be dangerous in certain circumstances e.g. it may introduce inter-thread correlations that mess up statistics on aggregrating results across threads.
Isn't this why the creators of MT came up with dynamic creator for parallel computing work?
Anyway, it would be great if you could shed some light on this subject for me.
Thanks a lot,

BTW - loved your work on optimisation

Question on seeding
Author: Agner Date: 2008-01-03 09:46
The generator is constructed so that it gives different sequences for different seeds. These sequences are sub-sequences of an extremely large full sequence. For all practical purposes you can assume that the sequences for different seeds are uncorrellated. It doesn't matter whether the seeds differ by just 1 or by a larger number.

There is a *theoretical* possibility that the subsequences overlap, which of course would make your calculations invalid. But this possibility is only theoretical. The probability that subsequences will actually overlap is so small that it will never happen. Mathematical purists may want to eliminate this possibility completely. That's why prof. Matsumoto has suggested using completely different parameters for each seed. This feature is not currently implemented in my software library. I may add it in the future when I get the time, but I am too busy on other projects right now.