Bernoulli and Binomial Distributions
The distributions of a single yes/no trial and of the number of successes in a fixed number of independent trials.
Prerequisites: Probability Distributions, Statistical Independence, Expected Value.
The Bernoulli distribution describes a single trial with two outcomes, “success” or “failure”, such as one coin toss or one free throw. The binomial distribution describes the number of successes in a fixed number of such trials when the trials are independent and each has the same chance of success.
Together they are the basic model for counting yes/no outcomes: how many patients respond to a treatment, how many of 20 emails are spam, how many of 10 free throws go in. Both are discrete distributions, so they assign probabilities to separate values through a probability mass function.
Intuition
Suppose a basketball player makes each free throw with probability and takes 10 shots. The number of baskets could be anything from 0 to 10, but not all values are equally likely. Around 7 is typical. Exactly 10 requires every shot to go in, which is rare. Exactly 7 can happen in many ways (any 7 of the 10 shots could be the successful ones), which is why values near the middle collect most of the probability.
The binomial distribution makes this counting precise. It has two ingredients: the probability of one particular sequence of successes and failures, and the number of sequences that give the same total.
The Bernoulli distribution
A random variable has a Bernoulli distribution with parameter , written , if it takes the value (success) with probability and the value (failure) with probability , where :
Coding success as and failure as is a convenient choice: the variable then counts successes in one trial, and averages of such variables are proportions.
Its expected value and variance follow directly from the definitions:
and since when is or , , so
The variance is largest at , where the outcome is most uncertain, and zero at or , where there is no uncertainty at all.
The binomial distribution
Let be the number of successes in trials, where
- the number of trials is fixed in advance,
- each trial has two outcomes, success or failure,
- every trial has the same probability of success , and
- the trials are independent.
Then has a binomial distribution with parameters (a positive integer) and (with ), written . Its probability mass function is
Reading the formula
- is the probability of one particular sequence with successes and failures, for example success, success, failure, … By independence, the probabilities of the individual trials multiply. Every sequence with successes has this same probability, whatever the order.
- , read “ choose ”, is the number of different sequences with exactly successes, that is, the number of ways to choose which of the trials are the successes. Here , and .
Multiplying gives the total probability of all the sequences with successes. The Bernoulli distribution is the special case .
Mean and variance
The cleanest way to find the mean and variance is to write as a sum. Let if trial is a success and otherwise. Each , and
Expectation is linear, so the expected value of a sum is the sum of the expected values:
Because the trials are independent, the variance of the sum is also the sum of the variances:
The standard deviation is . As a sanity check, with or the count is certain ( or ) and the variance formula correctly gives .
How the shape depends on n and p
- The distribution is centred near : around , , and in the top panel.
- With it is symmetric. With it is skewed to the right (a longer tail toward large counts), and with it is skewed to the left. The distributions for and are mirror images, because counting successes with probability is the same as counting failures with probability .
- As grows, the distribution becomes wider in absolute terms (the standard deviation grows like ) and more bell-shaped, as in the bottom panel.
Worked example
A player makes each free throw with probability , independently of the other shots, and takes shots. Let be the number made, so .
Step 1: mean and spread. and , so the standard deviation is baskets.
Step 2: exactly 8 baskets. The number of ways to choose which 8 of the 10 shots go in is . Each such sequence has probability . So
Step 3: at least 8 baskets. Add the probabilities of 8, 9, and 10:
So the player makes 8 or more about 38% of the time. Although 7 is the single most likely value, its probability is only about : no single count is very likely.
When the assumptions fail
The binomial model needs all four conditions above. Common ways they break:
- Probability not constant. A player who tires makes later shots less often, so the count is no longer binomial. A particularly common case is a that changes between occasions: a player has good days and bad days, and all 10 shots on one day share that day’s form. Counts collected over many days are then more spread out than a single binomial predicts.
- Trials not independent. Hot and cold streaks, or students in the same class who influence each other’s answers, also tend to inflate the spread.
- Sampling without replacement. Drawing 10 cards from a deck and counting hearts is not binomial, because each draw changes the deck. When the sample is a small fraction of a large population, the binomial is still a good approximation.
- Number of trials not fixed. If you keep tossing until the third head, the number of tosses is random and the binomial model does not apply.
Approximations
Normal approximation. When is large and is not too close to or , the binomial distribution is close to a normal distribution with the same mean and variance . This is a consequence of the central limit theorem, since is a sum of independent Bernoulli variables. A common rule of thumb is to require and . Because the binomial is discrete, the approximation is better with a continuity correction: treat the integer as the interval from to . For 100 tosses of a fair coin, is about exactly, and the normal approximation gives about as well.
Poisson approximation. When is large and is small, so that successes are rare, the binomial is close to a Poisson distribution with mean .
Common misunderstandings
“The most likely count happens most of the time.” In the example, 7 is the most likely number of baskets, but it happens only about 27% of the time. With larger the probability of any single exact count gets smaller still.
“Any count of successes is binomial.” Only if the number of trials is fixed, the trials are independent, and the success probability is the same for each. Check these before using the formulas, particularly the standard deviation, which is too small when the assumptions fail.
“Bernoulli and binomial are unrelated distributions.” A Bernoulli variable is a binomial variable with , and every binomial variable is a sum of independent Bernoulli variables.
“The variance is np.” That is the Poisson variance. The binomial variance is always smaller than when ; the two are close only when is small.
Further reading
- Joseph K. Blitzstein and Jessica Hwang, Introduction to Probability, 2nd ed., CRC Press, 2019. Derives the binomial distribution through counting and through sums of indicator variables.
- David M. Diez, Mine Çetinkaya-Rundel, and Christopher D. Barr, OpenIntro Statistics, 4th ed., 2019. Free online; includes worked binomial examples and the normal approximation.