How different do random seeds need to be?

前端 未结 6 1356
情深已故
情深已故 2020-12-06 16:28

Consider code like this (Python):

import random

for i in [1, 2, 3, 4]:
    random.seed(i)
    randNumbers = [random.rand() for i in range(100)] # initialize         


        
6条回答
  •  太阳男子
    2020-12-06 17:12

    The seeds themselves should be random so that the output is unpredictable. There can be problems if the seeds differ only in one or two bits (as this question demonstrates).

提交回复
热议问题