[issue39867] randrange(N) for N's in same dyadic blocs have excessive correlations when sharing identical seeds

Tim Peters report at bugs.python.org
Thu Mar 5 17:25:06 EST 2020


Tim Peters <tim at python.org> added the comment:

Sorry, I don't see "a problem" here either.  Rounding instead can change the precise nature of the correlations if you insist on starting from the same seed, but it hardly seems a real improvement; e.g.,

>>> random.seed(12)
>>> [round(random.random() * 100) for i in range(10)]
[47, 66, 67, 14, 1, 37, 27, 81, 69, 60]
>>> random.seed(12)
>>> [round(random.random() * 101) for i in range(10)]
[48, 66, 67, 14, 1, 38, 28, 82, 70, 61]

That is, while there are fewer identical values, the correlation is nevertheless obvious and extreme.  Not only not a bug, it's not even surprising ;-)

----------
nosy: +tim.peters

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39867>
_______________________________________


More information about the Python-bugs-list mailing list