I have an interesting question, namely
by using the famous mersenne twister std::mt19937 r
in the standard library (or any other random generator) and setting it up with a seed as r.seed(4)
for example it is possible to obtain uniformly random generated numbers (in the range uint_fast32_t
provides).
What exactly happens if we loop through the seed from say 1 till 100 and generate the first random number, is this sequence still uniformly distributed or not?
for(int i = 0;i<100;i++){
r.seed(i);
int v = r();
}
I have some algorithm which would be much easier to implement by using this trick instead of generating the number in the usual way (without resetting the seed everytime).
I actually don't believe that by misusing the generator like that, that the uniformity of the sequence can be maintained anymore.
Does anybody has the expertise to give some reasoning about this?
Thanks a lot!