Questions tagged «birthday-paradox»

11
随机根本就不是随机的吗?
我这样做是为了测试randint的随机性: >>> from random import randint >>> >>> uniques = [] >>> for i in range(4500): # You can see I was optimistic. ... x = randint(500, 5000) ... if x in uniques: ... raise Exception('We duped %d at iteration number %d' % (x, i)) ... uniques.append(x) ... Traceback (most …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.