3

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

VLT
  • 197
  • 1
  • 11
  • 2
    This question *must* be fixed to a specific generator. In general, anything could happen. A cryptographically strong generator will have no interrelation at all. The generator `return 0;` has a lot. – usr Mar 13 '14 at 09:52

1 Answers1

1

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.

Luaan
  • 62,244
  • 7
  • 97
  • 116
  • Thanks ! Will try to find out in the real world ! :) – VLT Mar 13 '14 at 10:06
  • Ok,thus choosing seeds that are quite different one from another should help in this matter – VLT Mar 13 '14 at 10:12
  • @VLT Indeed. However, that is trickier than it appears :D It might be possible to use a cryptographical RNG to generate the seeds for the different generators when creating them. However, that doesn't really guarantee anything either. Overall, focus on your practical cases. The only thing that really bothers you is if the fake-randomness becomes apparent to the observer (though note that people are notoriously overzealous in finding patterns even where there are none). – Luaan Mar 13 '14 at 10:21
  • The similar seeds issue is only valid if you don't use the default seeding algo of the Mersenne-Twister code but inputs directly state=seed. The default seeding algo will randomize and similar initial seeds will lead to a quite different state. – jherek Nov 20 '20 at 11:45