the Bernoulli distribution
/ bear-NOO-lee /
The Bernoulli distribution is the probability law of a single Bernoulli trial written as a random variable. You let X = 1 when the trial succeeds and X = 0 when it fails. So X is a number that is either 1 or 0, and its whole personality is captured by a single parameter p, the chance it equals 1. We write X ~ Bernoulli(p).
Its probability mass function is as short as they come: P(X = 1) = p and P(X = 0) = 1 - p, which can be packed into the one-line formula P(X = k) = p^k (1 - p)^(1-k) for k in {0, 1}. From this everything follows by direct calculation. The mean is E[X] = 1 times p plus 0 times (1 - p) = p — the expected value of a 0/1 variable is simply the probability of the 1. The variance is Var(X) = p(1 - p), which is largest at p = 0.5 (a fair coin is the most uncertain) and shrinks to zero as p approaches 0 or 1 (a near-certain outcome carries almost no spread).
This 0/1 variable is also called an indicator: it indicates whether some event happened. That double identity is enormously useful, because the slick trick of writing a complicated count as a sum of indicators, then using linearity of expectation, rests on exactly this distribution. The binomial is literally the sum of n independent Bernoulli(p) variables.
Let X = 1 if a randomly chosen voter supports the measure (p = 0.6) and X = 0 otherwise. Then E[X] = 0.6 and Var(X) = 0.6 times 0.4 = 0.24, so the standard deviation is about 0.49.
For a 0/1 variable the mean is the probability of 1, and the variance peaks at the coin-flip case p = 0.5.
Do not confuse the Bernoulli distribution (one 0/1 variable) with the binomial (a count out of n). Bernoulli is the n = 1 special case of the binomial.