Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!ucbvax!pasteur!ames!nrl-cmf!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Random Numbers ... Message-ID: <7363@brl-smoke.ARPA> Date: 28 Feb 88 00:55:19 GMT References: <7097@sol.ARPA> <225800009@uxe.cso.uiuc.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <225800009@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: >Has anyone out there considered how to write a random number generator in >which the output is truly random? Yes, you need a truly random mechanism, such as a radiation counter or resistive thermal noise (as you say you once did). Deterministic algorithms will of course always have intrinsic regularities. >In my tests it seems that the low-order bits have a very short repetition >period. I've considered using two ordinary generators giving 32-bit periods >and patching together the high order words. Is this better? It depends on how you're using the pseudo-random sequence. I suggest you read Chapter 3 of Donald Knuth's "The Art of Computer Programming" (in Volume 2, "Seminumerical Algorithms", 2nd ed., Addison-Wesley 1981, ISBN 0-201-03822-6).