Message363461
@tim.peters yes, a uniform random variable rescaled to two nearby scales N and M will display strong correlations. The CPython randrange() exhibits however orders of magnitude higher such correlations, but only in relation to a common bitlength. A randrange() function should a priori not be so strongly tied to the binary base.
The example you show would not be counted as a hit by my test for the randomseed 12.
>>> s = 0
>>> for t in range(100000):
... random.seed(t)
... x = [round(random.random() * 100) for i in range(10)]
... random.seed(t)
... y = [round(random.random() * 101) for i in range(10)]
... if x == y:
... s += 1
...
>>> s
94
>>> s = 0
>>> for t in range(100000):
... random.seed(t)
... x = [random.randrange(100) for i in range(10)]
... random.seed(t)
... y = [random.randrange(101) for i in range(10)]
... if x == y:
... s += 1
...
>>> s
90432 |
|
Date |
User |
Action |
Args |
2020-03-05 23:00:34 | jfbu | set | recipients:
+ jfbu, tim.peters, rhettinger, mark.dickinson |
2020-03-05 23:00:34 | jfbu | set | messageid: <1583449234.64.0.135571531821.issue39867@roundup.psfhosted.org> |
2020-03-05 23:00:34 | jfbu | link | issue39867 messages |
2020-03-05 23:00:34 | jfbu | create | |
|