Article View: comp.sys.amiga.tech
Article #1407Re: ARexx psuedo-random number generator
From: Colin Plumb
Date: Mon, 25 Sep 1989 03:37
Date: Mon, 25 Sep 1989 03:37
14 lines
1295 bytes
1295 bytes
In article <1989Sep22.082034.1405@agate.berkeley.edu> mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
>> A trick recommended by the authors of
>> _Numerical Recipes_ (in addition to their own, portable generators) is to
>> "scramble " your generator by calling it twice; the first time is
>> used as an index to an array of numbers from the generator.
>
> Knuth recommends a better version of this - use two generators, one
> to generate indices, one to generate values.
No, if you read Knuth, he says using the same generator is better worst-
case and at least as good on average. I happen to like his additive
generator (x_n = x_{n-24}+x_{n-55}).
--
-Colin
Technical Details
Message-ID:
<16646@watdragon.waterloo.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!rose!ccplumbReferences:
<19504@unix.cis.pitt.edu> <1989Sep13.032352.10321@agate.berkeley.edu> <12003@cit-vax.Caltech.Edu> <1989Sep22.082034.1405@agate.berkeley.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!watdragon!rose!ccplumb From: ccplumb@rose.waterloo.edu (Colin Plumb) Newsgroups: comp.sys.amiga.tech Subject: Re: ARexx psuedo-random number generator Keywords: ARexx Random Number Generator Message-ID: <16646@watdragon.waterloo.edu> Date: 25 Sep 89 03:37:38 GMT References: <19504@unix.cis.pitt.edu> <1989Sep13.032352.10321@agate.berkeley.edu> <12003@cit-vax.Caltech.Edu> <1989Sep22.082034.1405@agate.berkeley.edu> Sender: daemon@watdragon.waterloo.edu Reply-To: ccplumb@rose.waterloo.edu (Colin Plumb) Organization: U. of Waterloo, Ontario Lines: 14