Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Distributions

In addition to the random number generators, this library provides distribution functions which map one distribution (often a uniform distribution provided by some generator) to another.

Usually, there are several possible implementations of any given mapping. Often, there is a choice between using more space, more invocations of the underlying source of random numbers, or more time-consuming arithmetic such as trigonometric functions. This interface description does not mandate any specific implementation. However, implementations which cannot reach certain values of the specified distribution or otherwise do not converge statistically to it are not acceptable.

Table 1.6. Uniform Distributions

distribution

explanation

example

uniform_smallint

discrete uniform distribution on a small set of integers (much smaller than the range of the underlying generator)

drawing from an urn

uniform_int_distribution

discrete uniform distribution on a set of integers; the underlying generator may be called several times to gather enough randomness for the output

drawing from an urn

uniform_01

continuous uniform distribution on the range [0,1); important basis for other distributions

-

uniform_real_distribution

continuous uniform distribution on some range [min, max) of real numbers

for the range [0, 2pi): randomly dropping a stick and measuring its angle in radians (assuming the angle is uniformly distributed)


Table 1.7. Bernoulli Distributions

distribution

explanation

example

bernoulli_distribution

Bernoulli experiment: discrete boolean valued distribution with configurable probability

tossing a coin (p=0.5)

binomial_distribution

counts outcomes of repeated Bernoulli experiments

tossing a coin 20 times and counting how many front sides are shown

geometric_distribution

measures distance between outcomes of repeated Bernoulli experiments

throwing a die several times and counting the number of tries until a "6" appears for the first time

negative_binomial_distribution

Counts the number of failures of repeated Bernoulli experiments required to get some constant number of successes.

flipping a coin and counting the number of heads that show up before we get 3 tails


Table 1.8. Poisson Distributions

distribution

explanation

example

poisson_distribution

poisson distribution

counting the number of alpha particles emitted by radioactive matter in a fixed period of time

exponential_distribution

exponential distribution

measuring the inter-arrival time of alpha particles emitted by radioactive matter

gamma_distribution

gamma distribution

-

hyperexponential_distribution

hyperexponential distribution

service time of k-parallel servers each with a given service rate and probability to be chosen

weibull_distribution

weibull distribution

-

extreme_value_distribution

extreme value distribution

-

beta_distribution

beta distribution

-

laplace_distribution

laplace distribution

-


Table 1.9. Normal Distributions

distribution

explanation

example

normal_distribution

counts outcomes of (infinitely) repeated Bernoulli experiments

tossing a coin 10000 times and counting how many front sides are shown

lognormal_distribution

lognormal distribution (sometimes used in simulations)

measuring the job completion time of an assembly line worker

chi_squared_distribution

chi-squared distribution

-

non_central_chi_squared_distribution

non-central chi-squared distribution

-

cauchy_distribution

Cauchy distribution

-

fisher_f_distribution

Fisher F distribution

-

student_t_distribution

Student t distribution

-


Table 1.10. Sampling Distributions

distribution

explanation

example

discrete_distribution

discrete distribution with specific probabilities

rolling an unfair die

piecewise_constant_distribution

-

-

piecewise_linear_distribution

-

-


Table 1.11. Miscellaneous Distributions

distribution

explanation

example

triangle_distribution

triangle distribution

-

uniform_on_sphere

uniform distribution on a unit sphere of arbitrary dimension

choosing a random point on Earth (assumed to be a sphere) where to spend the next vacations



PrevUpHomeNext