Random number utilities (OMRANDOM)

OMRANDOM provides functions for generating pseudo-random numbers. Exponential and uniform distributions are supported.

A uniform distribution of random numbers is a flat distribution, where every number has an equal chance of occuring. Flipping a coin is an example of a uniform distribution, because each time you flip you have an equal chance of getting heads or tails.

The exponential distribution is commonly used to model the lifetime of units which have a constant failure or decay rate. (The rate is constant if it does not depend on how long the unit has survived.)

For instance, if a unit has 50% chance of failing during any year, then half of the units will probably fail the first year, half of the remaining units (or one quarter) will fail the next, half again (or one eighth) the year after that, and so on. If you plot these lifetimes, you will get an exponential distribution.

Usage note

The OMRANDOM library is packaged as a module. To use OMRANDOM, you must import the OMRANDOM module into your program using a statement like this:

  import "omrandom.xmd" prefixed by random.

Note that the prefix "random.", which is attached to all functions, constants, and opaque data types exported by this library, is set in this statement and can be changed. For readability, we recommend that you always use the standard prefix when importing modules supplied by OmniMark.