Random number generation, simple question.

Jürgen Hermann jhe at webde-ag.de
Mon Jul 3 12:40:25 EDT 2000


"Kalle Svensson" <kalle at gnupung.net> schrieb im Newsbeitrag
news:Pine.GSO.4.21.0007031546410.25965-100000 at luna.dsv.su.se...
>  * Suppose I do a loop where I get a byte at a time and then re-seed the
>    generator either with random numbers from the generator or with values
>    from time. Will that improve the randomness?

Certainly not. Seeding is done ONCE, always. What you should do is to call
random() 80 times, and use the MSB only, i.e. "bit = random() < 0.5".

Ciao, Jürgen

--
Jürgen Hermann (jhe<at>webde-ag.de)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22





More information about the Python-list mailing list