IB Diploma Mathematics AI · Statistics and probability
Confidence intervals and further tests (HL)
1Unbiased estimates and the central limit theorem
A sample is used to estimate the population.
- The sample mean $\bar{x}$ is an unbiased estimate of the population mean $\mu$.
- An unbiased estimate of the population variance is $s_{n-1}^2 = \dfrac{n}{n-1} s_n^2$. Dividing by $n - 1$ corrects for samples being slightly less spread than the population. A GDC shows $s_{n-1}$ as "$s_x$".
- The central limit theorem: for a large sample (as a rule, $n \ge 30$) from any population with mean $\mu$ and variance $\sigma^2$, the sample mean is approximately $\bar{X} \sim N\!\left(\mu, \frac{\sigma^2}{n}\right)$.
- If the population itself is normal, $\bar{X}$ is exactly normal for any $n$.
Using the central limit theorem
- Bags have mean mass 50 g and standard deviation 12 g. A sample of 36 is taken.
- $\bar{X} \sim N(50, \frac{144}{36}) = N(50, 2^2)$.
- $P(\bar{X} > 53) = P(Z > 1.5) = 0.0668$.
An unbiased variance
- A sample of 10 has $s_n = 2$, so $s_n^2 = 4$.
- $s_{n-1}^2 = \frac{10}{9} \times 4 = 4.44$.
Check yourself
A sample of size 64 is taken from a population with standard deviation 16. What is the standard deviation of the sample mean?
Show the answer
2
σ/√n = 16/8 = 2.
2Combining random variables
For any random variables, and constants $a$ and $b$:
- $E(aX + b) = aE(X) + b$ and $\text{Var}(aX + b) = a^2\text{Var}(X)$. Adding a constant shifts but does not spread.
- $E(X \pm Y) = E(X) \pm E(Y)$.
- If $X$ and $Y$ are independent, $\text{Var}(X \pm Y) = \text{Var}(X) + \text{Var}(Y)$. Variances add even when you subtract.
- Any linear combination of independent normal variables is normal.
- $X_1 + X_2$ (two separate items) is different from $2X$ (one item doubled): $\text{Var}(X_1 + X_2) = 2\sigma^2$ but $\text{Var}(2X) = 4\sigma^2$.
A box of apples
- Each apple has mass $N(150, 10^2)$ grams, independently. A box holds 6.
- Total mass $T$: mean $6 \times 150 = 900$, variance $6 \times 100 = 600$, so $T \sim N(900, 600)$.
- $P(T > 950) = 0.0206$.
Check yourself
Var(X) = 4 and Var(Y) = 9, with X and Y independent. What is Var(X − Y)?
Show the answer
13
Variances add for a difference too.
3Confidence intervals for a mean
A confidence interval gives a range of likely values for the population mean.
- Form: $\bar{x} \pm (\text{critical value}) \times \dfrac{\text{standard deviation}}{\sqrt{n}}$
- If the population standard deviation $\sigma$ is known, use the normal ($z$) value: 1.960 for 95%.
- If $\sigma$ is unknown, use $s_{n-1}$ and the $t$-distribution with $n - 1$ degrees of freedom. On the GDC this is "T Interval".
- Meaning of a 95% interval: if we took many samples and built an interval from each, about 95% of the intervals would contain $\mu$.
- A larger sample gives a narrower interval; a higher confidence level gives a wider one.
About 95% of intervals built this way contain the true mean; a few miss it
A t-interval
- A sample of 25 battery lives has $\bar{x} = 52.3$ hours and $s_{n-1} = 4.5$ hours. Find a 95% confidence interval.
- Standard error $= \frac{4.5}{\sqrt{25}} = 0.9$. With 24 degrees of freedom the critical value is 2.064.
- $52.3 \pm 2.064 \times 0.9 = 52.3 \pm 1.86$.
- Interval: $(50.4, 54.2)$ hours.
- A claim that the mean is 55 hours is not supported, because 55 lies outside the interval.
Check yourself
How does a 99% confidence interval compare with a 95% one from the same data?
Show the answer
It is wider
More confidence needs a wider net.
4Tests for binomial and Poisson data
The method is always the same: state $H_0$ and $H_1$, find the p-value (the probability, assuming $H_0$, of a result at least as extreme as the one seen), and compare it with the significance level.
- Binomial test for a proportion: $X \sim B(n, p)$ under $H_0$.
- Poisson test for a mean rate: $X \sim \text{Po}(m)$ under $H_0$.
- A one-tailed test looks in one direction ($p > 0.5$); a two-tailed test looks for any change ($p \ne 0.5$).
- A test for correlation: $H_0: \rho = 0$ against $H_1: \rho \ne 0$ (or $\rho > 0$), using the GDC's p-value from the sample $r$ and $n$.
Is the coin biased towards heads?
- $H_0: p = 0.5$, $H_1: p > 0.5$, 5% level. 20 throws give 15 heads.
- $X \sim B(20, 0.5)$. p-value $= P(X \ge 15) = 0.0207$.
- $0.0207 < 0.05$, so reject $H_0$: there is evidence the coin is biased towards heads.
Testing correlation
- 10 pairs give $r = 0.72$. Test $H_0: \rho = 0$ against $H_1: \rho \ne 0$ at 5%.
- The GDC gives a p-value of 0.0189.
- $0.0189 < 0.05$, so there is evidence of correlation in the population.
Check yourself
A one-tailed test gives a p-value of 0.08 at the 5% level. What is the conclusion?
Show the answer
Do not reject H₀
0.08 > 0.05; we never prove H₀, we just lack evidence against it.
5Type I and Type II errors
- A Type I error is rejecting $H_0$ when it is actually true. Its probability is the probability of landing in the critical region under $H_0$ (at most the significance level).
- A Type II error is not rejecting $H_0$ when it is actually false. To find its probability you need the true value of the parameter.
- Lowering the significance level makes Type I errors rarer but Type II errors more common.
- For discrete distributions the actual Type I probability is usually a little different from the nominal level.
A machine's fault rate
- Normally a machine has 4 faults a day. A manager will decide it needs repair if there are 8 or more faults in a day.
- $P(\text{Type I}) = P(X \ge 8 \mid m = 4) = 0.0511$.
- Suppose the rate has really risen to 6. $P(\text{Type II}) = P(X \le 7 \mid m = 6) = 0.744$.
- So a real rise to 6 faults a day would be missed about three times out of four.
Check yourself
What is a Type II error?
Show the answer
Failing to reject H₀ when H₀ is false
Type II is a missed real effect.
6Interpreting a confidence interval
A 95% confidence interval for a mean is a range constructed so that, in repeated sampling, 95% of such intervals would contain the true mean.
Worked example
- A sample of 40 batteries has mean life 52.3 hours.
- A GDC gives a 95% confidence interval of $(50.1, 54.5)$ hours.
- Interpretation: we are 95% confident the true mean battery life is between 50.1 and 54.5 hours.
- The manufacturer claims a mean of 56 hours. Since 56 is outside the interval, the claim is doubtful.
Wider intervals come from higher confidence levels, smaller samples or more variable data.
Check yourself
How does a larger sample affect a confidence interval?
Show the answer
It makes the interval narrower
More data, more precision.
7Type I and Type II errors in context
- Type I error: rejecting $H_0$ when it is true. Its probability equals the significance level.
- Type II error: failing to reject $H_0$ when it is false.
A new medicine
- $H_0$: the medicine has no effect.
- Type I error: concluding it works when it does not, so patients get an ineffective drug.
- Type II error: concluding it does not work when it does, so a useful drug is abandoned.
- Lowering the significance level reduces Type I errors but increases the chance of Type II errors.
Check yourself
What is a Type I error?
Show the answer
Rejecting $H_0$ when it is actually true
False positive.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera