Skip to content

Commit 5b02ab1

Browse files
committed
Added superscript for exponents
#40
1 parent 4aba069 commit 5b02ab1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

docs/manual.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,17 @@ public abstract class RandomStream
389389

390390
The multiplicative generator uses the following algorithm:
391391

392-
Y[i+1] = Y[i] * 5^5 mod 2^26
392+
Y[i+1] = Y[i] * 5^5^ mod 2^26^
393393

394-
THIS NEEDS FIXING!! plus mod superscripted?!
395-
396-
, where the period is 2^24, and the initial seed must be odd (Thanks to Professor I. Mitrani for his help in developing this.)
394+
, where the period is 2^24^, and the initial seed must be odd (Thanks to Professor I. Mitrani for his help in developing this.)
397395

398396
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 (seed 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.
399397

400398
The error() method returns a chi-square error measure on the uniform distribution function.
401399

402400
By abstract method getNumber must be provided by derived classes, and is used to obtain a uniform means of accessing random numbers.
403401

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.
402+
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.
405403

406404
=== UniformStream
407405

0 commit comments

Comments
 (0)