Bernoulli Distribution

The Bernoulli distribution, also known as the two-point distribution, is the simplest of the discrete probability distributions. It models a single trial with two possible outcomes: 0 ('failure') and 1 ('success'). The distribution is characterized by a single parameter p, which specifies the probability of success.

Definition

The Bernoulli distribution has a single parameter p (0 ≤ p ≤ 1), which represents the probability of success. The probability mass function (PMF) is given by:

P(X=x)={pif x=11pif x=0

The cumulative distribution function (CDF) is:

F(x)={0if x<01pif 0x<11if x1

The domain of the Bernoulli distribution is x{0,1}. The parameter p must satisfy 0p1.

Applications

The Bernoulli distribution is widely used in various fields due to its simplicity and fundamental nature. Common applications include:

  • Modeling binary outcomes, such as coin tosses (heads or tails).

  • Representing success/failure scenarios in quality control.

  • Estimating probabilities in medical trials (e.g., treatment success).

  • Simulating binary events in computer science and engineering.

Properties

The Bernoulli distribution has several important statistical properties:

Statistical Properties
PropertyValue
Meanp
Variancep(1p)
Skewness12pp(1p)
Kurtosis6p26p+1p(1p)
Median {0if p<0.51if p>0.5either 0 or 1if p=0.5
Mode {0if p<0.51if p>0.5both 0 and 1if p=0.5
Support{0,1}
Entropyplog(p)(1p)log(1p)

Relationships to Other Distributions

The Bernoulli distribution is a fundamental building block for several other discrete probability distributions:

The BernoulliDistribution class

The Bernoulli distribution is implemented by the BernoulliDistribution class. It has one constructor which takes one parameter: the probability of success of a trial. The probability must be between 0 and 1. The following constructs a Bernoulli distribution with a probability of success 0.4:

C#
var bernoulli = new BernoulliDistribution(0.4);

The BernoulliDistribution class has one specific property, ProbabilityOfSuccess, which returns the probability of success of a trial.

BernoulliDistribution has one static (Shared in Visual Basic) method, Sample, which generates a random sample using a user-supplied uniform random number generator.

C#
var random = new Pcg32();
int sample = BernoulliDistribution.Sample(random, 0.4);

The above example uses the Pcg32 class to generate uniform random numbers.

For details of the properties and methods common to all discrete probability distribution classes, see the topic on Discrete Probability Distributions.

References

  • "Introduction to Probability Models" by Sheldon M. Ross.

  • "Probability and Statistics" by Morris H. DeGroot and Mark J. Schervish.

See Also