HP41C random number generator help

12052017, 06:54 PM
Post: #16




RE: HP41C random number generator help
(12052017 03:24 PM)Trond Wrote: Wow, that is very simple. But it seems to assume that you start up with a number (seed) that is already non0 and has a fraction part. The frac(997*x) PRNG indeed is considered a generator with good properties. But the results heavily rely on the seed. If I remember correctly, this seed has to provide 7 decimals after the multiplication by 997, and the last (7th) digit must be a 1, 3, 7 or 9. Choosing a suitable seed is so important that HP even recommended a special value, which was 0,5284163. The mentioned PPC article suggests 0,7742713 as an alternative. Always starting with the same seed of course means that always the same sequence of "random" numbers is generated. Thirty years ago the suggested fix was an initialization routine with a loop that permamently generates new numbers, and let this routine run for a few seconds. All this shows that a good PRNG with good statistical properties (which includes much more than mean and standard devation) is not trivial at all. In this regard the frac(9821x+0,211327) generator seems to perform exceptionally well. Dieter 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)