Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Need *predictable* random number sequence
Replies: 29   Last Post: Feb 5, 2001 4:55 PM

 Messages: [ Previous | Next ]
 r3769 Posts: 30 Registered: 12/12/04
Re: Need *predictable* random number sequence
Posted: Jan 21, 2001 5:31 PM

Here's a sketch of something that might work:

Pick a prime p, and for a given seed, s, set x[s]=1/p and compute a[i], i>=s
as follows:

a[i]=ceil((i+1)/x[i])-1
x[i+1]=a[i]*x[i]-i

The sequence <a[i]> is fairly wiggly and a[i] mod 256 doesn't FAIL (m)any of
the DIEHARD tests.

To get the predictable part of the PRNG, note that for t>s and b[i], i>=t,
where b[i] is computed as above with seed t, there is some i0 near t s.t.
b[i]=a[i], all i>i0.

Regards,

R. Burge

Rudolf Potucek wrote in message <948lhm\$l54\$1@nserve1.acs.ucalgary.ca>...
>Hi Everyone!
>
>I am looking for a way to generate a *reproducible* and *predictable*
>pseudo random series (it should still be statistically distributed).
>Ideally it would also be possible to generate the n-th element in the
>series directly from the seed/first value instead of having to generate
>all the intermediate series elements first. Can anyone give me a pointer
>where to look?
>
>Thx,
>
> Rudolf
>