|
generator |
length of cycle |
approx. memory requirements |
approx. speed compared to fastest |
header file |
|---|---|---|---|---|
|
231-2 |
|
16% |
boost/random/linear_congruential.hpp |
|
|
231-2 |
|
16% |
boost/random/linear_congruential.hpp |
|
|
248-1 |
|
64% |
boost/random/linear_congruential.hpp |
|
|
approx. 261 |
|
7% |
boost/random/additive_combine.hpp |
|
|
? |
|
12% |
boost/random/shuffle_order.hpp |
|
|
? |
|
37% |
boost/random/shuffle_order.hpp |
|
|
~288 |
|
100% |
boost/random/taus88.hpp |
|
|
231-1 |
|
2% |
boost/random/inversive_congruential.hpp |
|
|
211213-1 |
|
100% |
boost/random/mersenne_twister.hpp |
|
|
219937-1 |
|
93% |
boost/random/mersenne_twister.hpp |
|
|
219937-1 |
|
38% |
boost/random/mersenne_twister.hpp |
|
|
~232000 |
|
59% |
boost/random/lagged_fibonacci.hpp |
|
|
~267000 |
|
59% |
boost/random/lagged_fibonacci.hpp |
|
|
~2120000 |
|
61% |
boost/random/lagged_fibonacci.hpp |
|
|
~2170000 |
|
62% |
boost/random/lagged_fibonacci.hpp |
|
|
~2230000 |
|
59% |
boost/random/lagged_fibonacci.hpp |
|
|
~2510000 |
|
61% |
boost/random/lagged_fibonacci.hpp |
|
|
~21050000 |
|
59% |
boost/random/lagged_fibonacci.hpp |
|
|
~21200000 |
|
61% |
boost/random/lagged_fibonacci.hpp |
|
|
~22300000 |
|
59% |
boost/random/lagged_fibonacci.hpp |
|
|
~10171 |
|
5% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
3% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
5% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
3% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
5% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
3% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
5% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
3% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
5% |
boost/random/ranlux.hpp |
|
|
~10171 |
|
3% |
boost/random/ranlux.hpp |
Table 33.6. Uniform Distributions
|
distribution |
explanation |
example |
header |
|---|---|---|---|
|
discrete uniform distribution on a small set of integers (much smaller than the range of the underlying generator) |
drawing from an urn |
boost/random/uniform_smallint.hpp |
|
|
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 |
boost/random/uniform_int_distribution.hpp |
|
|
continuous uniform distribution on the range [0,1); important basis for other distributions |
- |
boost/random/uniform_01.hpp |
|
|
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) |
boost/random/uniform_real_distribution.hpp |
Table 33.7. Bernoulli Distributions
|
distribution |
explanation |
example |
header |
|---|---|---|---|
|
Bernoulli experiment: discrete boolean valued distribution with configurable probability |
tossing a coin (p=0.5) |
boost/random/bernoulli_distribution.hpp |
|
|
counts outcomes of repeated Bernoulli experiments |
tossing a coin 20 times and counting how many front sides are shown |
boost/random/binomial_distribution.hpp |
|
|
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 |
boost/random/geometric_distribution.hpp |
|
|
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 |
boost/random/negative_binomial_distribution.hpp |
Table 33.8. Poisson Distributions
|
distribution |
explanation |
example |
header |
|---|---|---|---|
|
poisson distribution |
counting the number of alpha particles emitted by radioactive matter in a fixed period of time |
boost/random/poisson_distribution.hpp |
|
|
exponential distribution |
measuring the inter-arrival time of alpha particles emitted by radioactive matter |
||
|
gamma distribution |
- |
||
|
hyperexponential distribution |
service time of k-parallel servers each with a given service rate and probability to be chosen |
||
|
weibull distribution |
- |
||
|
extreme value distribution |
- |
||
|
beta distribution |
- |
||
|
laplace distribution |
- |
Table 33.9. Normal Distributions
|
distribution |
explanation |
example |
|---|---|---|
|
counts outcomes of (infinitely) repeated Bernoulli experiments |
tossing a coin 10000 times and counting how many front sides are shown |
|
|
lognormal distribution (sometimes used in simulations) |
measuring the job completion time of an assembly line worker |
|
|
chi-squared distribution |
- |
|
|
non-central chi-squared distribution |
- |
|
|
Cauchy distribution |
- |
|
|
Fisher F distribution |
- |
|
|
Student t distribution |
- |
Table 33.10. Sampling Distributions
|
distribution |
explanation |
example |
|---|---|---|
|
discrete distribution with specific probabilities |
rolling an unfair die |
|
|
- |
- |
|
|
- |
- |