algorithm - mersenne twister - is there a way to jump to a particular state? -
i little unsure right forum question. between theoretical comp. sci./math , programming.
i use mersenne-twister generate pseudo random numbers. now, starting given seed, jump n-th number in sequence.
i have seen this: http://www-personal.umich.edu/~wagnerr/mersennetwister.html, , 1 scheme follows:
suppose, need first n numbers in complete random sequence particular seed s.
split sequence in p subsequences, march through n numbers, , save state vector of random number generator @ beginning of each subsequence.
reach n-th number, i'll see n falls in k-th subsequence , i'll load state vector subsequence , generate m consecutive random numbers m-th number in k-th subsequence same n-th number in complete sequence ( n = m + (k-1) * n/p ).
but state vector 624 x 4 bytes long! wonder if practically possible jump arbitrary element in mersenne-twister generated sequence.
yes possible! it's called jump ahead.
you can find details mersenne twister on homepage of mt's authors. code available scientific publications explaining algorithm:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/mt/jump/index.html
Comments
Post a Comment