Post Reply 
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
PNG's - SlideRule - 10-01-2023 01:22 AM
RE: PNG's - lrdheat - 10-01-2023, 04:49 AM
RE: PNG's - lrdheat - 10-01-2023, 04:50 AM
RE: PNG's - EdS2 - 10-02-2023, 07:52 AM
RE: PNG's - Namir - 10-03-2023, 07:19 PM



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