Python limitation random.shuffle

From the Python documentation for random.shuffle, which takes a list and randomizes the order if its elements:

Note that for even relatively small len (x) the total number of permutations x is greater than the period of most random numbers generators; this means that most permutations of a long sequence can never be generated.

Is this true for any language since the constraint seems dependent on a random number generator? Is it possible to write a function that can generate any possible permutation of an arbitrarily long list?

+5
source share
2 answers

. http://mail.python.org/pipermail/python-ideas/2009-March/003670.html. , , PRNG, .

, @TryPyPy, Python, , . , , :

  • p
  • , x, PRNG
  • p[x]

p x, PRNG, .

- , , , , , , .

+3

, . , random.SystemRandom .

, , , - , .

+2

All Articles