Confidence intervals: practice problems with step-by-step solutions

Free Confidence intervals practice problems with diagrams, hints and full worked solutions. New values every time, at three levels: z interval, t interval, sample size.

Free practice problemEasy
LU = ?p̂ = 55/100E90%

In a poll of 100 randomly chosen voters, 55 support a proposal. Find the upper limit of the 90% confidence interval for the proportion of supporters.

n = 100x = 5590%
Next problem →

What you practise

  1. Easyz interval
  2. Mediumt interval
  3. Hardsample size

How to solve Confidence intervals problems

  1. Decide between z (population σ known) and t (only the sample s, with n − 1 degrees of freedom).
  2. Find the critical value for the confidence level.
  3. Margin of error: E = critical value × standard deviation/√n.
  4. Interval: x̄ ± E.

Common mistakes

  • Forgetting to divide by √n.
  • Using z when the sample is small and σ is unknown.
  • Rounding the sample size down instead of up.

Key formulas

σ known
x̄ ± z·σ/√n
σ unknown
x̄ ± t·s/√n, df = n − 1
Critical z
90%: 1.645, 95%: 1.96, 99%: 2.576
Sample size
n = (z·σ/E)², rounded up

Learn Confidence intervals from scratch

Before this: Normal distribution

1What a confidence interval is

You want the mean μ of a whole population, for example the average lifetime of all batteries a factory makes. You cannot test them all, so you test a sample of n batteries.

The sample mean x̄ is your best guess for μ, but another sample would give a slightly different x̄. A single number hides that uncertainty.

A confidence interval gives a range instead: x̄ minus a margin, up to x̄ plus a margin.

55x̄52.0657.94E = 2.94E = 2.94

A 95% confidence interval is built by a method that catches the true μ in 95% of all samples. A higher confidence level gives a wider interval.

Self-check You compute a 90% and a 99% confidence interval from the same sample. Which one is wider?
  1. It depends on the sample mean
  2. The 90% interval
  3. The 99% interval
  4. They are equally wide

Answer: The 99% interval. To be more confident that the interval contains μ, it must be wider. The 99% critical value 2.576 is larger than the 90% value 1.645.

2The z interval

When the population standard deviation σ is known, the interval is:

x̄ ± z · σ / √n

The term σ/√n is the standard error: how much x̄ varies from sample to sample. A larger sample gives a smaller standard error.

The critical value z depends on the confidence level. Learn these three:

  • 90%: z = 1.645
  • 95%: z = 1.96
  • 99%: z = 2.576

The margin of error is E = z · σ/√n. The interval runs from x̄ − E (the lower limit) to x̄ + E (the upper limit).

Self-check A sample of 64 has mean 55. The population σ is 12. What is the upper limit of the 95% confidence interval?
  1. 55.37
  2. 57.47
  3. 57.94
  4. 78.52

Answer: 57.94. E = 1.96 · 12/√64 = 1.96 · 1.5 = 2.94, so the upper limit is 57.94. Forgetting √n gives 78.52, and 57.47 uses the 90% value 1.645.

3The t interval and sample size

Usually σ is not known. Then you use the sample standard deviation s, and the critical value comes from the t-distribution:

x̄ ± t · s / √n, df = n − 1

The number of degrees of freedom df is n − 1. The t value is larger than z, so the interval is wider: it allows for the extra uncertainty in s. For large n, t comes close to z.

At 95%: t = 2.262 for df = 9, t = 2.131 for df = 15 and t = 2.045 for df = 29.

Sometimes you must plan the sample size: how large must n be for a margin of error of at most E? Solve E = zσ/√n for n:

n = (z · σ / E)²

Always round up to the next whole number. Rounding down would give a margin slightly larger than E.

Self-check σ = 13. How large must the sample be for a 95% interval with a margin of error of at most 2?
  1. 13
  2. 162
  3. 163
  4. 650

Answer: 163. (1.96 · 13/2)² = 12.74² = 162.3, rounded up to 163. Rounding down to 162 gives a margin just above 2, and 13 forgets to square.

4The method step by step

  1. Write down n, x̄, and σ or s.
  2. Choose z (σ known) or t with df = n − 1 (only s known).
  3. Find the critical value for the confidence level.
  4. Compute the standard error: σ/√n or s/√n.
  5. Margin of error: E = critical value × standard error.
  6. Interval: from x̄ − E to x̄ + E. Give the limit that is asked.

For a sample size question: n = (zσ/E)², rounded up.

5A worked example

Follow every step. Try to predict the next one before you open it.

Worked example

A sample of 16 items has mean 40 and standard deviation s = 6. The population is roughly normal. Find the 95% confidence interval for the mean.

1

z or t?

Only the sample standard deviation s is known, not σ. So use t with df = n − 1 = 15.

t(15) = 2.131 at 95%
2

Standard error

s / √n = 6 / √16 = 6 / 4 = 1.5
3

Margin of error

E = 2.131 · 1.5 = 3.197
4

The interval

40 − 3.197 = 36.80, 40 + 3.197 = 43.20
40x̄36.8043.20E = 3.20E = 3.20
5

Check the answer

With z = 1.96 the margin would be 2.94. The t interval is a little wider, as it should be when σ is unknown.

Answer

The 95% confidence interval is [36.80, 43.20].

6Common mistakes

  • Forgetting to divide by √n.
  • Using z when the sample is small and σ is unknown.
  • Using df = n instead of df = n − 1 for t.
  • Using the 90% value 1.645 for a 95% interval.
  • Rounding the sample size down instead of up.
Self-check A sample of n = 10 has standard deviation s = 5. σ is unknown. Which critical value do you use for a 95% interval?
  1. t = 2.228 (df = 10)
  2. t = 2.262 (df = 9)
  3. z = 1.645
  4. z = 1.96

Answer: t = 2.262 (df = 9). σ is unknown, so use t with df = n − 1 = 9. Using z ignores the uncertainty in s, and df = 10 forgets the minus one.

7How exam questions look

  • Easy: a z interval. σ is known; find the lower or upper limit.
  • Medium: a t interval. Only s is given; the t value with n − 1 degrees of freedom is given or comes from a table.
  • Hard: sample size. Find the smallest n for a given margin of error, and round up.

A quick check: the sample mean always lies exactly in the middle of the interval.

Learn it step by step in the appLearn it step by step in the app

Worked examples

Example 1Easy
n = 200, σ = 30LU = ?x̄ = 174.5E90%

A sample of 200 measurements has mean 174.5. The population standard deviation is known to be 30. Find the upper limit of the 90% confidence interval for the mean.

n = 200x̄ = 174.5σ = 3090%

Find upper limit

Show hints
  1. σ is known, so use the z critical value.
  2. z = 1.645 (90%).
  3. E = z·σ/√n.
Show the answer and the step-by-step solution

Confidence interval for a mean: x̄ ± margin of error. With a known population σ the margin is z·σ/√n; with only the sample standard deviation s, use t with n − 1 degrees of freedom: t·s/√n. Critical values: z = 1.645 (90%), 1.96 (95%), 2.576 (99%). To get a margin E or smaller, you need n ≥ (z·σ/E)², rounded up.

Margin of error

E = 1.645·30/√200 = 3.49

Interval

x̄ ± E = 174.5 ± 3.49 → [171, 178]

Answer

upper limit = 178
Example 2Medium
x̄E₁ = 7.895%, n = 50x̄E₂ = ?95%, n = 100

A 95% confidence interval for a mean, based on 50 observations and a known σ, has a margin of error of 7.8. What is the margin of error E₂ if the same study uses 100 observations instead?

95%n₁ = 50E₁ = 7.8n₂ = 100

Find E₂

Show hints
  1. E = z·σ/√n, and σ stays the same.
  2. E₂/E₁ = (z₂/z₁)·√(n₁/n₂).
  3. z₁ = 1.96, z₂ = 1.96.
Show the answer and the step-by-step solution

Confidence interval for a mean: x̄ ± margin of error. With a known population σ the margin is z·σ/√n; with only the sample standard deviation s, use t with n − 1 degrees of freedom: t·s/√n. Critical values: z = 1.645 (90%), 1.96 (95%), 2.576 (99%). To get a margin E or smaller, you need n ≥ (z·σ/E)², rounded up.

Ratio of margins

E₂/E₁ = (1.96/1.96)·√(50/100) = 0.7071

New margin

E₂ = 7.8·0.7071 = 5.515

Answer

E₂ = 5.515
Example 3Hard
n = 21Lσ = ?s = 1.295%

The diameters of 21 machined shafts have a sample standard deviation of 1.2 µm. Assuming the diameters are normally distributed, find the upper limit σ of the 95% confidence interval for the population standard deviation. With df = 20, 2.5% of the χ² distribution lies below 9.591 and 2.5% lies above 34.17.

n = 21s = 1.2 µmχ² = 9.591, 34.17

Find σ (µm)

Show hints
  1. For a normal population, (n − 1)s²/σ² follows a χ² distribution with n − 1 degrees of freedom.
  2. Interval for σ²: from (n − 1)s²/34.17 to (n − 1)s²/9.591. Take square roots for σ.
  3. (n − 1)s² = 28.8.
Show the answer and the step-by-step solution

Interval for a variance: (n − 1)s²/σ² has a χ² distribution with n − 1 degrees of freedom. The 95% interval for σ² runs from (n − 1)s² divided by the upper χ² value (2.5% above it) to (n − 1)s² divided by the lower χ² value (2.5% below it); the interval for σ is the square root of both limits. It is not symmetric around s.

Sum of squares

(n − 1)s² = 20·1.2² = 28.8

Limits for σ²

28.8/34.17 = 0.8428
28.8/9.591 = 3.003

Limit for σ

σ = √3.003 = 1.733 µm

Answer

σ = 1.733 µm

95% interval for σ: [0.9181, 1.733] µm.

Questions and answers

What is Confidence intervals?

You want the mean μ of a whole population, for example the average lifetime of all batteries a factory makes. You cannot test them all, so you test a sample of n batteries.

The sample mean x̄ is your best guess for μ, but another sample would give a slightly different x̄. A single number hides that uncertainty.

How do I solve Confidence intervals problems step by step?
  1. Decide between z (population σ known) and t (only the sample s, with n − 1 degrees of freedom).
  2. Find the critical value for the confidence level.
  3. Margin of error: E = critical value × standard deviation/√n.
  4. Interval: x̄ ± E.
What are common mistakes in Confidence intervals?
  • Forgetting to divide by √n.
  • Using z when the sample is small and σ is unknown.
  • Rounding the sample size down instead of up.
What do the Confidence intervals exercises cover?
  • Easy: z interval
  • Medium: t interval
  • Hard: sample size

Every problem has new values, so you learn the method instead of an answer. Stuck? Open a small hint first, and the full explanation only when you need it.

How practising works

  • Every problem has new values, so you learn the method instead of an answer.
  • Stuck? Open a small hint first, and the full explanation only when you need it.
  • Your progress, mistakes and saved problems are kept, so you can review before the exam.

Topics before and after this one

Learn first

Continue with

Calculators

Courses with this topic

More topics in Mathematics & statistics

Printable worksheet