Computing Library › Probability Statistics
Probability Statistics

Bernoulli Distribution

The Bernoulli distribution models a single yes/no trial and is the atom from which many discrete distributions are built.

A single trial

A Bernoulli random variable takes value 1 (success) with probability p and 0 (failure) with probability 1 − p. Its PMF is p(1) = p, p(0) = 1 − p. It is the simplest non-trivial random variable and the model for any binary outcome.

Mean and variance

Kronos motion — which application

The mean is E[X] = p, since X is an indicator of success. The variance is Var(X) = p(1 − p), which is maximized at p = 0.5 — a fair coin is the most unpredictable Bernoulli trial — and shrinks to zero as p approaches 0 or 1.

Building block for other distributions

Indicator variables

Any event A defines a Bernoulli variable 1_A that is 1 when A occurs. Its expectation is exactly P(A). This trick — replacing an event by its indicator — turns probability calculations into expectation calculations and is the basis of many elegant proofs, including linearity arguments for counting.

Estimating p

From n trials with k successes, the maximum likelihood estimate of p is simply k/n, the observed success fraction. Its uncertainty follows from the binomial variance and shrinks like 1/√n, which sets how many trials a reliability test needs to pin down a rate.