HP41C random number generator help
12-05-2017, 07:50 PM
Post: #18
 Trond Member Posts: 139 Joined: Sep 2017
RE: HP41C random number generator help
(12-05-2017 06:54 PM)Dieter Wrote:
(12-05-2017 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 non-0 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

Thanks for the info, Dieter. Yes, I was assuming that it takes more than the mean and SD to really check on a random number generator (let me know if you know further ways to check, that does not involve heavy computing power).
I guess adding 0,211327 each time would not work, as it would mess up the distribution. I suppose I could program around it if I want to try this random generator, at least avoiding that the calc starts from 0.
 « Next Oldest | Next Newest »

 Messages In This Thread HP41C random number generator help - Trond - 12-05-2017, 05:45 AM RE: HP41C random number generator help - Paul Dale - 12-05-2017, 05:52 AM RE: HP41C random number generator help - Trond - 12-05-2017, 06:02 AM RE: HP41C random number generator help - Paul Dale - 12-05-2017, 06:06 AM RE: HP41C random number generator help - Dieter - 12-05-2017, 08:31 AM RE: HP41C random number generator help - Sylvain Cote - 12-05-2017, 06:08 AM RE: HP41C random number generator help - Trond - 12-05-2017, 06:33 AM RE: HP41C random number generator help - Trond - 12-05-2017, 10:25 PM RE: HP41C random number generator help - Trond - 12-05-2017, 06:12 AM RE: HP41C random number generator help - Dieter - 12-05-2017, 08:23 AM RE: HP41C random number generator help - Namir - 12-05-2017, 12:30 PM RE: HP41C random number generator help - Trond - 12-05-2017, 03:24 PM RE: HP41C random number generator help - Dieter - 12-05-2017, 06:54 PM RE: HP41C random number generator help - Trond - 12-05-2017 07:50 PM RE: HP41C random number generator help - Dieter - 12-05-2017, 08:11 PM RE: HP41C random number generator help - Trond - 12-08-2017, 04:26 AM RE: HP41C random number generator help - Dieter - 12-08-2017, 07:43 PM RE: HP41C random number generator help - Trond - 12-08-2017, 09:17 PM RE: HP41C random number generator help - Dieter - 12-08-2017, 09:56 PM RE: HP41C random number generator help - Mike T. - 12-21-2021, 07:09 PM RE: HP41C random number generator help - Dieter - 12-09-2017, 09:53 PM RE: HP41C random number generator help - Trond - 12-10-2017, 04:09 AM RE: HP41C random number generator help - ttw - 12-05-2017, 01:43 PM RE: HP41C random number generator help - Trond - 12-05-2017, 03:53 PM RE: HP41C random number generator help - Thomas Okken - 12-05-2017, 05:21 PM RE: HP41C random number generator help - Trond - 12-05-2017, 06:32 PM RE: HP41C random number generator help - Garth Wilson - 12-05-2017, 07:33 PM RE: HP41C random number generator help - Trond - 12-21-2021, 06:25 AM RE: HP41C random number generator help - ttw - 12-22-2021, 03:58 AM RE: HP41C random number generator help - John Keith - 12-22-2021, 07:02 PM

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