Skip to content

Commit fed63a0

Browse files
committed
Finished initial text on RandomStream
1 parent 3bbed81 commit fed63a0

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

docs/manual.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public abstract class RandomStream
383383
protected RandomStream ();
384384
protected RandomStream (long MGSeed, long LCGSeed);
385385
386-
protected final double Uniform ();
386+
protected final double uniform ();
387387
}
388388
----
389389

@@ -394,3 +394,11 @@ Y[i+1] = Y[i] * 55 mod 226
394394
THIS NEEDS FIXING!!
395395

396396
, where the period is 224, and the initial seed must be odd (Thanks to Professor I. Mitrani for his help in developing this.)
397+
398+
The uniform() method uses the linear congruential generator (seed is LCGSeed, with the default value of 1878892440L) based on the algorithm in link:http://algs4.cs.princeton.edu/home/[this text], and the results of this are shuffled with the multiplicative generator (see is MGSeed, with a default value of 772531L) as suggested by link:http://www.amazon.com/Art-Computer-Programming-Volume-Seminumerical/dp/0201896842[Maclaren and Marsaglia], to obtain a sufficiently uniform random distribution, which is then returned.
399+
400+
The error() method returns a chi-square error measure on the uniform distribution function.
401+
402+
By abstract method getNumber must be provided by derived classes, and is used to obtain a uniform means of accessing random numbers.
403+
404+
The RandomStream class returns a large sequence of random numbers, whose period is 2^24. However, unless the seeds are modified when each random distribution class is created, the starting position in this sequence will always be the same, i.e., the same sequence of numbers will be obtained. To prevent this, each class derived from RandomStream has an additional parameter for one of its constructors which indicates the offset in this sequence from which to begin sampling.

0 commit comments

Comments
 (0)