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
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
- Summing n independent Bernoulli(p) trials gives a Binomial(n, p).
- Counting trials until the first success gives a Geometric distribution.
- A Bernoulli whose p depends on inputs is the output layer of logistic regression.
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.