[Python-Dev] a note in random.shuffle.doc ... (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Jun 12 02:27:49 CEST 2006
- Previous message: [Python-Dev] a note in random.shuffle.__doc__ ...
- Next message: [Python-Dev] a note in random.shuffle.__doc__ ...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Terry Jones wrote:
Suppose you have a RNG with a cycle length of 5. There's nothing to stop an algorithm from taking multiple already returned values and combining them in some (deterministic) way to generate > 5 outcomes.
No, it's not. As long as the RNG output is the only input to the algorithm, and the algorithm is deterministic, it is not possible get more than N different outcomes. It doesn't matter what the algorithm does with the input.
If you expanded what you meant by "internal states" to include the state of the algorithm (as well as the state of the RNG), then I'd be more inclined to agree.
If the algorithm can start out with more than one initial state, then the RNG is not the only input.
Worse, if you have multiple threads / processes using the same RNG, the individual threads could exhibit much more random behavior
Then you haven't got a deterministic algorithm.
-- Greg
- Previous message: [Python-Dev] a note in random.shuffle.__doc__ ...
- Next message: [Python-Dev] a note in random.shuffle.__doc__ ...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]