Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Methods (Unit 3 & 4) Bernoulli sequences and the binomial distribution

Finding the sample size

20 practice questions 0 video lessons Theory + worked examples

In Year 12 Mathematical Methods (Queensland, QCAA), finding the sample size means finding \(n\), the number of independent Bernoulli trials, so that a binomial condition holds. Most often you want \(P(\text{at least one success})=1-(1-p)^{n}\) to reach a target \(c\): solve \(1-(1-p)^{n}\ge c\) for \(n\) with logarithms and round up. You also find \(n\) from an expected count \(np\), and find \(n\) and \(p\) from the binomial mean \(np\) and variance \(np(1-p)\).

A binomial random variable \(X\sim B(n,p)\) counts the number of successes in \(n\) independent Bernoulli trials, each with the same success probability \(p\). When \(n\) is the unknown and you are told a condition the distribution must satisfy, the task is to find the sample size \(n\).

The most common condition uses the complement. In one trial \(P(\text{no success})=1-p\), so in \(n\) independent trials \(P(\text{no successes})=(1-p)^{n}\) and

\[P(\text{at least one success})=1-(1-p)^{n}.\]

This probability increases towards \(1\) as \(n\) grows (each extra trial can only raise it), so requiring it to reach a target \(c\) gives an inequality you solve for \(n\). Because \(n\) is a whole number of trials, you round up.

Two other "find \(n\)" tasks appear: finding \(n\) so an expected count \(np\) meets a threshold, and finding \(n\) and \(p\) together from the binomial mean \(np\) and variance \(np(1-p)\).

Key idea. \(P(\text{at least one success})=1-(1-p)^{n}\). To find \(n\), set this \(\ge c\), rearrange to \((1-p)^{n}\le 1-c\), take logarithms, and round up.
The probability of at least one success rising towards 1 as n increasesA curve of P against the number of trials n. It starts at 0 when n is 0, rises with ever-smaller steps, and approaches a dashed line P equals 1 at the top; a dashed line marks the target c that it crosses. P=1 P=c n P
\(P(\text{at least one})=1-(1-p)^{n}\) rises towards \(1\); the smallest \(n\) above the target \(c\) is the answer
\(\mu\)\(=\)\(np\)
\(\sigma^{2}\)\(=\)\(np(1-p)\)
\(\dfrac{\sigma^{2}}{\mu}\)\(=\)\(1-p\)
Dividing the variance by the mean cancels \(np\) and leaves \(1-p\), giving \(p\) and then \(n\)

Probability of at least one success in \(n\) trials:

\[P(\text{at least one success})=1-(1-p)^{n}\]

Solving the "at least one" condition for \(n\) (note the inequality reverses when dividing by \(\log(1-p)<0\)):

\[1-(1-p)^{n}\ge c \;\Longrightarrow\; (1-p)^{n}\le 1-c \;\Longrightarrow\; n\ge \dfrac{\log(1-c)}{\log(1-p)}\]

Binomial mean and variance (for finding \(n\) and \(p\)):

\[\mu=np \qquad \sigma^{2}=np(1-p) \qquad 1-p=\dfrac{\sigma^{2}}{\mu}\]
Round up. After solving the inequality, \(n\) is the smallest whole number that satisfies it: if \(n\ge 6.6\) then \(n=7\), never \(6\).

How to find the sample size

  1. Write the condition. For "at least one success", use \(P(\text{at least one})=1-(1-p)^{n}\) and set it \(\ge\) (or \(>\)) the target \(c\).
  2. Isolate the power. Rearrange to \((1-p)^{n}\le 1-c\) (or \(<1-c\)).
  3. Take logarithms and divide. \(n\log(1-p)\le \log(1-c)\); dividing by \(\log(1-p)\) (which is negative) reverses the inequality: \(n\ge \dfrac{\log(1-c)}{\log(1-p)}\).
  4. Round up. Take the smallest whole number of trials that satisfies the inequality.
  5. From mean and variance instead: divide \(\sigma^{2}\) by \(\mu\) to get \(1-p\) (hence \(p\)), then \(np=\mu\) gives \(n\). From an expected count: set \(np\ge m\) and solve, then round up.
Check with technology. QCAA-approved technology confirms \(n\): evaluate \(1-(1-p)^{n}\) at your \(n\) and at \(n-1\) to be sure the smaller value fails the condition.
Example 1 — Fair coin, at least one head
How many times must a fair coin be tossed so that the probability of at least one head is at least \(0.95\)?
Solution
\(1-0.5^{n}\)\(\ge\)\(0.95\)
\(0.5^{n}\)\(\le\)\(0.05\)
\(n\)\(\ge\)\(\dfrac{\log 0.05}{\log 0.5}=4.32\ldots\)

Round up: \(n=\mathbf{5}\) tosses.

Example 2 — From mean and variance
A binomial variable \(X\sim B(n,p)\) has mean \(\mu=12\) and variance \(\sigma^{2}=9.6\). Find \(p\) and \(n\).
Solution
\(1-p=\dfrac{\sigma^{2}}{\mu}\)\(=\)\(\dfrac{9.6}{12}=0.8\)
\(p\)\(=\)\(0.2\)
\(n\times 0.2=12\Rightarrow n\)\(=\)\(60\)

So \(p=\mathbf{0.2}\) and \(n=\mathbf{60}\).

Example 3 — Rolling a die
How many times must a die be rolled so that the probability of at least one six is at least \(0.90\)?
Solution
\(1-\left(\tfrac{5}{6}\right)^{n}\)\(\ge\)\(0.90\)
\(\left(\tfrac{5}{6}\right)^{n}\)\(\le\)\(0.10\)
\(n\)\(\ge\)\(\dfrac{\log 0.10}{\log(5/6)}=12.6\ldots\)

Round up: \(n=\mathbf{13}\) rolls.

Example 4 — From an expected count
In a shipment \(40\%\) of items are premium. How many items must be sampled so the expected number of premium items is at least \(30\)?
Solution
\(E(X)=np\)\(=\)\(0.4\,n\)
\(0.4\,n\)\(\ge\)\(30\)
\(n\)\(\ge\)\(75\)

So \(n=\mathbf{75}\) items must be sampled.

Common pitfalls

Round up, never down. \(n\) is a whole number of trials and the probability rises with \(n\), so take the smallest whole number that still meets the condition. \(n\ge 6.6\) means \(n=7\), not \(6\).
Use \((1-p)^{n}\), not \(p^{n}\). "No successes" needs the failure probability \(1-p\) each trial, so \(P(\text{none})=(1-p)^{n}\) and \(P(\text{at least one})=1-(1-p)^{n}\).
The inequality flips. Dividing by \(\log(1-p)\), which is negative, reverses \(\le\) to \(\ge\). Solving \((1-p)^{n}\le 1-c\) gives \(n\ge \dfrac{\log(1-c)}{\log(1-p)}\).

Frequently asked questions

What is the "sample size" here?

It is \(n\), the number of independent Bernoulli trials, chosen so that a binomial condition (usually about at least one success) holds.

Why is \(P(\text{at least one})=1-(1-p)^{n}\)?

By the complement: the only way to avoid "at least one" is "none", and \(P(\text{none})=(1-p)^{n}\) for \(n\) independent trials.

How do I solve \(1-(1-p)^{n}\ge c\)?

Rearrange to \((1-p)^{n}\le 1-c\), take logs, divide by \(\log(1-p)\) (reversing the inequality), then round up.

Why round up?

Because \(n\) must be a whole number and the probability increases with \(n\); the smallest whole number above the solution is the one that works.

How do I find \(n\) and \(p\) from the mean and variance?

Divide the variance by the mean to get \(1-p\) (hence \(p\)); then \(np=\mu\) gives \(n\).

Is this the normal-approximation sample size?

No. This is the exact binomial "find \(n\)" skill. Sample size from a normal approximation or a confidence interval for a proportion is a separate topic in sampling and interval estimates.

Create a free accountTrack your progress and save your work as you go.
Create free account