Craig McQueen added the comment:
I notice that the C++11 library has a discard() member function for its random
generators, which is effectively a jumpahead operation. It seems that the C++11
library has implemented discard() for the Mersene Twister generator. If
jumpahead() is technically
Craig McQueen added the comment:
C++11 Mersenne Twister discard() member function:
http://www.cplusplus.com/reference/random/mersenne_twister_engine/discard/
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
Craig McQueen added the comment:
StackOverflow question about Mersenne Twister jumpahead:
http://stackoverflow.com/q/4184478/60075
which refers to this:
http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/JUMP/index.html
--
___
Python tracker
New submission from Joseph Schaeffer thir...@gmail.com:
Reading the Python 2.6 docs, it appeared that using random.jumpahead would
allow the initialization of several generators with the same seed but having
much different internal states. While the resulting PRNG appear to have
different
Changes by Ned Deily n...@acm.org:
--
nosy: +rhettinger
versions: -Python 2.5, Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
___
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
priority: normal - low
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9816
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Thanks for the report. Something does appear to be broken. When the states
are different, the random numbers should be different. Am looking in to it.
In the mean time, I recommend against using jumpahead() with MT. It
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
I see the problem now. Random.jumpahead(n) does a very poor job of shuffling
MT's state when n is small. The first few numbers of the state are different
but some of the later ones are not. When random() crawls across
Joseph Schaeffer thir...@gmail.com added the comment:
Thanks for looking into it! I'm glad that issue will be fixed, as at least one
website was actually recommending using .jumpahead(i) for i in 1..100 for
independent seed.
I suspect in my use case I'll want to continue my previous methods;