A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-June/065842.html below:

[Python-Dev] a note in random.shuffle.__doc__ ...

[Python-Dev] a note in random.shuffle.__doc__ ... [Python-Dev] a note in random.shuffle.__doc__ ...Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jun 11 02:39:42 CEST 2006
Terry Jones wrote:
> That doc note should surely be removed.  Perhaps it's an artifact from some
> earlier shuffle algorithm.
> 
> The current algorithm (which is simple, well known, and which produces all
> permutations with equal probability) only calls the RNG len(x) - 1 times.

It's not a matter of how many times it's called, but
of how much internal state it has.

A generator with only N possible internal states can't
possibly result in more than N different outcomes from
any algorithm that uses its results.

--
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4