<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 12 Dec 1983 22:42:50 EST (Mon)
From   : Mike Ciaraldi <ciaraldi@...>
Subject: Re:  RANDOM in Pascal

I have seen a Pascal pseudo-random number generator prrogram.
I uses the well-know techinque of taking a seed number,
multiplying it by a constant, adding another constant, and
using the result as a random integer, and also as the next seed.
The problem is finding the "magic numbers" for the constants.
Someone has figured this out for various word lengths, and
I know a set of constants exists which causes a 16-bit
integer to cycle in a pseudo-random fashion through all 64k
numbers. This is then easily converted into a fraction
between 0 and 1.0.
The algorithm I saw was written up in some sample programs
which came with the Motorola Pascal compiler (produces
6809 code on an IBM 360).
I think the magic numbers are listed in the
"Encyclopedia of Computer Science", edited by Anthony Ralston.
You might also try the ACM collected Algortiithms.

Mike Ciaraldi
ciaraldi@...
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>