The Bernoulli Distribution - GNU Scientific Library -- Reference Manual
Description: GNU Scientific Library -- Reference Manual

Next: The Binomial Distribution, Previous: The Poisson Distribution, Up: Random Number Distributions

### 20.30 The Bernoulli Distribution

— Function: unsigned int gsl_ran_bernoulli (const gsl_rng * r, double p)

> This function returns either 0 or 1, the result of a Bernoulli trial with probability p. The probability distribution for a Bernoulli trial is,

>               p(0) = 1 - p
>               p(1) = p

— Function: double gsl_ran_bernoulli_pdf (unsigned int k, double p)

> This function computes the probability p(k) of obtaining k from a Bernoulli distribution with probability parameter p, using the formula given above.

The GNU Scientific Library - a free numerical library licensed under the GNU GPL
Back to the GNU Scientific Library Homepage