Contents - Index
The Random function can have two or three arguments. The usual application provides two arguments, so that Random(a,b) returns a uniformly distributed random number X such that a <=X<=b. (Note that the RandG function returns a random number from a Gaussian distribution.)
If a third argument other than 0 is provided, it is used as a seed for the random number generator routines. The argument should be an integer. The random number generator will always return the same value if a constant value is provided for the seed, e.g.,
If the third argument is 0, EES will generate a random number and then use this number each time the equation is evaluated during the solving process. Each new solving process will result in a different random number.
Used within Functions and Procedures with the
Repeat Until or other logical expressions, the Random function can be used to implement Monte Carlo type calculations.
See also: RandG