PNG's
|
10-01-2023, 01:22 AM
Post: #1
|
|||
|
|||
PNG's
An excerpt from A theoretical and empirical comparison of mainframe, microcomputer, and pocket calculator pseudorandom number generators, Behavior Research Methods, Instruments, & Computers, 1993. 25 (3). 384-395
This article presents an extensive theoretical and empirical analysis of the pseudorandom number generators provided by subroutine libraries (NAG, CERN, IMSL, and ESSL), statistical and simulation software packages (GLIM, SAS, SPSS, DATASIM, ESSP, and LLRANDOMII), built in functions of programming languages (APL, Turbo Pascal, Advanced BASIC, GW·BASIC, and QBASIC), and auto implemented algorithms (Fishman & Moore, 1986; Wichmann & Hill, 1982; Van Es, Gill, & Van Putten, 1983). On the basis of these analyses, it is concluded that most of the built-in functions of the software packages that were tested can be used safely. In addition, it is concluded that the Wichmann and Hill algorithm is a good choice if only single-precision arithmetic is available, but that a prime-modulus multiplicative congruential generator with modulus 231 -1 and multiplier 16,807 is a better choice if double-precision arithmetic is available, and that the same generator with multiplier 62,089,911 or 742,938,285 is the best choice if extended precision arithmetic is available. A Turbo Pascal and a VS FORTRAN program for the latter are given in the Appendixes. The Pocket Calculator Pseudorandom Number Generators Van Es et al. (1983) suggested two pseudorandom number generators for pocket calculators (using decimal arithmetic) with a 10-figure display and 10-figure accuracy. Pocket I has modulus 105, multiplier 31,481, and increment 21,139 and makes use of the equivalence of Equation 1 with ui+1 = (aui+b) mod 1 = Frac(aui+b), (2) where ui = xi/m, b = c/m, and Frac(x) is the fractional part of a real number x, or Frac(x) = x - Int(x) - that is, the original number minus the integer part. Pocket II has modulus 109 , multiplier 314,159,221, and increment 211,324,863 and makes use of the equivalence of Equation 2 with ui+1 = Frac{Frac(a(1)ui(2) + Frac(a(2)ui(1) + a(2)ui(2) + b}, (3) where ui1 = Int(105ui), ui(2) = Frac(105ui), a(1) = Int(10-5a), and a(2) = Frac(10-5a). Although this notation is cumbersome, the splitting up of the numbers a and ui, of Equation 2 into the five most significant and the five least significant digits is necessary to avoid rounding errors in the multiplications. Both are mixed congruential generators, so they can be seeded with any nonnegative integer less than the modulus. BEST! SlideRule |
|||
10-01-2023, 04:49 AM
Post: #2
|
|||
|
|||
RE: PNG's
I’ve always wondered how good a PNG that I implemented on the HP-67 that I had got in 1977. I created a simulation of the 1970 American League baseball season (the HO 67 knew who was up on which team, how many outs, magnetic cards for each team with on base average for each batter). I had on index cards, the breakdown of the reason for reaching base (B,1,2,3,HR) based on a random # between 0 and 999. My PNG was last 3 digits of the 10 displayed of sin (x), incremented by 1 for each new batter. Each game would continue to increment sin (x) from end of previous game. It seemed to be a decent PNG!
|
|||
10-01-2023, 04:50 AM
Post: #3
|
|||
|
|||
RE: PNG's
The HP 67 knew (not HO 67)!
|
|||
10-02-2023, 07:52 AM
Post: #4
|
|||
|
|||
RE: PNG's
Nice finding! (For future searches: PRNG survey)
|
|||
10-03-2023, 07:19 PM
(This post was last modified: 10-03-2023 09:15 PM by Namir.)
Post: #5
|
|||
|
|||
RE: PNG's
Check my presentation at HHC2022 last year on YouTube (titled HHC 2022: Project 997 - New Simple PRNGs For Calculators (Namir Shammas)) by clicking here. The presentation deals wirth PRNGs suitable for calculators. The presentation was based on several months of calculations that involved more than half a dozen laptops running many hours each day!
Namir |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)