This module provides two pseudo-random number generators, floatSequence and integerSequence. The first produces a list of n floating point numbers in a specified range. The second produces a list of positive integers in the range 1 to m0 = 214748364. A pseudo-random sequence is a sequence of numbers that resembles a random sequence even though it is produced by deterministic means. The notion "resembles" can be made precise using various statistical tests.
Examples:
floatSequence 3 7 (0, 1) |> List.map (roundTo 4) == [0.448,0.0988,0.246]
integerSequence 3 8 == [123092948, 28845728, 98310392]
NOTE: the seed must be a positive integer.
We use the linear congruential generator of (1), Lewis, Goodman, and Miller, for the integerSequence function. For floatSequence we use the generator triple linear congruential generator of (2).
References:
Using the seed, produce a list of n floats in the range [a,b)
The largest intnger that integerSequence will produce is m0 - 1.
Use this function if all those digits in the output of floatSequence bother you.
roundTo 2 1.2345 == 1.23
Using the seed, produce a list of n integers k, where 0 <= k < m0.