Skip to content

Unit 2: Probability, Random Variables, and Probability Distributions

The Binomial Distribution

Decide whether a count is binomial, then find binomial probabilities, the mean np and the standard deviation, and interpret them in context.

Topic 2.10 · 9 min read

About 7% of blood donors have type O-negative blood. If 12 donors walk into a blood drive, how likely is it that exactly 2 of them are O-negative? The count comes from a fixed number of tries, 12 donors, each of which either "hits" (is O-negative) or doesn't with the same chance, 0.07. Every count built that way has a binomial distribution.

What makes a random variable binomial

A binomial random variable XX counts the number of successes in a sequence of trials that meet four conditions:

  1. Binary: each trial has exactly two outcomes, called success and failure. "Success" is just the outcome you are counting; an O-negative donor is a success even though nothing good happened.
  2. Independent: the outcome of one trial doesn't change the probabilities for any other trial.
  3. Number: the number of trials, nn, is fixed in advance.
  4. Same probability: the probability of success, pp, is the same on every trial, so the probability of failure is 1−p1 - p every time.

If all four hold, XX has a binomial distribution with parameters nn and pp. For the blood drive, n=12n = 12 donors and p=0.07p = 0.07.

Two common ways to fail the conditions are worth knowing by sight. If you keep going until something happens (shoot free throws until the first miss), the number of trials isn't fixed, so the count is not binomial. If you draw without replacement from a small group, the success probability changes from draw to draw, so the trials are not independent: deal 5 cards from 20 trivia cards of which 8 are sports cards, and the chance the second card is a sports card is 7/197/19 or 8/198/19, depending on the first card, not 8/208/20.

Sampling without replacement from a large population is different. Choosing 15 adults from a city of 400,000 changes the proportion left in the city by a negligible amount, so the trials are close enough to independent. AP Statistics uses the rule that the sample should be at most 10% of the population; 15 is far below 10% of 400,000.

The probability of exactly xx successes

Start with a small case. Suppose n=4n = 4 and you want exactly 2 successes. One way is SSFF. Because the trials are independent, its probability is the product p⋅p⋅(1−p)⋅(1−p)=p2(1−p)2p \cdot p \cdot (1-p) \cdot (1-p) = p^2(1-p)^2. Every other arrangement, like SFSF or FFSS, contains the same two S's and two F's, so it has the same probability. The number of arrangements is the number of ways to choose which 2 of the 4 trials are the successes, (42)=6\binom{4}{2} = 6. So P(X=2)=6p2(1−p)2P(X = 2) = 6p^2(1-p)^2.

The same reasoning works for any nn and xx:

P(X=x)=(nx)px(1−p)n−x,x=0,1,2,…,n,P(X = x) = \binom{n}{x} p^x (1-p)^{n-x}, \qquad x = 0, 1, 2, \ldots, n,

where (nx)=n!x!(n−x)!\binom{n}{x} = \frac{n!}{x!(n-x)!} (on a calculator, n nCr xn \, \text{nCr} \, x) counts the arrangements. This is the binomial probability function.

Questions usually ask about a range of values rather than one, and the wording decides the range. With n=10n = 10: "at most 3" is P(X≤3)P(X \le 3); "fewer than 3" is P(X≤2)P(X \le 2); "at least 3" is P(X≥3)=1−P(X≤2)P(X \ge 3) = 1 - P(X \le 2); "more than 3" is P(X≥4)=1−P(X≤3)P(X \ge 4) = 1 - P(X \le 3). On a TI-84, binompdf(n, p, x) gives P(X=x)P(X = x) and binomcdf(n, p, x) gives P(X≤x)P(X \le x), the cumulative probability. The complement is what makes "at least" quick: adding many separate probabilities is slow and error-prone.

Mean and standard deviation: npnp and np(1−p)\sqrt{np(1-p)}

Look at one trial first. It produces 1 success with probability pp and 0 successes with probability 1−p1 - p. Topic 2.9's formulas give its mean, 1⋅p+0⋅(1−p)=p1 \cdot p + 0 \cdot (1-p) = p, and its variance, (1−p)2p+(0−p)2(1−p)=p(1−p)(1-p)^2 p + (0-p)^2(1-p) = p(1-p). A binomial count is the total of nn such trials. Their means add, so the mean count is npnp; because the trials are independent, their variances add too, giving np(1−p)np(1-p), and the standard deviation is its square root.

The answers are parameters, and they need the same long-run interpretation as any mean and standard deviation. For the blood drive, μX=12(0.07)=0.84\mu_X = 12(0.07) = 0.84 and σX=12(0.07)(0.93)≈0.88\sigma_X = \sqrt{12(0.07)(0.93)} \approx 0.88: over many, many groups of 12 randomly chosen donors, the average number of O-negative donors per group is about 0.84, and the number in a group typically varies from 0.84 by about 0.88 donors.

The shape depends on pp. When p=0.5p = 0.5 the distribution is symmetric. When pp is small, most of the probability sits at low counts and there's a tail to the right; when pp is large, the tail runs to the left, as the figure in Example 3 shows.

Estimating binomial probabilities by simulation

Every binomial probability can be computed exactly, but a simulation (Topic 2.3) estimates it with no formula at all, and it is the method to fall back on when the setup is messy. Suppose a student guesses on all 5 questions of a quiz, each with 4 choices, so XX = number correct is binomial with n=5n = 5 and p=0.25p = 0.25. To simulate one quiz, generate 5 random integers from 1 to 4 (randInt(1, 4, 5) on a TI-84), call a 1 a correct answer, and count the 1's. One run of 200 simulated quizzes gave these results:

Number correct012345Simulated quizzes4876551641\begin{array}{l|cccccc} \text{Number correct} & 0 & 1 & 2 & 3 & 4 & 5 \\ \hline \text{Simulated quizzes} & 48 & 76 & 55 & 16 & 4 & 1 \end{array}

The estimate of P(X≥3)P(X \ge 3) is the fraction of simulated quizzes with 3 or more correct: 16+4+1200=0.105\frac{16 + 4 + 1}{200} = 0.105. The exact value is P(X≥3)=1−P(X≤2)≈0.104P(X \ge 3) = 1 - P(X \le 2) \approx 0.104. The two agree closely because 200 repetitions is a fair number; with 20 repetitions the estimate could easily be off by 0.05 or more. Either way, a guesser gets 3 or more right only about 1 time in 10.

Worked examples

Worked exampleExample 1: binomial or not?

For each random variable, say whether it is binomial. If it is, give nn and pp; if not, name the condition that fails.

(a) A fair six-sided die is rolled 10 times. XX = the number of 6s.

(b) Five cards are dealt without replacement from 20 trivia cards, 8 of which are sports questions. YY = the number of sports cards dealt.

(c) A player shoots free throws until she misses. WW = the number of shots taken.

(d) 15 adults are randomly selected from a city of 400,000 in which 34% of adults own a cat. CC = the number who own a cat.

Show solution

(a) Binomial, n=10n = 10, p=1/6p = 1/6. Each roll is a 6 or not a 6, the rolls are independent, there are exactly 10 rolls, and the chance of a 6 is 1/61/6 every time.

(b) Not binomial. The cards are dealt without replacement and 5 is 25% of the 20 cards, far more than 10%, so the probability of a sports card changes from card to card and the trials are not independent.

(c) Not binomial. The number of trials is not fixed; WW counts trials until an event, not successes in a set number of trials.

(d) Binomial (approximately), n=15n = 15, p=0.34p = 0.34. Each adult owns a cat or doesn't, there are 15 adults, and the probability is 0.34 for each one. The sampling is without replacement, but 15 is far less than 10% of 400,000, so treating the trials as independent is reasonable.

Worked exampleExample 2: the blood drive, by formula

About 7% of donors have type O-negative blood. Twelve randomly selected donors arrive at a blood drive. Find the probability that exactly 2 are O-negative, and the probability that at least 1 is.

Show solution

Let XX = number of O-negative donors among the 12. XX is binomial with n=12n = 12 and p=0.07p = 0.07: each donor is O-negative or not, the donors are randomly selected from a huge donor population (so independent), nn is fixed at 12, and p=0.07p = 0.07 for each donor.

P(X=2)=(122)(0.07)2(0.93)10=66(0.0049)(0.4840)≈0.157.P(X = 2) = \binom{12}{2}(0.07)^2(0.93)^{10} = 66(0.0049)(0.4840) \approx 0.157.

For "at least 1", the complement is "none", which is one term instead of eleven:

P(X≥1)=1−P(X=0)=1−(0.93)12≈1−0.419=0.581.P(X \ge 1) = 1 - P(X = 0) = 1 - (0.93)^{12} \approx 1 - 0.419 = 0.581.

There's about a 15.7% chance that exactly 2 of the 12 donors are O-negative, and about a 58.1% chance that at least one is.

Worked exampleExample 3: an exam-style question

A seed company states that 85% of its tomato seeds germinate. A gardener plants 20 seeds randomly selected from a large shipment, in separate pots. Let XX be the number that germinate. Assume the company's claim is true.

Bar graph of the probability distribution of X, the number of seeds out of 20 that germinate when p = 0.85, for x from 8 to 20. Bars are near zero up to x = 11, then rise: x = 12, about 0.005; 13, 0.016; 14, 0.045; 15, 0.103; 16, 0.182; 17, 0.243; 18, 0.229; 19, 0.137; 20, 0.039. The tallest bar is at 17, and the distribution has a long tail to the left.

(a) Calculate and interpret the mean of XX.

(b) Calculate and interpret the standard deviation of XX.

(c) Find the probability that fewer than 15 seeds germinate.

(d) Only 13 of the gardener's seeds germinate. Does this give reason to doubt the company's claim? Justify your answer with a probability.

Show solution

XX is binomial with n=20n = 20 and p=0.85p = 0.85: each seed germinates or doesn't, 20 seeds are planted, the seeds come from a large shipment (20 is less than 10% of it) and sit in separate pots, so they germinate independently, each with probability 0.85 under the claim.

(a) μX=np=20(0.85)=17\mu_X = np = 20(0.85) = 17 seeds. If the gardener planted many, many sets of 20 of these seeds, the average number germinating per set would be about 17 seeds.

(b) σX=np(1−p)=20(0.85)(0.15)=2.55≈1.60\sigma_X = \sqrt{np(1-p)} = \sqrt{20(0.85)(0.15)} = \sqrt{2.55} \approx 1.60 seeds. The number of seeds out of 20 that germinate typically varies from the mean of 17 by about 1.60 seeds.

(c) "Fewer than 15" means 14 or fewer: P(X≤14)=binomcdf(n=20,p=0.85,x=14)≈0.067P(X \le 14) = \text{binomcdf}(n = 20, p = 0.85, x = 14) \approx 0.067.

(d) The relevant probability is getting a result as low as 13 or lower: P(X≤13)=binomcdf(n=20,p=0.85,x=13)≈0.022P(X \le 13) = \text{binomcdf}(n = 20, p = 0.85, x = 13) \approx 0.022. If 85% of the seeds really germinate, only about 2.2% of gardeners planting 20 seeds would see 13 or fewer germinate. That is unlikely enough to give reason to doubt the claim; the true germination rate may be lower than 85%.

Why "13 or fewer" and not "exactly 13"? Any single count is fairly unlikely (even the most likely value, 17, has probability about 0.243). The question is whether the gardener's result is unusually low, which is about the whole tail at or below 13. Topic 3.6 turns this idea into the p-value.

Where students lose points

On the exam

Binomial questions appear in multiple choice and in free response, usually with a calculator. Free-response parts typically ask you to identify the distribution with its parameters, find a probability (often "at least" or "at most"), compute or interpret the mean or standard deviation, and judge whether an observed count is surprising. Judge that last task with a tail probability like P(X≤13)P(X \le 13), not the probability of the single observed value.

Check yourself

  1. Question 1

    Which of these random variables has a binomial distribution?

    1. A

      The number of times a die is rolled until the first 6 appears

    2. B

      The number of girls among 3 students chosen without replacement from a class of 12 girls and 10 boys

    3. C

      The number of questions a student answers correctly on a 10-question test whose questions range from easy to very hard

    4. D

      The number of days, out of 8 commutes, on which a driver arrives at a light that is red 40% of the time, with arrivals on different days independent

    Show answer

    D

    D has a fixed n=8n = 8, two outcomes per day (red or not), independent days and the same p=0.4p = 0.4 each day. A has no fixed number of trials. B draws without replacement from only 22 students, and 3 is more than 10% of 22, so the trials aren't independent. C fails the same-probability condition: harder questions have a lower chance of a correct answer.

  2. Question 2

    40% of a store's customers use a loyalty card. Five customers are selected at random. What is the probability that exactly 3 of them use a loyalty card?

    Show answer

    (53)(0.4)3(0.6)2=10(0.064)(0.36)=0.2304\binom{5}{3}(0.4)^3(0.6)^2 = 10(0.064)(0.36) = 0.2304

    The count is binomial with n=5n = 5 and p=0.4p = 0.4. Each order with three users and two non-users has probability (0.4)3(0.6)2(0.4)^3(0.6)^2, and there are (53)=10\binom{5}{3} = 10 such orders.

  3. Question 3

    XX is binomial with n=10n = 10 and p=0.3p = 0.3. Which expression equals the probability that XX is more than 4?

    1. A

      1−P(X≤4)1 - P(X \le 4)

    2. B

      1−P(X≤5)1 - P(X \le 5)

    3. C

      1−P(X≤3)1 - P(X \le 3)

    4. D

      P(X≤4)P(X \le 4)

    Show answer

    A

    "More than 4" means X≥5X \ge 5, whose complement is X≤4X \le 4, so the probability is 1−P(X≤4)≈0.1501 - P(X \le 4) \approx 0.150. C gives P(X≥4)P(X \ge 4), which wrongly includes 4; B leaves out 5; D is the complement itself.

  4. Question 4

    On a shopping website, 12% of visitors click a particular ad, independently of one another. For a random sample of 400 visitors, let XX be the number who click it. Find the mean and standard deviation of XX and interpret the mean.

    Show answer

    μX=400(0.12)=48\mu_X = 400(0.12) = 48 visitors and σX=400(0.12)(0.88)≈6.50\sigma_X = \sqrt{400(0.12)(0.88)} \approx 6.50 visitors. Over many, many random samples of 400 visitors, the average number who click the ad would be about 48.

    XX is binomial with n=400n = 400 and p=0.12p = 0.12, so μX=np\mu_X = np and σX=np(1−p)=42.24\sigma_X = \sqrt{np(1-p)} = \sqrt{42.24}. The interpretation is a long-run average over repeated samples of 400, not a prediction that exactly 48 will click.

Go deeper