Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!batcomputer!braner From: braner@batcomputer.tn.cornell.edu (Moshe Braner) Newsgroups: comp.lang.c Subject: Re: Yet another pseudo-random number generator Summary: Perceived problems are incorrect Message-ID: <7444@batcomputer.tn.cornell.edu> Date: 21 Feb 89 22:05:58 GMT References: <7383@batcomputer.tn.cornell.edu> <419@lakart.UUCP> Reply-To: braner@tcgould.tn.cornell.edu (Moshe Braner) Organization: Cornell Theory Center, Cornell University, Ithaca NY Lines: 28 [David Goodenough pointed out some supposed problems with my PRNG] My method (posted here recently) is NOT parallel LCGs, it is 16 or 32 parallel occurences of the (in)famous "shift register" algorithm. While it is true that each bit position, taken alone, is not a very good basis for PRNs, tests show that the 32 independent "registers" provide pretty good 32-bit random long ints. With my method there is no actual shifting of the bits in each register, instead I just bump a pointer to a position on a ring. MUCH faster. (To make merrier, I also roll one column in the matrix of bits (around the OTHER axis than the rows used for the "shift" of the registers) one bit per call. But that is not essential.) For seeding, I take ONE seed int and generate 31 "random" seeds out of it using a LCG (for the seeding only). It is true that, with VERY small probability, one bit position may be stuck at all 0's, but the extra rolling mentioned above will destroy that state. I still claim that this is a very fast generator with no deficiencies known to me. Anybody got their favorite killer PRNG tests ready to shoot? :-) - Moshe Braner Cornell Theory Center, 265 Olin Hall, Cornell University, Ithaca, NY 14853 (607) 255-9401 (Work) (INTERNET) or (BITNET)