Lesson 7 of 7 · 18 min

Simulation, standardising and when the approximation works

Use repeated random sampling for different p and n to examine the distribution of p̂, standardise p̂ to a z-score, and explain why the normal approximation depends on both n and p.

What you will be able to do

  • Standardise a sample proportion using z=p^−pp(1−p)/nz = \frac{\hat{p} - p}{\sqrt{p(1-p)/n}} and interpret the result.
  • Explain why p^−pp^(1−p^)/n\frac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}} is also approximately standard normal for large samples.
  • Use simulation results to judge how closely the normal approximation fits, for different nn and pp.

The normal approximation is an approximation. How good is it? Mathematics gives a partial answer, but the clearest answer comes from simulation: take thousands of random samples, look at the distribution of p^\hat{p}, and compare it with the normal curve. That is what statisticians did to arrive at the rules of thumb.

Key idea

Standardising p̂

Subtracting the mean and dividing by the standard deviation gives the standardised sample proportion

Z=p^−pp(1−p)/n,Z = \frac{\hat{p} - p}{\sqrt{p(1-p)/n}},

which has mean 0 and standard deviation 1, and is approximately N(0,1)N(0, 1) for large samples. A zz-score tells you how many standard deviations a sample proportion is from pp: values beyond about ±2\pm 2 are unusual, and beyond ±3\pm 3 are very rare.

For random samples of 100 from a population with p=0.5p = 0.5, calculate the zz-score of a sample proportion of p^=0.58\hat{p} = 0.58.

In practice you don't know pp — finding it is the whole point of sampling. So you can't calculate p(1−p)/n\sqrt{p(1-p)/n}. The natural move is to use the sample's own proportion in its place:

p^−pp^(1−p^)/n.\frac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}}.

The syllabus asks you to examine, by simulation, whether this is still approximately standard normal. If it is, then about 95 % of samples will have this quantity between −1.96-1.96 and 1.961.96 — the fact the next topic turns into confidence intervals.

1000 simulated random samples for each pair of nn and pp. The last column is the proportion of samples with ∣p^−pp^(1−p^)/n∣≤1.96\left|\frac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}}\right| \le 1.96; for an exact N(0,1)N(0, 1) it would be 0.95.
ppnnnpnpMean of p^\hat{p}SD of p^\hat{p}Theory p(1−p)/n\sqrt{p(1-p)/n}Proportion within ±1.96\pm 1.96
0.520100.5060.1090.1120.970
0.5100500.5000.0500.0500.940
0.12020.1020.0690.0670.867
0.1100100.1000.0310.0300.916
0.1500500.1000.0130.0130.951
0.0210020.0210.0140.0140.878

Read the table in three ways.

  • The mean and SD formulas always hold. In every row, the simulated mean is close to pp and the simulated SD is close to p(1−p)/n\sqrt{p(1-p)/n}, whatever nn and pp are.
  • Normality needs a large nn. For p=0.1p = 0.1, the proportion within ±1.96\pm 1.96 climbs from 0.867 to 0.916 to 0.951 as nn grows from 20 to 500.
  • It also needs pp away from 0 and 1. With n=100n = 100, p=0.5p = 0.5 gives 0.940 but p=0.02p = 0.02 gives only 0.878. What matters is npnp and n(1−p)n(1-p), the expected numbers with and without the attribute.

1000 simulated values of p^\hat{p} for n=30n = 30, p=0.1p = 0.1. Here np=3np = 3: the distribution piles up against 0 and has a long right tail, so a symmetric normal curve fits it poorly.

For which of these will the distribution of p^\hat{p} be closest to normal?

Choose one answer
Interactive

Test the rule of thumb

Start at n=30n = 30, p=0.1p = 0.1 (np=3np = 3). Increase nn until the normal curve fits well. What is npnp when it starts to look right? Try the same with p=0.5p = 0.5.

Worked example

Standardise with p and with p̂

  • Complex familiar
  • Technology active

Suppose 40 % of Australian adults have a streaming music subscription. In a random sample of 150 adults, 69 have one.

(a) Calculate the standardised value p^−pp(1−p)/n\dfrac{\hat{p} - p}{\sqrt{p(1-p)/n}}.

(b) Calculate p^−pp^(1−p^)/n\dfrac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}}, correct to two decimal places, and compare it with (a).

(c) Is this sample unusual?

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Calculate p^\hat{p}, then the standard deviation, then (p^−p)÷SD(\hat{p} - p) \div \mathrm{SD}.

  2. With pp unknown, use p^(1−p^)/n\sqrt{\hat{p}(1-\hat{p})/n} instead.

  3. ∣z∣>2|z| > 2 is unusual; ∣z∣>3|z| > 3 is very unusual.

Watch out for

  • Dividing by the variance instead of the standard deviation.

  • Mixing the two forms, e.g. p(1−p^)/n\sqrt{p(1-\hat{p})/n}.

Common mistake

When the normal model breaks

With npnp small, the normal model gives impossible answers: a positive probability that p^<0\hat{p} < 0, and a symmetric spread when the real distribution is piled up against 0. If p^=0\hat{p} = 0 the standardised quantity p^−pp^(1−p^)/n\frac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}} can't even be calculated (you would divide by 0). In these cases use the exact binomial distribution instead.

Worked example

When the normal approximation fails

  • Complex unfamiliar
  • Technology active

A factory says 3 % of its light globes are faulty. An inspector tests a random sample of 50 globes.

(a) Find the mean and standard deviation of p^\hat{p}.

(b) A student uses the normal approximation to calculate P(p^<0)P(\hat{p} < 0). Find the value they get, correct to three decimal places, and explain why it shows the approximation is poor here.

(c) Use the binomial distribution to find P(p^=0)P(\hat{p} = 0), and describe the shape of the true distribution of p^\hat{p}.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Check npnp and n(1−p)n(1-p) before trusting the normal model.

  2. A positive probability for an impossible value is a sign that the model doesn't fit.

  3. When npnp is small, use the binomial distribution.

Watch out for

  • Reporting 0.107 as the probability of a negative proportion without questioning it.

  • Thinking the mean and SD formulas fail too: they are exact. Only normality fails.

Exam tip

Explaining the approximation

If asked to explain or justify whether the normal approximation is appropriate, calculate npnp and n(1−p)n(1-p), compare them with the rule of thumb, and say what that means for the shape (symmetric and bell-shaped, or skewed). Refer to simulation or the exact binomial when the question gives you that evidence.

Summary

  • Z=p^−pp(1−p)/nZ = \frac{\hat{p} - p}{\sqrt{p(1-p)/n}} is approximately N(0,1)N(0, 1) for large samples; ∣z∣>2|z| > 2 is unusual.

  • With p^\hat{p} in place of the unknown pp, p^−pp^(1−p^)/n\frac{\hat{p} - p}{\sqrt{\hat{p}(1-\hat{p})/n}} is also approximately standard normal for large samples.

  • E(p^)=pE(\hat{p}) = p and SD(p^)=p(1−p)/n\mathrm{SD}(\hat{p}) = \sqrt{p(1-p)/n} hold for every nn and pp; normality needs large npnp and n(1−p)n(1-p).

  • Simulation shows the approximation improving as nn grows, and worsening as pp moves towards 0 or 1.

  • When npnp or n(1−p)n(1-p) is small, use the exact binomial distribution.

Finished the lesson?

Try the 2 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 7 of 70% read

Save your progress with a free account