Probability & Statistics · Unit 1 · Topic 04

Binomial distribution: counting successes in n tries.

Short answer

If \(X\) counts successes in \(n\) independent trials, each with success probability \(p\) (and \(q = 1 - p\)), then

\[P(X = r) = {}^nC_r\,p^r q^{\,n - r}, \qquad E(X) = np, \qquad \operatorname{Var}(X) = npq\]

For example, the chance of exactly 4 heads in 6 tosses of a fair coin is \(\dfrac{15}{64}\).

Engineering MathsBScStatistics
01

When the binomial distribution applies

Before you start: you need \(^nC_r\) and the idea of a random variable, its mean and variance.

Toss a coin 10 times and count heads. Test 20 bulbs and count defectives. Answer 10 multiple-choice questions by guessing and count the right ones. Each of these repeats one simple trial with two outcomes, and counts the "successes". That count has a binomial distribution when four conditions hold:

  1. The number of trials \(n\) is fixed in advance.
  2. Each trial has two outcomes, success or failure.
  3. The probability of success \(p\) is the same on every trial.
  4. The trials are independent.
Binomial distribution \(X \sim B(n, p)\)

With \(q = 1 - p\), \[P(X = r) = {}^nC_r\, p^r q^{\,n - r}, \qquad r = 0, 1, \dots, n\]

Mean and variance

\(E(X) = np\), \(\;\operatorname{Var}(X) = npq\), \(\;\sigma = \sqrt{npq}\)

Where the formula comes from: one particular order with \(r\) successes and \(n - r\) failures, such as \(SSF\dots F\), has probability \(p^r q^{n - r}\) because the trials are independent. There are \(^nC_r\) ways to choose which \(r\) trials are the successes, and each order has the same probability. The probabilities add to 1 because they are the terms of \((q + p)^n = 1^n\), which is where the name comes from.

Since \(q < 1\), the variance \(npq\) is always less than the mean \(np\). A question that gives a variance bigger than the mean has no binomial answer.

02

At least, at most, and fitting to data

Words in the questionMeansQuick way
exactly 2\(X = 2\)one term
at most 2\(X \le 2\)\(P(0) + P(1) + P(2)\)
at least 2\(X \ge 2\)\(1 - P(0) - P(1)\)
more than 2\(X \ge 3\)\(1 - P(0) - P(1) - P(2)\)
at least one\(X \ge 1\)\(1 - q^n\)

Pick whichever side needs fewer terms. "At least 1 out of 10" is one term by the complement and ten terms directly.

Fitting a binomial distribution

Given observed frequencies \(f\) for \(x = 0, 1, \dots, n\) over \(N\) repeats:

  1. Find the mean \(\bar x = \dfrac{\sum fx}{N}\).
  2. Set \(np = \bar x\), so \(p = \dfrac{\bar x}{n}\) and \(q = 1 - p\).
  3. Expected frequencies are \(N\cdot{}^nC_r\,p^r q^{n - r}\) for each \(r\), usually rounded to whole numbers.

If the expected and observed columns are close, the binomial model fits. Measuring "close" properly is the job of the chi-square test.

03

Solved examples

Example 1: Coin tosses

Easy

A fair coin is tossed 6 times. Find the probability of exactly 4 heads.

  1. \(n = 6\), \(p = q = \tfrac{1}{2}\).
  2. \(P(X = 4) = {}^6C_4\left(\tfrac{1}{2}\right)^4\left(\tfrac{1}{2}\right)^2 = \dfrac{15}{64}\).

Answer\(\dfrac{15}{64}\)

Example 2: Sixes on a die

Easy

A fair die is rolled 5 times. Find the probability of exactly two sixes.

  1. \(n = 5\), \(p = \tfrac{1}{6}\), \(q = \tfrac{5}{6}\).
  2. \(P(X = 2) = {}^5C_2\left(\tfrac{1}{6}\right)^2\left(\tfrac{5}{6}\right)^3 = 10\cdot\dfrac{1}{36}\cdot\dfrac{125}{216} = \dfrac{1250}{7776}\).

Answer\(\dfrac{625}{3888} \approx 0.1608\)

Example 3: At most one defective

Medium

10% of the bulbs from a factory are defective. In a sample of 8 bulbs, find the probability of at most one defective.

  1. \(n = 8\), \(p = 0.1\), \(q = 0.9\). Treat bulbs as independent (the batch is large).
  2. \(P(X = 0) = 0.9^8 \approx 0.43047\).
  3. \(P(X = 1) = 8(0.1)(0.9)^7 \approx 0.38264\).
  4. \(P(X \le 1) \approx 0.43047 + 0.38264\).

Answer\(\approx 0.8131\)

Example 4: How many tosses?

Medium

How many times must a fair coin be tossed so that the probability of at least one head is at least 0.99?

  1. \(P(X \ge 1) = 1 - \left(\tfrac{1}{2}\right)^n\). We need \(1 - \left(\tfrac{1}{2}\right)^n \ge 0.99\).
  2. So \(\left(\tfrac{1}{2}\right)^n \le 0.01\), that is \(2^n \ge 100\).
  3. \(2^6 = 64\) is too small and \(2^7 = 128\) works.

AnswerAt least 7 tosses

Example 5: From the mean and variance

Medium

A binomial variable has mean 4 and variance 3. Find \(n\), \(p\) and \(P(X \ge 1)\).

  1. \(\dfrac{npq}{np} = \dfrac{3}{4}\), so \(q = \dfrac{3}{4}\) and \(p = \dfrac{1}{4}\).
  2. \(np = 4\) gives \(n = 16\).
  3. \(P(X \ge 1) = 1 - q^{16} = 1 - \left(\tfrac{3}{4}\right)^{16} \approx 1 - 0.0100\).

Answer\(n = 16\), \(p = \dfrac{1}{4}\), \(P(X \ge 1) \approx 0.9900\)

Example 6: Guessing a test

Exam level

A test has 10 multiple-choice questions, each with 4 options and one correct answer. A student guesses every answer. Find the probability of at least 8 correct.

  1. \(n = 10\), \(p = \tfrac{1}{4}\), \(q = \tfrac{3}{4}\). Need \(P(8) + P(9) + P(10)\).
  2. \(P(8) = {}^{10}C_8\dfrac{3^2}{4^{10}} = \dfrac{405}{4^{10}}\), \(\;P(9) = \dfrac{10 \cdot 3}{4^{10}} = \dfrac{30}{4^{10}}\), \(\;P(10) = \dfrac{1}{4^{10}}\).
  3. Sum: \(\dfrac{436}{4^{10}} = \dfrac{436}{1048576} = \dfrac{109}{262144}\).

Answer\(\dfrac{109}{262144} \approx 0.00042\)

Example 7: Fitting a binomial

Exam level

Four coins were tossed 80 times. The number of heads \(x\) came up with frequencies \(f\) as below. Fit a binomial distribution and find the expected frequencies. \[\begin{array}{c|ccccc} x & 0 & 1 & 2 & 3 & 4 \\ \hline f & 3 & 12 & 27 & 26 & 12 \end{array}\]

  1. \(N = 80\), \(\sum fx = 0 + 12 + 54 + 78 + 48 = 192\), so \(\bar x = \dfrac{192}{80} = 2.4\).
  2. \(np = 2.4\) with \(n = 4\): \(p = 0.6\), \(q = 0.4\).
  3. Expected \(= 80\cdot{}^4C_r(0.6)^r(0.4)^{4 - r}\): \(2.048\), \(12.288\), \(27.648\), \(27.648\), \(10.368\).

AnswerExpected frequencies \(\approx 2, 12, 28, 28, 10\) (total 80)

Vipul Sir's tip

Before using the formula, I make students write one line: "\(n = \dots\), \(p = \dots\), success means \(\dots\)". Half the wrong answers I mark come from a muddled \(p\), such as using \(\tfrac{1}{6}\) when success was "more than 4" and should be \(\tfrac{2}{6}\).

04

Common mistakes

1. Off by one with "more than" and "at least"

"More than 2" is \(X \ge 3\), so \(P = 1 - P(0) - P(1) - P(2)\). Leaving out \(P(2)\) answers "at least 2", a different question.

2. Accepting a variance bigger than the mean

"Mean 3, variance 4" gives \(q = \tfrac{4}{3}\), which is not a probability. Say so: no binomial distribution has these values.

3. Using the binomial when the trials are not independent

Drawing 3 cards from a deck without replacement changes \(p\) after each draw, so the count of aces is not binomial. With replacement, or from a very large batch, it is.

05

Practice questions

Try each one on paper before you open the answer.

Q1A fair coin is tossed 8 times. Find the probability of exactly 3 heads.

\({}^8C_3\left(\tfrac{1}{2}\right)^8 = \dfrac{56}{256} = \dfrac{7}{32}\).

Q2\(X \sim B(5, 0.2)\). Find \(P(X = 0)\).

\(0.8^5 = 0.32768\).

Q3A binomial variable has mean 6 and variance 2.4. Find \(n\) and \(p\).

\(q = \dfrac{2.4}{6} = 0.4\), so \(p = 0.6\) and \(n = \dfrac{6}{0.6} = 10\).

Q4The probability that a student passes is 0.8. Out of 6 students, find the probability that at least 5 pass.

\(P(5) + P(6) = 6(0.8)^5(0.2) + 0.8^6 = 0.393216 + 0.262144 = 0.65536\).

Q5\(X \sim B\left(12, \tfrac{1}{3}\right)\). Find the mean, variance and standard deviation.

Mean \(= 4\), variance \(= 12\cdot\tfrac{1}{3}\cdot\tfrac{2}{3} = \dfrac{8}{3}\), \(\sigma = \sqrt{8/3} \approx 1.633\).

Q6A die is thrown 4 times. A success is a number greater than 4. Find the probability of at least one success.

\(p = \tfrac{2}{6} = \tfrac{1}{3}\). \(P = 1 - \left(\tfrac{2}{3}\right)^4 = 1 - \dfrac{16}{81} = \dfrac{65}{81}\).

Stuck on a question?

Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.

06

Frequently asked questions

What are the conditions for a binomial distribution?

A fixed number of trials \(n\), two outcomes per trial, the same success probability \(p\) on every trial, and independent trials.

What are the mean and variance of a binomial distribution?

Mean \(np\), variance \(npq\), standard deviation \(\sqrt{npq}\), where \(q = 1 - p\).

Can the variance of a binomial distribution be greater than its mean?

No. Variance \(=\) mean \(\times\, q\), and \(q < 1\) (for \(p > 0\)), so the variance is always smaller than the mean.

When should I use Poisson instead of binomial?

When \(n\) is large and \(p\) is small, the binomial sums get heavy and the Poisson distribution with \(\lambda = np\) gives almost the same answers with far less work.

Related lessons

← All 10 Probability & Statistics topics
Vipul Sir
Written by Vipul Sir

Vipul Sir has taught mathematics for over 15 years to HSC, CBSE, ICSE, IGCSE/IB, Diploma, Engineering and BSc students at VVS Classes in Goregaon and Vile Parle, Mumbai. He teaches every class himself, concepts first and exam technique second.

Probability and Statistics

Get Probability & Statistics right, with Vipul Sir beside you.

Concept-first classes in small batches in Goregaon and Vile Parle, or online. Your first class is free.

WhatsApp↗