Unsorting(randomizing) a sequence
Magnus L. Hetland
mlh at idt.ntnu.no
Tue Aug 24 07:55:51 EDT 1999
"Tim Peters" <tim_one at email.msn.com> writes:
> [Aahz Maruch]
> > ...
> > Here's another question: I know the *period* of whrandom() is very
> > long, but what is the granularity/precision of it?
>
> It combines 3 sequences each of which have no better than 15-bit resolution.
> Analyzing the combined effect is tricky. You need to define your requirements
> precisely, then write a realistic simulation independent of your app to test
> whether your requirements are met. Every non-trivial application of
> pseudo-random numbers should do that. Collecting random <wink> info about the
> period and resolution is no substitute; e.g., the lattice structure of
> random.random may kill you no matter how long its period or fine its
> resolution -- or it may be irrelevant. It depends on every detail of your app.
Hm. AFAIK, some OSes (like Linux) have random methods that use such
things as the internal clock and samplings of user keystroke timings
etc... Does Python utilize these when available? These should be
closer to truly random than pseudo-random - no?
--
Magnus Making no sound / Yet smouldering with passion
Lie The firefly is still sadder / Than the moaning insect
Hetland : Minamoto Shigeyuki
More information about the Python-list
mailing list