Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.math Subject: Re: random bignums Message-ID: <7082@watdaisy.UUCP> Date: Mon, 18-Mar-85 14:03:36 EST Article-I.D.: watdaisy.7082 Posted: Mon Mar 18 14:03:36 1985 Date-Received: Tue, 19-Mar-85 03:44:35 EST References: <2630@mcnc.UUCP> <1839@sdcrdcf.UUCP> Organization: U of Waterloo, Ontario Lines: 22 > Suppose we need to generate a random number between 0 and 123456789, and > our multi-precision routines work in base 1000. I generate the bottom > three digits by taking one random integer between 0 and 999 inclusive, the > middle three digits likewise ... > Peter Montgomery You'll have to generate the middle digits independently of the lower digits. Don't use the next sequential pseudo-random integer. In fact, don't even use the same formula with different seeds. You need a different generator with no correlation. (Ditto for the top digits, only harder...) -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."