The story
Flip a coin that lands heads with probability , and write 1 for heads and 0 for tails. That one yes-or-no outcome is a Bernoulli random variable. Its mean is and its variance is , so the uncertainty is greatest at and vanishes as approaches 0 or 1.
On its own it looks almost too simple to bother with, but it is the atom from which much of discrete probability is built. Count Bernoulli successes and you get the Binomial; wait for the first one and you get the Geometric; average many of them and you get a sample proportion, the quantity behind every poll and every A/B test.
Formulas
Support
PMF
CDF
Expectation
Variance
Mode
Parameters
| Parameter | What it controls |
|---|---|
| The probability of success, . It is also the mean; the variance peaks at 0.25 when . |
Where it shows up
- Whether a visitor clicks an advert (1) or not (0).
- Whether a manufactured part passes quality control.
- Whether a patient responds to a treatment in a clinical trial.
- The label of a single example in a binary classification problem.
Try this
- Drag from 0 to 1 and watch the markers: they spread furthest apart at , where the variance reaches its maximum of 0.25.
- Set , press Draw 1000 and compare the sample mean with 0.3. The sample mean is simply the proportion of ones you drew.
- Switch to Sample means with and raise from 1 to 50. The lumpy two-bar picture turns into a bell centred on 0.1, even though each draw is only ever 0 or 1.
Related distributions
- A Binomial with is a Bernoulli; equivalently, a is the sum of independent variables.
- The Geometric counts how many independent trials it takes to get the first success.
- A Bernoulli(0.5) is the Discrete Uniform on .
- The mean of draws is approximately Normal with mean and variance for large , by the Central Limit Theorem.