HP 12C Random Integer Number Generator
|
11-16-2017, 08:06 AM
Post: #2
|
|||
|
|||
RE: HP 12C Random Integer Number Generator
(11-16-2017 04:58 AM)Gamo Wrote: Is there any better or shorter solution for this kind of random program? This generator r:=frac(997*r) was quite popular in the Seventies as it was fast and short and provided good results. However, some care about the initial seed was required, so some implementations (including yours) set this seed within the program. Which means that the produced number sequence is not random, but the same each time you restart the program. Another well-reputed RNG that was often used in HP programs is r:=frac(9821*r+0,211327). This one is less picky about the initial seed. Simply enter anything between 0 and 1 in R0 and run the program. For many purposes even simpler generators may do. For instance r:=frac[(r+pi)²]. I often used this one in games programs and I had no problems with the results. There was an extensive thread on RNGs last year, related to an translation of HP67 games for the HP41. You will find more information there, including articles in HP-related papers, discussing different generators. The one mentioned above turned out to be a good choice. Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
HP 12C Random Integer Number Generator - Gamo - 11-16-2017, 04:58 AM
RE: HP 12C Random Integer Number Generator - Dieter - 11-16-2017 08:06 AM
RE: HP 12C Random Integer Number Generator - Dieter - 11-19-2017, 09:23 PM
RE: HP 12C Random Integer Number Generator - Gamo - 11-20-2017, 04:46 AM
RE: HP 12C Random Integer Number Generator - Dieter - 11-20-2017, 01:45 PM
RE: HP 12C Random Integer Number Generator - Gamo - 11-21-2017, 05:13 AM
RE: HP 12C Random Integer Number Generator - SlideRule - 11-04-2018, 04:03 PM
RE: HP 12C Random Integer Number Generator - Dieter - 11-04-2018, 06:02 PM
|
User(s) browsing this thread: 1 Guest(s)