next up previous contents index
Next: Terminating the program Up: General commands Previous: Fully restarting the program

Initialising random number generation

 


tex2html_wrap_inline33790 tex2html_wrap_inline33790 Syntax

BD>seed : I tex2html_wrap_inline33712

where tex2html_wrap_inline39292 is a positive integer.

tex2html_wrap_inline33806 tex2html_wrap_inline33806

[B/D] contains a crude mechanism for generating uniformly or Normally distributed psuedo-random numbers. Uniform (0,1) pseudo-random numbers are generated by the linear congruential method (see, for example, [40]) via the sequence

eqnarray15015

where tex2html_wrap_inline39298 and tex2html_wrap_inline39300 are the current and former values of the seed, and tex2html_wrap_inline39302 is the generated random number. The SEED:  command can be used to set the value of tex2html_wrap_inline39304 used to initiate the sequence of seed values.

Approximately Normal (0,1) psuedo-random numbers tex2html_wrap_inline39306 are generated by the Polar method from a pair of Uniform psuedo-random numbers as follows:

displaymath39284

These uniform and Normal psuedo-random numbers are available in equations as the [B/D] operands urand  and nrand  respectively.  



David Wooff
Wed Oct 21 15:14:31 BST 1998