Random distribution functions

Term definitions

  • Random-number generator: A function that generates numbers that are uniformly distributed over the interval (0,1).
  • Random-variate generator: A function that generates numbers whose probability distribution is different from that of the uniform on the interval (0,1).

Random-variate generators

Below is a brief summary of the random-number generators that are available. Click on a function name to see a more detailed explanation.

bernoulli(p:real) : int raises Bernoulli exception, if p<0.0 or p>1.0.
binomial(n:int, p:real) : int raises Binomial exception, if n<1 or p<0.0 or p>1.0.
chisq(n:int) : real raises Chisq exception, if n<1.
discrete (a:int, b:int) : int raises Discrete exception, if a>b.
erlang (n:int, r:real) : real raises Erlang exception, if n<1 or r<=0.0.
exponential(r:real) : real raises Exponential exception, if r<=0.0.
normal(n:real, v:real) : real raises Normal exception, if v<0.0.
poisson(m:real) : int raises Poisson exception, if m<=0.0.
student (n:int) : real raises Student exception, if n<1.
uniform(a:real, b:real) : real raises Uniform exception, if a>b.
rayleigh(s:real) : real raises Rayleigh exception, if s<0.0.
gamma(l:real, k:real) : real raises Gamma exception, if k<= 0.0 or l<=0.0.
beta(a:real, b:real) : real raises Beta exception, if a<= 0.0 or b<=0.0.