randomOption¶
Selects the uniform (0,1) multiplicative congruential pseudorandom number generator.
Synopsis¶
randomOption (generatorOption)
Required Arguments¶
- int
generatorOption
(Input) Indicator of the generator. The random number generator is a multiplicative congruential generator with modulus \(2^{31}-1\). Argument
generatorOption
is used to choose the multiplier and whether or not shuffling is done.generatorOption
Generator 1 multiplier 16807 used 2 multiplier 16807 used with shuffling 3 multiplier 397204094 used 4 multiplier 397204094 used with shuffling 5 multiplier 950706376 used 6 multiplier 950706376 used with shuffling
Description¶
The PyIMSL uniform pseudorandom number generators use a multiplicative
congruential method, with or without shuffling. The value of the multiplier
and whether or not to use shuffling are determined by randomOption
. The
description of function randomUniform may provide
some guidance in the choice of the form of the generator. If no selection is
made explicitly, the generators use the multiplier 16807 without shuffling.
This form of the generator has been in use for some time (Lewis et al.
1969).
Example¶
The statement
randomOption
(1)
selects the simple multiplicative congruential generator with multiplier
16807. Since this is the same as the default, this statement has no effect
unless randomOption
had previously been called in the same program to
select a different generator.