(48G) 48G, 49G & 50G: Explicit Inverse Congruential Random Number Generator
|
07-23-2015, 07:21 AM
(This post was last modified: 06-15-2017 01:51 PM by Gene.)
Post: #1
|
|||
|
|||
(48G) 48G, 49G & 50G: Explicit Inverse Congruential Random Number Generator
An Explicit Inverse Coungruential Random Number Generator to base 2 ^WORDSIZE.
SDR seeds constants a & b with suitable values to ensure maximum period & the counter j with a random value. NEXTX produces the next hexadecimal string in the sequence using the formula next := j * ( j * a + b ) ^ -1 MODULO 2 ^ WORDSIZE where j increases by 1 at each iteration. NEXTR returns the next real in the sequence, next divided by the modulus. TO USE: Set wordsize as required, actuate SDR - NEXTX or NEXTR will then return the sequence you require. I would be grateful for reports of (in-)adequacy of the randomness of sequences produced. Code:
|
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
(48G) 48G, 49G & 50G: Explicit Inverse Congruential Random Number Generator - Gerald H - 07-23-2015 07:21 AM
|
User(s) browsing this thread: 1 Guest(s)