Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good way to select random seeds for scientific experiment in Python

Tags:

python

random

For an scientific experiment I need to generate 10 random, fixed-size, subsets of a list. For the experiment to be repeatable I want to initialize 10 different instances of random.Random() with a known seed.

How different do random seeds need to be? seems to suggest that using seeds 1 to 10 might be a bad idea, as the results could be linear dependent.

If it is a bad practice to pick seeds 1 to 10 for this case, what would be a good strategy for selecting seeds in a repeatable manner?

Clarification: it is important that always the same seeds are used when the program is run (with a specific dataset)! In the end my program must be deterministic.

like image 870
Peter Smit Avatar asked Oct 29 '13 13:10

Peter Smit


1 Answers

Using random.org, I generated 10 random numbers from 2**0 to 2**28, giving as seeds:

187372311
204110176
129995678
6155814
22612812
61168821
21228945
146764631
94412880
117623077

Using a linear sequence of seeds can be problematic as noted in the comments. The numbers from random.org:

[...] come from atmospheric noise, which for many purposes is better than the pseudo-random number algorithms typically used in computer programs.

like image 133
Hooked Avatar answered Oct 29 '22 18:10

Hooked