Unit 6, lesson 39

The Binomial Distribution

How the binomial distribution counts successes in a fixed number of independent trials with a common success probability, where its probability formula comes from, its mean and variance, and how to find tail probabilities.

  • Video 39
  • Counting and Waiting in Independent Trials

Five independent checks each succeed with probability 0.40.4. How likely is it that exactly two of them succeed, and how likely is it that at least one does? The probability of one particular sequence of results comes from multiplying, but many different sequences give the same number of successes. The binomial distribution collects those sequences into one formula. This lesson derives it, finds the mean, the variance and the tail probabilities, and states the conditions the model needs.

Key terms

Binomial assumptions

Definition A count XX of successes has a binomial distribution when the experiment meets four conditions.

  1. The number of trials nn is fixed in advance and does not depend on the results.
  2. Each trial records whether one clearly defined success event occurs.
  3. The trials are independent.
  4. Every trial has the same success probability pp.

Under these conditions X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p). When a condition fails, the count is still a random variable with its own distribution, but the binomial formula is no longer justified for it.

In plain words The formula needs a fixed list of trials that do not influence each other and that all have the same chance of success. A rule that stops after a chosen number of successes breaks the first condition. Draws without replacement break independence whenever the collection holds both kinds of items, because each draw changes what is left. Trials with different success probabilities break the fourth condition.

Example A bag holds 44 marked tokens among 1010. Drawing 33 tokens with replacement gives a number of marked draws with distribution Bin⁡(3,2/5)\operatorname{Bin}(3, 2/5). Without replacement, a marked first draw lowers the chance of a marked second draw to 39\tfrac{3}{9}, so the draws are dependent and the binomial assumptions fail. For this bag every count from 00 to 33 has a probability different from its Bin⁡(3,2/5)\operatorname{Bin}(3, 2/5) value. Unequal probabilities matter too. Two independent trials with success probabilities 0.20.2 and 0.60.6 give two successes with probability 0.2⋅0.6=0.120.2 \cdot 0.6 = 0.12, while Bin⁡(2,0.4)\operatorname{Bin}(2, 0.4), which uses their average, gives 0.42=0.160.4^2 = 0.16.

Binomial distribution

Definition Let nn be a positive integer and 0≤p≤10 \le p \le 1. The binomial distribution Bin⁡(n,p)\operatorname{Bin}(n, p) is the distribution of the number of successes in nn trials that satisfy the binomial assumptions. If XX is that count and IjI_j is the indicator of success on trial jj, then

X=I1+I2+⋯+In,X = I_1 + I_2 + \cdots + I_n,

where the indicators are independent and each is Bernoulli⁡(p)\operatorname{Bernoulli}(p). The count takes values in {0,1,…,n}\{0, 1, \dots, n\}, and each of these values has positive probability when 0<p<10 < p < 1. The case n=1n = 1 is the Bernoulli distribution. At the endpoints, X=0X = 0 with probability 11 when p=0p = 0, and X=nX = n with probability 11 when p=1p = 1.

In plain words The count keeps the number of successes and forgets where they happened. Different sequences of results can lead to the same count, and the binomial distribution gathers all the sequences with a given count.

Example Five independent checks each succeed with probability 0.40.4, so the number of successes is X∼Bin⁡(5,0.4)X \sim \operatorname{Bin}(5, 0.4) with possible values 00 to 55. Writing S for success and F for failure, the sequences SSFFF and FSFSF are different results, but both give X=2X = 2.

Binomial probability formula

Definition If X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p), then for each integer kk with 0≤k≤n0 \le k \le n the PMF is

pX(k)=(nk)pk(1−p)n−k,p_X(k) = \binom{n}{k} p^{k} (1 - p)^{n - k},

and pX(k)=P(X=k)=0p_X(k) = P(X = k) = 0 for every other value of kk. By independence and the common pp, each particular sequence with kk successes and n−kn - k failures has probability pk(1−p)n−kp^{k}(1 - p)^{n - k}. There are (nk)\binom{n}{k} such sequences, one for each choice of the kk success positions, and they are mutually exclusive, so their probabilities add. The masses sum to 11 by the binomial theorem, since

∑k=0n(nk)pk(1−p)n−k=(p+(1−p))n=1.\begin{aligned} &\sum_{k=0}^{n} \binom{n}{k} p^{k} (1 - p)^{n - k} \\[0.4em] &\quad = \bigl(p + (1 - p)\bigr)^{n} = 1. \end{aligned}

At p=0p = 0 or p=1p = 1 the formula relies on the convention 00=10^0 = 1.

In plain words The coefficient counts the arrangements, the power of pp accounts for the successes in one arrangement, and the power of 1−p1 - p accounts for its failures. Leaving out the coefficient gives the probability of a single arrangement. Leaving out the failure factor ignores what the other trials must do.

Example For X∼Bin⁡(5,0.4)X \sim \operatorname{Bin}(5, 0.4), the single sequence SSFFF has probability (25)2(35)3=1083125=0.03456\bigl(\tfrac{2}{5}\bigr)^2 \bigl(\tfrac{3}{5}\bigr)^3 = \tfrac{108}{3125} = 0.03456. Each of the (52)=10\binom{5}{2} = 10 sequences with two successes has that probability, so

P(X=2)=10⋅1083125=216625=0.3456.\begin{aligned} P(X = 2) &= 10 \cdot \frac{108}{3125} \\[0.4em] &= \frac{216}{625} = 0.3456. \end{aligned}

The whole PMF is below. These decimals are exact, and they add to 11.

kkP(X=k)P(X = k)
000.077760.07776
110.25920.2592
220.34560.3456
330.23040.2304
440.07680.0768
550.010240.01024

Mean of a binomial count

Definition If X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p), then

E[X]=np.E[X] = np.

Writing X=I1+⋯+InX = I_1 + \cdots + I_n with E[Ij]=pE[I_j] = p for each jj, linearity of expectation gives E[X]=p+⋯+p=npE[X] = p + \cdots + p = np. This step uses only linearity, not independence, so any sum of nn indicators that each equal 11 with probability pp has mean npnp, even when the sum is not binomial.

In plain words On average a fraction pp of the trials succeed. The mean is the balance point of the distribution, not a promise about any one group of trials, and it need not be a possible value of the count.

Example For Bin⁡(5,0.4)\operatorname{Bin}(5, 0.4) the mean is 5⋅0.4=25 \cdot 0.4 = 2, yet P(X=2)=0.3456P(X = 2) = 0.3456, so most of the probability, 0.65440.6544, lies on other counts. For Bin⁡(4,0.3)\operatorname{Bin}(4, 0.3) the mean is 1.21.2, which is not a possible count. The number of marked tokens in three draws without replacement from the bag with 44 marked tokens among 1010 also has mean 3⋅25=653 \cdot \tfrac{2}{5} = \tfrac{6}{5}, because each draw is marked with probability 25\tfrac{2}{5} before anything is seen, even though that count is not binomial.

Variance of a binomial count

Definition If X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p), then

Var⁡(X)=np(1−p),\operatorname{Var}(X) = np(1 - p),

and SD⁡(X)=np(1−p)\operatorname{SD}(X) = \sqrt{np(1 - p)}. Because the indicators I1,…,InI_1, \dots, I_n are independent, the variance of their sum is the sum of their variances, each equal to p(1−p)p(1 - p). This step uses independence. For dependent indicators the variance of the count can differ from np(1−p)np(1 - p) even when the mean is still npnp. Both endpoints p=0p = 0 and p=1p = 1 give variance 00.

In plain words For a fixed pp strictly between 00 and 11, the spread of the count grows with the number of trials, but the standard deviation grows like n\sqrt{n}, not like nn. The standard deviation of the count is the square root of the summed variances, not the sum of the standard deviations of the trials.

Example For Bin⁡(5,0.4)\operatorname{Bin}(5, 0.4) the variance is 5⋅0.4⋅0.6=65=1.25 \cdot 0.4 \cdot 0.6 = \tfrac{6}{5} = 1.2, and SD⁡(X)=1.2≈1.10\operatorname{SD}(X) = \sqrt{1.2} \approx 1.10. Adding the five trial standard deviations would give 50.24≈2.455\sqrt{0.24} \approx 2.45, which is wrong. For three draws without replacement from the bag with 44 marked tokens among 1010, the count of marked tokens has mean 1.21.2, the same as Bin⁡(3,0.4)\operatorname{Bin}(3, 0.4), but its variance is 0.560.56 rather than 3⋅0.4⋅0.6=0.723 \cdot 0.4 \cdot 0.6 = 0.72.

Binomial tail probability

Definition A tail probability of X∼Bin⁡(n,p)X \sim \operatorname{Bin}(n, p) is the probability that the count lies at or beyond a threshold, such as P(X≥k)P(X \ge k) or P(X≤k)P(X \le k). It is a finite sum of PMF values. For each integer kk with 1≤k≤n1 \le k \le n,

P(X≥k)=∑j=knP(X=j),P(X \ge k) = \sum_{j=k}^{n} P(X = j),

and the complement rule gives the same number as 1−P(X≤k−1)1 - P(X \le k - 1). The phrase “at least kk” includes kk, while “more than kk” starts at k+1k + 1.

In plain words First translate the words into a list of integer counts. Then add the matching PMF values, or subtract the excluded ones from 11 when that list is shorter.

Example For Bin⁡(5,0.4)\operatorname{Bin}(5, 0.4), at least one success excludes only the count 00, which requires all five trials to fail. So

P(X≥1)=1−(35)5=28823125=0.92224.\begin{aligned} P(X \ge 1) &= 1 - \Bigl(\frac{3}{5}\Bigr)^5 \\[0.4em] &= \frac{2882}{3125} \\[0.4em] &= 0.92224. \end{aligned}

At least three successes is the set of counts {3,4,5}\{3, 4, 5\}, so P(X≥3)=0.2304+0.0768+0.01024=0.31744P(X \ge 3) = 0.2304 + 0.0768 + 0.01024 = 0.31744. A high chance of at least one success does not make each trial likely to succeed, since each one succeeds with probability only 0.40.4.

Check yourself

  1. Four independent trials each succeed with probability 14\tfrac{1}{4}, and XX counts the successes. Find P(X=1)P(X = 1), E[X]E[X] and Var⁡(X)\operatorname{Var}(X).
Show the answer

The count is Bin⁡(4,1/4)\operatorname{Bin}(4, 1/4). There are (41)=4\binom{4}{1} = 4 positions for the single success, so P(X=1)=4⋅14⋅(34)3=2764P(X = 1) = 4 \cdot \tfrac{1}{4} \cdot \bigl(\tfrac{3}{4}\bigr)^3 = \tfrac{27}{64}. The mean is 4⋅14=14 \cdot \tfrac{1}{4} = 1, and the variance is 4⋅14⋅34=344 \cdot \tfrac{1}{4} \cdot \tfrac{3}{4} = \tfrac{3}{4}.

  1. For the same model, find P(X≥2)P(X \ge 2). A classmate computes 1−P(X=0)−P(X=1)−P(X=2)1 - P(X = 0) - P(X = 1) - P(X = 2) instead. Which probability did the classmate find?
Show the answer

At least two successes is the set of counts {2,3,4}\{2, 3, 4\}, so the complement removes only 00 and 11. The probabilities are P(X=0)=(34)4=81256P(X = 0) = \bigl(\tfrac{3}{4}\bigr)^4 = \tfrac{81}{256} and P(X=1)=108256P(X = 1) = \tfrac{108}{256}, so

P(X≥2)=1−189256=67256≈0.262.\begin{aligned} P(X \ge 2) &= 1 - \frac{189}{256} \\[0.4em] &= \frac{67}{256} \approx 0.262. \end{aligned}

The classmate also removed the count 22, which belongs to the event, and so found P(X≥3)=13256P(X \ge 3) = \tfrac{13}{256}.

  1. A box holds 1010 parts, 44 of them defective. An inspector draws 33 parts without replacement and counts the defective ones. Is the count Bin⁡(3,2/5)\operatorname{Bin}(3, 2/5)? Compare the probability that all three are defective with the binomial value.
Show the answer

No. The number of draws is fixed, and each draw is defective with probability 25\tfrac{2}{5} before anything is seen, but the draws are dependent. After a defective first draw, the second is defective with probability 39=13\tfrac{3}{9} = \tfrac{1}{3}, not 25\tfrac{2}{5}. The exact probability that all three are defective is

410⋅39⋅28=130≈0.033,\frac{4}{10} \cdot \frac{3}{9} \cdot \frac{2}{8} = \frac{1}{30} \approx 0.033,

while Bin⁡(3,2/5)\operatorname{Bin}(3, 2/5) gives (25)3=8125=0.064\bigl(\tfrac{2}{5}\bigr)^3 = \tfrac{8}{125} = 0.064. With replacement the draws would be independent with the same success probability, and the binomial model would be exact.

How this lesson connects