Hypothesis tests & confidence intervals: practice problems with step-by-step solutions

Also called: t-test · p-value

Free Hypothesis tests & confidence intervals practice problems with diagrams, hints and full worked solutions. New values every time, at three levels: z statistic, t statistic, confidence intervals.

Free practice problemEasy
μ₀x̄c = ?α = 0.05

A supplier claims that the mean breaking strength of a cable is 50 kN; you suspect it is higher. The standard deviation is known to be 8 kN. You will take a sample of 25 cables and test H₀: μ = 50 kN against H₁: μ > 50 kN at α = 0.05. Above which sample mean x̄c will you reject H₀?

μ₀ = 50 kNσ = 8 kNn = 25α = 0.05
kN
Next problem →

What you practise

  1. Easyz statistic
  2. Mediumt statistic
  3. Hardconfidence intervals

How to solve Hypothesis tests & confidence intervals problems

  1. State H₀ and H₁ and decide whether the test is one- or two-sided.
  2. Calculate the test statistic: (x̄ − μ₀)/(σ/√n), or with s and t.
  3. Compare with the critical value, or find the p-value.
  4. Reject H₀ if the statistic is beyond the critical value (p below α), and state the conclusion in words.

Common mistakes

  • Using a one-sided critical value for a two-sided test.
  • Saying H₀ is proven true when it is not rejected.
  • Forgetting √n in the standard error.

Key formulas

z-test for a mean
z = (x̄ − μ0)/(σ/√n)
t-test for a mean
t = (x̄ − μ0)/(s/√n), df = n − 1
Two-sided at 5%
reject H0 if |z| > 1.96
Confidence interval
x̄ ± z·σ/√n

Learn Hypothesis tests & confidence intervals from scratch

Before this: Confidence intervals

1The idea of a test

A machine should fill bottles with 500 mL on average. A sample of bottles has a mean of 496 mL. Is the machine wrong, or is this just chance?

A hypothesis test answers that question with numbers. You start from two statements:

  • The null hypothesis H₀: nothing has changed. Here H₀: μ = 500.
  • The alternative hypothesis H₁: what you suspect. Here H₁: μ ≠ 500 (two-sided), or μ < 500 if you only worry about underfilling (one-sided).

You assume H₀ is true and ask: how unusual is this sample? If it would be very unusual, you reject H₀.

Self-check A supplier claims that its resistors are 220 Ω on average. You want to test this claim. What is H₀?
  1. x̄ = 220 Ω
  2. μ > 220 Ω
  3. μ = 220 Ω
  4. μ ≠ 220 Ω

Answer: μ = 220 Ω. H₀ is the claim being tested, about the population mean μ. μ ≠ 220 Ω is the alternative H₁, and a hypothesis is never about the sample mean x̄, which you already know.

2The test statistic

The test statistic measures how far the sample mean lies from μ₀, the value in H₀, in units of the standard error.

z = (x̄ − μ₀) / (σ / √n)

Use z when the population standard deviation σ is known. When only the sample standard deviation s is known, use t:

t = (x̄ − μ₀) / (s / √n), df = n − 1

A value of z or t near 0 means the sample agrees with H₀. A large positive or negative value means the sample is far from μ₀.

Self-check H₀: μ = 120, σ = 8, n = 16 and x̄ = 118. What is z?
  1. 1
  2. −0.25
  3. −1
  4. −4

Answer: −1. The standard error is 8/√16 = 2, so z = (118 − 120)/2 = −1. Dividing by σ = 8 instead of σ/√n gives −0.25. The sign is negative because x̄ is below μ₀.

3Deciding: critical values and p-values

Before you look at the data, choose the significance level α, usually 0.05. It is the risk you accept of rejecting a true H₀.

For a z test at α = 0.05:

  • Two-sided (H₁: μ ≠ μ₀): reject H₀ if |z| > 1.96.
  • One-sided (H₁: μ > μ₀): reject H₀ if z > 1.645. For μ < μ₀: reject if z < −1.645.

The p-value is the probability of a result at least this extreme if H₀ is true. Reject H₀ when p < α.

Not rejecting H₀ does not prove it. It only means the data are not strong enough evidence against it.

A test and a confidence interval agree: a two-sided test at 5% rejects H₀ exactly when μ₀ lies outside the 95% interval x̄ ± 1.96 · σ/√n.

Self-check A two-sided z test at α = 0.05 gives z = 1.8. What do you conclude?
  1. Do not reject H₀
  2. H₀ is proven true
  3. Reject H₀
  4. Reject H₁ and accept H₀ as proven

Answer: Do not reject H₀. |1.8| is smaller than 1.96, so the result is not significant and H₀ is not rejected. That does not prove H₀; the evidence is just not strong enough.

4The method step by step

  1. State H₀ and H₁, and decide whether the test is one- or two-sided.
  2. Choose z (σ known) or t (only s known, df = n − 1).
  3. Compute the standard error σ/√n or s/√n.
  4. Compute the test statistic (x̄ − μ₀) / standard error.
  5. Compare with the critical value, or find the p-value.
  6. State the conclusion in words, in terms of the question.

5A worked example

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

Worked example

A machine should fill bottles with 500 mL on average. σ = 12 mL. A sample of 36 bottles has a mean of 496 mL. Test H₀: μ = 500 against H₁: μ ≠ 500 at α = 0.05.

1

Hypotheses

H₀: μ = 500 mL. H₁: μ ≠ 500 mL. This is two-sided, so the critical values are ±1.96.

2

Standard error

σ is known, so use z.

σ / √n = 12 / √36 = 12 / 6 = 2 mL
3

Test statistic

z = (496 − 500) / 2 = −4 / 2 = −2
4

Compare

−1.9601.962.5%2.5%95%z = −2

|−2| = 2 is larger than 1.96, so z lies in the shaded rejection region.

5

Check with an interval

496 ± 1.96 · 2 = [492.08, 499.92]

The value 500 lies outside the 95% interval, so the interval gives the same decision.

Answer

z = −2. Reject H₀ at the 5% level: the machine’s mean fill is different from 500 mL.

6Common mistakes

  • Using a one-sided critical value (1.645) for a two-sided test, or the other way round.
  • Saying H₀ is proven true when it is not rejected.
  • Forgetting √n in the standard error.
  • Writing x̄ − μ₀ the wrong way round, which flips the sign of z.
  • Using z when only the sample s is known for a small sample.
Self-check A one-sided test with H₁: μ > μ₀ at α = 0.05 gives z = 1.8. What do you conclude?
  1. Do not reject H₀, because 1.8 < 1.96
  2. Do not reject H₀, because 1.8 < 2.576
  3. Reject H₀, because 1.8 > 1.645
  4. Reject H₀, because z is positive

Answer: Reject H₀, because 1.8 > 1.645. One-sided at 5% puts the whole 5% in one tail, so the critical value is 1.645. Comparing with 1.96 uses the two-sided value by mistake.

7How exam questions look

  • Easy: the z statistic. σ is known; compute z = (x̄ − μ₀)/(σ/√n).
  • Medium: the t statistic. Only the sample standard deviation s is given; compute t = (x̄ − μ₀)/(s/√n).
  • Hard: confidence intervals. Find the lower or upper limit of x̄ ± z · σ/√n at 95% or 99%.

A quick check: if x̄ is below μ₀, the test statistic must be negative.

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

Worked examples

Example 1Easy
z −1.9601.96

A machine is supposed to fill bottles with 100 mL on average. The standard deviation is known to be 4 mL. A sample of 81 bottles has a mean of 99.6 mL. Find the test statistic z for H₀: μ = 100.

μ₀ = 100 mLx̄ = 99.6 mLσ = 4 mLn = 81

Find z

Show hints
  1. The standard error of the mean is the standard deviation divided by √n.
  2. SE = 4/√81 = 0.4444.
  3. Then divide the difference x̄ − μ₀ by the standard error. Keep the sign.
Show the answer and the step-by-step solution

Testing a mean: the test statistic measures how many standard errors the sample mean lies from the value claimed in H₀: z = (x̄ − μ₀)/(σ/√n) when σ is known, t = (x̄ − μ₀)/(s/√n) when it is estimated from the sample. A confidence interval is x̄ ± (critical value)·(standard error).

Standard error

SE = 4/√81 = 4/9 = 0.4444

Test statistic

z = (99.6 − 100)/0.4444 = −0.9

Answer

z = −0.9

|z| < 1.96, so H₀ is not rejected at the 5% level (two-sided).

Example 2Medium
t −1.99801.998

A sample of 64 students has a mean score of 504.5 and a sample standard deviation of 15. Find the test statistic t for H₀: μ = 500.

μ₀ = 500x̄ = 504.5s = 15n = 64

Find t

Show hints
  1. The standard error of the mean is the standard deviation divided by √n.
  2. SE = 15/√64 = 1.875.
  3. Then divide the difference x̄ − μ₀ by the standard error. Keep the sign.
Show the answer and the step-by-step solution

Testing a mean: the test statistic measures how many standard errors the sample mean lies from the value claimed in H₀: z = (x̄ − μ₀)/(σ/√n) when σ is known, t = (x̄ − μ₀)/(s/√n) when it is estimated from the sample. A confidence interval is x̄ ± (critical value)·(standard error).

Standard error

SE = 15/√64 = 15/8 = 1.875

Test statistic

t = (504.5 − 500)/1.875 = 2.4

Answer

t = 2.4
t0.025; df = 63 = 1.998

|t| > 1.998, so H₀ is rejected at the 5% level (two-sided).

Example 3Hard
z −2.57602.576

A sample of 64 measurements has mean 80. The population standard deviation is 20. Find the lower limit L of the 99% confidence interval for the mean.

x̄ = 80σ = 20n = 6499%

Find L

Show hints
  1. Confidence interval: x̄ ± z*·σ/√n.
  2. z* = 2.576 for 99%.
  3. σ/√n = 2.5.
Show the answer and the step-by-step solution

Testing a mean: the test statistic measures how many standard errors the sample mean lies from the value claimed in H₀: z = (x̄ − μ₀)/(σ/√n) when σ is known, t = (x̄ − μ₀)/(s/√n) when it is estimated from the sample. A confidence interval is x̄ ± (critical value)·(standard error).

Margin of error

E = 2.576·20/√64 = 6.44

Interval limit

L = 80 − 6.44 = 73.56

Answer

L = 73.56

Questions and answers

What is Hypothesis tests & confidence intervals?

A machine should fill bottles with 500 mL on average. A sample of bottles has a mean of 496 mL. Is the machine wrong, or is this just chance?

A hypothesis test answers that question with numbers. You start from two statements:

How do I solve Hypothesis tests & confidence intervals problems step by step?
  1. State H₀ and H₁ and decide whether the test is one- or two-sided.
  2. Calculate the test statistic: (x̄ − μ₀)/(σ/√n), or with s and t.
  3. Compare with the critical value, or find the p-value.
  4. Reject H₀ if the statistic is beyond the critical value (p below α), and state the conclusion in words.
What are common mistakes in Hypothesis tests & confidence intervals?
  • Using a one-sided critical value for a two-sided test.
  • Saying H₀ is proven true when it is not rejected.
  • Forgetting √n in the standard error.
What do the Hypothesis tests & confidence intervals exercises cover?
  • Easy: z statistic
  • Medium: t statistic
  • Hard: confidence intervals

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