Question

I have a quite simple question: When we take the Mersenne Twister -19937 generator and we fix the seed, then everytime we call the generator it produces a sequence of numbers that have some characteristics (independence, uniform distribution). What is of importance here is the Independance (or low correlation between 2 consecutive calls).

Now, what happens if I have two instaces of Mersenne Twister -19937 with different (but fixed) seeds and I call each generator once. How is the independance, correlation structure of the two sets of Random numbers I get in this case?

Many Thanks

Was it helpful?

Solution

The "guarantee" isn't there anymore. It's quite possible to have a random generator that produces the exactly same values for two different seeds.

This isn't an issue unless you depend on some behaviour of the randomness. The main point of course being cryptography - cryptographical random number generators try very hard to be very random even when you eg. run 10 generators in parallel. However, that kind of defeats the purpose of repeatability (eg. procedural generation etc.).

However, the two generators do keep their guarantees independently. This means that as long as they don't "interact" (eg. two zones in a game, each with their own generator), the randomness will be preserved.

A good rule-of-thumb is to test it (unless the randomness is critical, then it's math all the way :)). Plot graphs. Find out in the real world :)

EDIT: Since you've added the specific algorithm, let me expand the answer a bit. Mersenne twister is quite random. However, the randomness is very much dependent on the initial value. For some seeds, it could produce very random values even having a few parallel generators. For some seeds, the results are very close to each other. As wiki points out:

A consequence of this is that two instances of the generator, started with initial states that are almost the same, will output nearly the same sequence for many iterations before eventually diverging.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top