Darwin Help

Back to Index

Binomial_Rand

Function Binomial_Rand - Generate random binomially distributed integers

Calling Sequence  Rand(Binomial(n,p))
Binomial_Rand(n,p)
Return Type  integer
Synopsis This function returns a random integer binomially distributed with average n*p and variance n*p*(1-p). An example of a binomial distribution is the number of heads resulting from tossing n times a biased coin (that will give "heads" with probability p). In mathematical terms, the probability that the outcome is i is binomial(n,i) * p^i * (1-p)^(n-i) (for 0 <= i <= n). Binomial_Rand uses Rand() which can be seeded by either the function SetRand or SetRandSeed.
References Handbook of Mathematical functions, Abramowitz and Stegun, 26.1.20
Examples
> Rand(Binomial(20,0.3));
7
> Rand(Binomial(1000,0.01));
13
See also Beta_Rand,   ChiSquare_Rand,   CreateRandSeq,   Cumulative,   Exponential_Rand,   FDist_Rand,   GammaDist_Rand,   Geometric_Rand,   Graph_Rand,   Multinomial_Rand,   Normal_Rand,   Poisson_Rand,   SetRand,   SetRandSeed,   Shuffle,   StatTest,   Std_Score,   Student_Rand,   Zscore