[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: random doesn't feel very random

From: Achim Gratz
Subject: Re: random doesn't feel very random
Date: Sun, 26 Aug 2012 16:24:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Richard Stallman writes:
> If that is really true, maybe the code to set the seed needs to be
> changed.  Maybe it only gives you seed values from a subset of all
> those possible.
> Perhaps instead of initializing the seed based on the time, it should
> change the seed based on the time.  That way, all possible seeds
> could occur after (random t).

Re-seeding a PRNG inside the same application is misguided even when
there are multiple consumers of the sequence.  Provided the PRNG is of
sufficient quality, partial sequences aren't any less random.  Therefore
the PRNG should be seeded once at start-up, from a good source of
entropy.  The only application for re-seeding is to provide a repeatable
sequence (but Emacs' random doesn't allow for that since you can't give
the seed value directly) or if the PRNG state has been compromised.

Given the widespread use of (random t) it should probably be made a
no-op and a separate API to provide a local state for application that
wish to control it for whatever reason should be made available.

+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Waldorf MIDI Implementation & additional documentation:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]