1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
The ti(bernoulli_distribution) is used to generate logical truth (boolean)
values with a certain probability tt(p). It is equal to a binomial
distribution for one experiment (cf ref(BINOMIAL)).
The bernoulli distribution is em(not) defined as a class template.
Defined types:
verb( using result_type = bool;
struct param_type
{
explicit param_type(double prob = 0.5);
double p() const; // returns prob
};)
Constructor and members:
itemization(
itt(bernoulli_distribution(double prob = 0.5))nl()
constructs a bernoulli distribution with probability tt(prob) of
returning tt(true);
itt(double p() const)nl()
returns tt(prob);
itt(result_type min() const)nl()
returns tt(false);
itt(result_type max() const)nl()
returns tt(true);
)
|