Back to homeMathematics · 6th Year HL · Change subject
Start for free
6th Year HL · Mathematics
Statistics · Inference

Confidence intervals

A newspaper opinion poll before a general election asks about 1,000 people, not the whole country, yet it reports a margin of error for how every voter in Ireland thinks. How can that be justified? A survey, a quality check or a poll always works with a sample. Statistical inference is the bridge that goes from that sample data to a statement about the whole population, with an explicit margin of error and a confidence level that tells you how far you can trust that margin. We will come back to the poll at the end of the page.

The sample mean as a random variable

Comparison between the normal curve of the general population and the narrower, more concentrated curve of the sample mean. X (population, n = 1) X̄ (large sample): narrower
Practice★☆☆Not started
A social media analyst wants to study the daily time that Irish teenagers aged between 15 and 18 spend on TikTok*. To do so, they randomly select 400 users in this age…

A social media analyst wants to study the daily time that Irish teenagers aged between 15 and 18 spend on TikTok. To do so, they randomly select 400 users in this age group across the country and record their connection times.

Clearly identify the following elements of the statistical study:

  1. a) The population under study.
  1. b) The sample selected.
  1. c) The sample size.
  1. d) The statistic that would be calculated to summarise the information from the sample.
Solve
Practice★☆☆Not started
It is known that the waiting time in the queue of a popular theme park ride follows a normal distribution with a mean of $\mu = 45$ minutes and a standard deviation of…

It is known that the waiting time in the queue of a popular theme park ride follows a normal distribution with a mean of $\mu = 45$ minutes and a standard deviation of $\sigma = 12$ minutes.

If we choose a random sample of $n = 36$ visitors who have been on the ride:

  1. What distribution does the sample mean $\bar{X}$ follow? State its mean and standard deviation (standard error).

  2. Calculate the probability that the mean waiting time of this sample is greater than $48$ minutes.

Solve

Confidence interval for a mean

For another confidence level, find $z_{\alpha/2}$ in the normal tables: the table gives $P(Z

Diagram of the confidence interval for the mean centred on the sample mean x̄, with the maximum error E on both sides and the endpoints x̄ − E and x̄ + E. confidence interval x̄ E E x̄ − E x̄ + E
Practice★☆☆Not started
In statistical inference, the critical value $z_{\alpha/2}$ is essential for determining the width of a confidence interval. It is the value of the standard normal…

In statistical inference, the critical value $z_{\alpha/2}$ is essential for determining the width of a confidence interval. It is the value of the standard normal distribution $N(0, 1)$ that leaves an area $\alpha/2$ to its right, where $1-\alpha$ is the confidence level (in the figure, the central area is $1-\alpha$ and each tail is $\alpha/2$).

Using the standard normal distribution table $N(0, 1)$, find the critical values $z_{\alpha/2}$ corresponding to the following confidence levels:

  1. a) A confidence level of $90\,\%$.
  1. b) A confidence level of $95\,\%$.
  1. c) A confidence level of $99\,\%$.
Gaussian bell curve N(0, 1) with central area 1 − α between −z α/2 and z α/2 and two tails of area α/2z−zα/2zα/201 − αα/2α/2N(0, 1)
Solve
Practice★☆☆Not started
A courier company is studying the weight of packages it delivers in a city. The population is assumed to follow a normal distribution with a standard deviation of…

A courier company is studying the weight of packages it delivers in a city. The population is assumed to follow a normal distribution with a standard deviation of $\sigma = 0.8$ kg. A random sample of $n = 64$ packages is taken, obtaining a sample mean of $\bar{x} = 4.2$ kg.

Calculate a confidence interval for the mean weight of all packages delivered by the company, using a confidence level of $95\%$.

Solve
Practice★★☆Not started
For a study on digital reading habits among young people, a confidence interval is to be constructed. Calculate, showing your working, the critical values $z_{\alpha/2}$…

For a study on digital reading habits among young people, a confidence interval is to be constructed. Calculate, showing your working, the critical values $z_{\alpha/2}$ corresponding to the following confidence levels:

  1. a) $94 \%$
  2. b) $98 \%$

Illustrate graphically the position of the critical value in a standard normal distribution for the $94 \%$ case.

N(0, 1) 94% 1 - α = 0.94 3% α/2 = 0.03 3% α/2 = 0.03 0 −1.88 -z₀.₀₃ 1.88 z₀.₀₃
Solve

Confidence interval for a proportion

Diagram of the confidence interval for a proportion centred on the sample estimate with its margin of error on both sides. confidence interval p̂ E E p̂ − E p̂ + E
Practice★☆☆Not started
In a secondary school, it is suspected that $15\%$ of the students are left-handed. A random sample of $n = 100$ students is selected to check this. 1. What distribution…

In a secondary school, it is suspected that $15\%$ of the students are left-handed. A random sample of $n = 100$ students is selected to check this.

  1. What distribution does the sample proportion $\hat{p}$ of left-handed students follow? State its mean and standard deviation.

  2. Calculate the probability that the proportion of left-handed students in the selected sample is less than $18\%$.

Solve
Practice★☆☆Not started
We wish to estimate the proportion of households in a city that separate organic waste for recycling. To do so, a random sample of $n = 400$ households is surveyed, of…

We wish to estimate the proportion of households in a city that separate organic waste for recycling. To do so, a random sample of $n = 400$ households is surveyed, of which $160$ state that they separate this waste.

Determine the confidence interval for the proportion of households that recycle organic waste across the whole city, using a confidence level of $90\%$.

Solve
Practice★★☆Not started
In a survey carried out on $400$ students at a secondary school about the use of streaming platforms, $260$ said that they prefer watching TV series rather than films.…

In a survey carried out on $400$ students at a secondary school about the use of streaming platforms, $260$ said that they prefer watching TV series rather than films.

  1. a) Find the point estimate of the proportion of students who prefer series.
  1. b) Obtain a $97\,\%$ confidence interval for the true proportion of students who prefer series at that school.
Solve

Sample size and margin of error

For a proportion, the margin of error is at most $\dfrac{1}{\sqrt{n}}$ (the radius of the 95% interval in the worst case), as in the Leaving Cert specification.

Practice★☆☆Not started
A LED light bulb factory wishes to estimate the mean lifespan of its products. It is known from previous studies that the standard deviation of the lifespan is…

A LED light bulb factory wishes to estimate the mean lifespan of its products. It is known from previous studies that the standard deviation of the lifespan is $\sigma = 500$ hours.

If the quality control team wants to make an estimation with a confidence level of $95\%$, what minimum sample size $n$ should they choose so that the maximum error incurred is less than $100$ hours?

E < 100 E < 100 μ 95% Confidence σ = 500 1 - α = 0.95 z = 1.96 E < 100 Sample size n = ?
Solve
Practice★★☆Not started
An estimate is to be made of the proportion of citizens who would be willing to use public transport if it were free. In a prior study the expected proportion is…

An estimate is to be made of the proportion of citizens who would be willing to use public transport if it were free. In a prior study the expected proportion is unknown, so maximum variance ($p = q = 0.5$) is assumed.

Determine the minimum sample size required to estimate this proportion with a maximum margin of error of $4 \%$ and a confidence level of $95.44 \%$ (which corresponds to a critical value of $z_{\alpha/2} = 2$).

Solve
Practice★★★Not started
A mobile phone company wants to estimate the proportion of teenagers who use "dark mode" on their devices at night. In an initial sample of $100$ users, $60\%$ confirmed…

A mobile phone company wants to estimate the proportion of teenagers who use "dark mode" on their devices at night. In an initial sample of $100$ users, $60\%$ confirmed using it.

  1. a) Calculate the $98\%$ confidence interval for the population proportion of users of this mode.
  1. b) Suppose that no prior information about the proportion is available (maximum uncertainty scenario). Determine the sample size needed for the maximum margin of error to be $0.02$ with a confidence level of $95\%$.
  1. c) If the proportion obtained in the initial sample ($0.6$) is used to calculate the sample size under the same conditions as in part b) (margin of error $0.02$ and confidence level $95\%$), how many fewer users would need to be surveyed compared to the maximum uncertainty scenario?
Solve

Relationship between confidence, error and sample size

The margin of error, the confidence level and the sample size are tied together: you cannot improve one without affecting another. Raising the confidence (more certainty) increases $z_{\alpha/2}$ and, all else being equal, widens the interval; the only way to gain precision without losing confidence is to increase $n$.

Visual comparison of confidence intervals showing how the width of the interval varies with the chosen confidence level and the sample size. large n: narrower high confidence: wider
Practice★★☆Not started
Two secondary schools, A and B, measure the mean time that their 2nd year Baccalaureate students spend studying mathematics per week. In both schools, it is known that…

Two secondary schools, A and B, measure the mean time that their 2nd year Baccalaureate students spend studying mathematics per week. In both schools, it is known that the population standard deviation is $1.5$ hours.

A sample of $100$ students is taken in each school. In school A, the confidence interval obtained for the mean has a width of $0.588$ hours. In school B, the confidence interval obtained for the mean is $(6.2; 7.2)$.

  1. a) Determine the confidence level used in school A.
  2. b) Determine the confidence level used in school B.
  3. c) Which of the two schools has made a more precise estimate? Justify your answer.
Solve
Practice★★☆Not started
An "eco-friendly" clothing brand claims that $30\,\%$ of its customers are under $20$ years old. To check this, a random sample of $500$ customers is taken and it is…

An "eco-friendly" clothing brand claims that $30\,\%$ of its customers are under $20$ years old. To check this, a random sample of $500$ customers is taken and it is observed that $135$ of them are under $20$ years old.

  1. a) Construct a $99\,\%$ confidence interval for the proportion of customers under $20$ years old based on the sample data.
  1. b) In view of the result, can we consider the brand's claim to be consistent with the data obtained at a $99\,\%$ confidence level? Explain why.
Solve
Practice★★★Not started
The reaction time of pilots using a state-of-the-art flight simulator follows a normal distribution with unknown mean and standard deviation of $0.05$ seconds. On taking…

The reaction time of pilots using a state-of-the-art flight simulator follows a normal distribution with unknown mean and standard deviation of $0.05$ seconds. On taking a sample of $64$ pilots, a mean of $0.42$ seconds is observed.

  1. a) Obtain the confidence interval for the population mean at a confidence level of $97\%$.
  1. b) The simulator manufacturer claims that the mean reaction time is $0.40$ seconds. Is this claim compatible with the interval obtained in the previous part? Justify your answer based on the relationship between confidence intervals and population parameters.
  1. c) If it is decided to double the sample size and reduce the confidence level to $90\%$, how will this affect the width of the interval? Calculate the factor by which the width is reduced or increased.
Solve

Lab: intervals, simulation and decision-making

A fictitious survey by a county council randomly selects 400 households from a large population; 160 say they separate organic waste. Assume independent observations. Design the record sheet beforehand: population, sampling frame, selection, non-response, variable and confidence. A voluntary selection through a social network is not validated by calculating a narrow interval.

from math import sqrt, ceil

from statistics import NormalDist

from random import Random

normal = NormalDist()

n, successes, confidence = 400, 160, 0.90

p = successes/n

z = normal.inv_cdf((1+confidence)/2)

E = z*sqrt(p*(1-p)/n)

print('CI for proportion:', p-E, p+E)

print('n for error 0.04 at 95%:', ceil(normal.inv_cdf(.975)**2*.25/.04**2))

# Simulation of a CI for a mean with known sigma:

rng = Random(2026)

mu, sigma, size, repetitions = 50, 10, 25, 1000

margin = normal.inv_cdf(.975)*sigma/sqrt(size)

covered = 0

for _ in range(repetitions):

    mean = sum(rng.gauss(mu,sigma) for _ in range(size))/size

    covered += mean-margin <= mu <= mean+margin

print('Fraction of intervals that cover mu:', covered/repetitions)

Intervals change from sample to sample; the model parameter stays fixed:

Simulation diagram comparing three different sample intervals with the fixed value of the population mean, where two capture it and one misses it.μ fixedTwo intervals cover μ; the third does not (diagram)

Change $n$ and the confidence level, keeping the same observed proportion, and compare widths. Distinguish standard error from margin. For quantitative data, also calculate the mean and the sample standard deviation (with divisor $n-1$) using a spreadsheet: the latter estimates $\sigma$, but it does not automatically turn a normal interval into an exact one if $\sigma$ is unknown. Hand in the data, the procedure, the checks and the limits of the decision.

Summary

See all the exercises in this section