Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Statistics
  3. ›4 Inference for Quantitative Data: Means
  4. ›4.9 Setting up a two-mean test

AP Statistics · Unit 4 · Inference for Quantitative Data: Means

4.9 Setting up a two-mean test

Write hypotheses for comparing two population means, check the conditions for a two-sample t-test, and choose the correct test statistic.

  • 4 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5Hypotheses describe the difference between two population means
  1. 1Hypotheses describe the difference between two population means
  2. 2The alternative hypothesis can be one-sided or two-sided
  3. 3Three conditions must hold before running a two-sample t-test
  4. 4Small samples need graphs to support the normality condition
  5. 5The test statistic standardizes the difference in sample means
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: Hypotheses describe the difference between two population means

A gardener wants to know whether a new fertilizer gives a higher tomato yield than the usual one. Each fertilizer has its own long-run mean yield. The question concerns the difference between those two population means.

A test begins with two competing claims. The null hypothesis, H0H_0H0​, says the two means are equal. The alternative hypothesis, HaH_aHa​, says the means differ in the way the researcher suspects.

Hypotheses describe parameters, so define μ1\mu_1μ1​ and μ2\mu_2μ2​ in words and in context. For example, let μ1\mu_1μ1​ be the true mean yield with the new fertilizer.

Common mistake

Do not write hypotheses with xˉ1\bar{x}_1xˉ1​ and xˉ2\bar{x}_2xˉ2​. Sample means are data used as evidence, while the claims are about population means.

Key terms · tap one for its definition

null hypothesis

The null hypothesis is the claim of no difference, written with an equals sign, that a test seeks evidence against.

alternative hypothesis

The alternative hypothesis is the claim, written with <<<, >>>, or ≠\neq=, that the parameters differ in the way the researcher suspects.

Part 1 done

2

Part 2 of 5: The alternative hypothesis can be one-sided or two-sided

Now that both claims have names, the direction of the alternative needs a rule. The null hypothesis is H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0, which is the same as μ1=μ2\mu_1=\mu_2μ1​=μ2​.

The wording of the research question sets the alternative. Decide it before looking at the data. A two-sided alternative is used when the question asks only whether the means differ. A one-sided alternative names a direction.

Research wording and the matching alternative hypothesis

WordingAlternativeType
Differs or changesHa:μ1−μ2≠0H_a:\mu_1-\mu_2\neq 0Ha​:μ1​−μ2​=0Two-sided
Greater or higherHa:μ1−μ2>0H_a:\mu_1-\mu_2>0Ha​:μ1​−μ2​>0One-sided
Less or lowerHa:μ1−μ2<0H_a:\mu_1-\mu_2<0Ha​:μ1​−μ2​<0One-sided
Wording
Differs or changes
Alternative
Ha:μ1−μ2≠0H_a:\mu_1-\mu_2\neq 0Ha​:μ1​−μ2​=0
Type
Two-sided
Wording
Greater or higher
Alternative
Ha:μ1−μ2>0H_a:\mu_1-\mu_2>0Ha​:μ1​−μ2​>0
Type
One-sided
Wording
Less or lower
Alternative
Ha:μ1−μ2<0H_a:\mu_1-\mu_2<0Ha​:μ1​−μ2​<0
Type
One-sided

Exam tip

Match the direction to your definitions. If μ1\mu_1μ1​ is the new fertilizer, then “higher yield with the new fertilizer” gives μ1−μ2>0\mu_1-\mu_2>0μ1​−μ2​>0.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the null hypothesis for comparing the true mean commute times of two cities, μ1\mu_1μ1​ and μ2\mu_2μ2​.
Show answer and explanation

Answer: C · Worked explanation

The null hypothesis claims no difference between the population means, so μ1−μ2=0\mu_1-\mu_2=0μ1​−μ2​=0. The version written with xˉ1\bar{x}_1xˉ1​ and xˉ2\bar{x}_2xˉ2​ is wrong because hypotheses describe parameters, not sample statistics. The version with >>> would belong in an alternative hypothesis, since a null hypothesis uses an equals sign.
3

Part 3 of 5: Three conditions must hold before running a two-sample t-test

Before any calculation, the data must suit the procedure. The two-sample t-test compares two population means. It requires independent samples, so no individual in one group is linked to an individual in the other.

  • Random: the data come from random samples or from random assignment in an experiment.
  • Independence within groups: when sampling without replacement, each sample is less than 10% of its population.
  • Independence between groups: the two groups are separate, with no pairing or matching.
  • Normality: each population is approximately normal, or each sample size is at least 30.

Random sampling lets you generalize to the population sampled. Random assignment supports a cause-and-effect conclusion.

Key terms · tap one for its definition

two-sample t-test

The two-sample t-test is a hypothesis test about μ1−μ2\mu_1-\mu_2μ1​−μ2​ that uses a ttt statistic computed from two independent samples.

independent samples

Independent samples are samples in which the individuals in one group have no pairing with, and no influence on, those in the other.

Part 3 done

4

Part 4 of 5: Small samples need graphs to support the normality condition

The last condition needs more care when a sample is small. With at least 30 observations in a group, the sampling distribution of its sample mean is approximately normal. This holds even when the population is skewed.

With fewer than 30 observations, graph the sample. Use a dotplot, histogram, or boxplot. Look for a roughly symmetric shape with no strong skew and no outliers.

Check each group separately. One well-behaved group does not excuse the other.

Common mistake

Do not claim that a graph proves the population is normal. Write that the graph shows no strong skew or outliers, so normality is plausible.

Part 4 done

Quick check

One question on the part you just read

Easy

Identify the alternative hypothesis for the claim that a new teaching method gives a lower mean score than the old method, using μ1\mu_1μ1​ for the new method and μ2\mu_2μ2​ for the old method.
Show answer and explanation

Answer: A · Worked explanation

A lower mean for the new method means μ1<μ2\mu_1<\mu_2μ1​<μ2​, which is μ1−μ2<0\mu_1-\mu_2<0μ1​−μ2​<0. Writing >0>0>0 reverses the direction of the claim. The ≠\neq= version is two-sided, so it ignores that the claim names a direction, and the equals version is the null hypothesis.
5

Part 5 of 5: The test statistic standardizes the difference in sample means

With the conditions checked, the last step is choosing the statistic. A test statistic measures how far the sample result lies from the null value. Here the sample result is xˉ1−xˉ2\bar{x}_1-\bar{x}_2xˉ1​−xˉ2​.

The population standard deviations are unknown, so each is estimated by a sample standard deviation sss. That makes the statistic a ttt statistic, not a zzz statistic. The null value is 0, because H0H_0H0​ says the means are equal. The statistic is t=(xˉ1−xˉ2)−0s12n1+s22n2t=\frac{(\bar{x}_1-\bar{x}_2)-0}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}t=n1​s12​​+n2​s22​​​(xˉ1​−xˉ2​)−0​.

Technology finds the degrees of freedom, which select the exact ttt distribution for the test.

Worked example

Setting up a two-mean test

A teacher randomly assigns 40 students to study with flashcards and 40 to study with notes. She wants evidence that flashcards give a higher mean quiz score. Set up the test.
  1. 1
    Define parameters: μ1\mu_1μ1​ is the true mean quiz score with flashcards, and μ2\mu_2μ2​ is the true mean score with notes.
  2. 2
    Write the hypotheses: H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0 and Ha:μ1−μ2>0H_a:\mu_1-\mu_2>0Ha​:μ1​−μ2​>0.
  3. 3
    Check conditions: students were randomly assigned, and the groups contain different students.
  4. 4
    Check normality: each group has 40 students, which is at least 30.
  5. 5
    Choose the statistic: t=(xˉ1−xˉ2)−0s12n1+s22n2t=\frac{(\bar{x}_1-\bar{x}_2)-0}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}t=n1​s12​​+n2​s22​​​(xˉ1​−xˉ2​)−0​.

Answer: Use a two-sample ttt-test for μ1−μ2\mu_1-\mu_2μ1​−μ2​ with a one-sided alternative.

Key terms · tap one for its definition

test statistic

The test statistic is the sample statistic minus the null value, divided by the standard error, the typical sampling variability of the statistic.

degrees of freedom

The degrees of freedom are the number that determines which t distribution applies; for two means, technology computes it from both samples.

Note read

Check your recall[12 marks]

5 written questions. Answer each one in your head or on paper, then open the mark scheme.

  1. 1.Identify[2 marks]

    Identify the null and alternative hypotheses, in symbols, for testing whether mean battery life of Brand A (μ1\mu_1μ1​) is greater than that of Brand B (μ2\mu_2μ2​).

    Show mark schemeHide mark scheme

    Model answer

    H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0 and Ha:μ1−μ2>0H_a:\mu_1-\mu_2>0Ha​:μ1​−μ2​>0.

    • 1 mark for writing H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0 (or μ1=μ2\mu_1=\mu_2μ1​=μ2​)
    • 1 mark for writing Ha:μ1−μ2>0H_a:\mu_1-\mu_2>0Ha​:μ1​−μ2​>0
  2. 2.Describe[3 marks]

    Describe the conditions that must be checked before using a two-sample t-test for means.

    Show mark schemeHide mark scheme

    Model answer

    The data must come from random samples or random assignment. The observations must be independent: each sample is less than 10% of its population when sampling without replacement, and the two groups are not paired. Each population must be approximately normal, or each sample size must be at least 30.

    • 1 mark for stating the random condition
    • 1 mark for stating independence within and between groups, including the 10% condition
    • 1 mark for stating the normality condition for each group (approximately normal or sample size at least 30)
  3. 3.Explain[2 marks]

    Explain why a graph of the data is needed to check normality when a group has only 15 observations.

    Show mark schemeHide mark scheme

    Model answer

    With fewer than 30 observations, the sample size does not make the sampling distribution of the mean approximately normal. A graph shows whether there is strong skew or outliers, which would make normality implausible.

    • 1 mark for stating that the sample size is below 30, so normality is not guaranteed
    • 1 mark for stating that a graph can reveal strong skew or outliers
  4. 4.Identify[2 marks]

    Identify the test statistic for H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0 when population standard deviations are unknown, and name the symbols in its denominator.

    Show mark schemeHide mark scheme

    Model answer

    t=(xˉ1−xˉ2)−0s12n1+s22n2t=\frac{(\bar{x}_1-\bar{x}_2)-0}{\sqrt{\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2}}}t=n1​s12​​+n2​s22​​​(xˉ1​−xˉ2​)−0​, where s1s_1s1​ and s2s_2s2​ are the sample standard deviations and n1n_1n1​ and n2n_2n2​ are the sample sizes.

    • 1 mark for writing the ttt statistic with the difference in sample means over the square-root expression
    • 1 mark for naming s1s_1s1​, s2s_2s2​, n1n_1n1​, and n2n_2n2​ correctly
  5. 5.Justify[3 marks]

    Justify why the independence-between-groups condition holds when 40 students are randomly assigned to two different study methods.

    Show mark schemeHide mark scheme

    Model answer

    Each student is assigned to only one group, so the groups contain different individuals. Random assignment means no student is matched or paired with a student in the other group. Therefore one group’s values do not influence the other’s.

    • 1 mark for stating that each student appears in only one group
    • 1 mark for stating that there is no pairing or matching between groups
    • 1 mark for concluding that one group’s values do not influence the other

Practice this topic

10 quick-fire multiple-choice questions, easy to hard. Tap an answer to see if you're right and the worked explanation. (The written questions with mark schemes are under “Check your recall” above.)

0 right0 of 10 answered

Includes the 2 quick checks in the note above.

3.

Easy·Identify[1 mark]

Identify the situation that gives independent samples.
Show answer and explanation

Answer: D · Worked explanation

Independent samples contain different individuals with no link between the groups. Measuring the same students twice, or matching students into pairs, creates dependence between the two sets of values. Equal sample sizes are not required, and equal sizes alone would not make samples independent.
4.

Medium·Determine[1 mark]

A researcher takes a random sample of 80 students, without replacement, from a school of 600 students. Determine whether the 10% condition for independence holds.
Show answer and explanation

Answer: B · Worked explanation

Ten percent of 600 is 60, and the sample of 80 is larger than that, so the condition fails. A size of at least 30 matters for the normality condition, which is a different check. Being smaller than the population is not enough; the sample must be less than 10% of it.
5.

Medium·Calculate[1 mark]

Two independent samples have s1=5s_1=5s1​=5, n1=25n_1=25n1​=25, s2=15s_2=15s2​=15, and n2=25n_2=25n2​=25. Calculate the denominator of the two-sample ttt statistic.
Show answer and explanation

Answer: B · Worked explanation

Compute 5225=1\frac{5^2}{25}=12552​=1 and 15225=9\frac{15^2}{25}=925152​=9. The sum is 10, and 10≈3.16\sqrt{10}\approx 3.1610​≈3.16. The value 4.00 comes from adding the two separate standard errors, 1 and 3, which is not the formula. The value 10.0 comes from forgetting the square root. The value 2.24 comes from pooling the variances and sample sizes, which is also not the formula.
6.

Medium·Identify[1 mark]

Two independent random samples of 40 and 35 boxes are weighed, and both population standard deviations are unknown. Identify the appropriate test statistic for H0:μ1−μ2=0H_0:\mu_1-\mu_2=0H0​:μ1​−μ2​=0.
Show answer and explanation

Answer: D · Worked explanation

Sample standard deviations replace the unknown population values, so the statistic is a ttt statistic. The standard error adds the two variance terms s2n\frac{s^2}{n}ns2​ under one square root. The zzz form needs known σ\sigmaσ values. Adding the separate standard errors, or pooling the sizes and variances, does not give the correct standard error.
7.

Medium·Identify[1 mark]

Identify the scenario that calls for a two-sample t-test for means rather than a paired procedure.
Show answer and explanation

Answer: A · Worked explanation

Two separate groups of different cars give independent samples, so a two-sample test fits. Before-and-after measurements on the same patients or dogs are linked. Twin pairs are matched, so the two groups are not independent. In each of those cases the data are paired.
8.

Hard·Determine[2 marks]

Researchers want evidence that mean recovery time with a new drug, μD\mu_DμD​, is shorter than with a placebo, μP\mu_PμP​. They define the difference as μP−μD\mu_P-\mu_DμP​−μD​. Determine the alternative hypothesis.
Show answer and explanation

Answer: C · Worked explanation

A shorter recovery with the drug means μD<μP\mu_D<\mu_PμD​<μP​, so subtracting the drug mean from the placebo mean gives a positive difference. The <0<0<0 version keeps the word “shorter” but ignores the order of subtraction. The μD−μP>0\mu_D-\mu_P>0μD​−μP​>0 version claims the drug lengthens recovery, and the ≠\neq= version is two-sided.
9.

Hard·Determine[2 marks]

Group 1 has 45 observations with mild skew. Group 2 has 18 observations, and its boxplot shows one extreme outlier. Determine whether the normality condition is met.
Show answer and explanation

Answer: D · Worked explanation

Normality is checked in each group separately. Group 2 has fewer than 30 observations and an extreme outlier, so there is strong evidence against normality. Combining the sizes does not help, and a large group 1 cannot cover for a small, outlier-prone group 2.
10.

Hard[2 marks]

Forty volunteers, not selected at random, are randomly assigned to two diets, and mean weight losses are compared. Which statement about the random condition is correct?
Show answer and explanation

Answer: A · Worked explanation

In an experiment, random assignment satisfies the random condition and supports cause-and-effect conclusions. The volunteers were not randomly sampled, so the results cannot be generalized to all adults. Saying the condition fails confuses random sampling with random assignment, and the condition is always needed.

Keep going

Next topic4.10 Carrying out a two-mean testPrevious topic4.8 Claims about a difference of means

More in Unit 4 · Inference for Quantitative Data: Means

  1. 4.2Interval for a mean or mean differenceNotes · 10 questions
  2. 4.3Claims from a mean intervalNotes · 10 questions
  3. 4.4Setting up a test for a mean or mean differenceNotes · 10 questions
  4. 4.5Carrying out a test for a mean or mean differenceNotes · 10 questions
  5. 4.6Differences in sample meansNotes · 10 questions
  6. 4.7Interval for a difference of two meansNotes · 10 questions
  7. 4.8Claims about a difference of meansNotes · 10 questions
  8. 4.9Setting up a two-mean testNotes · 10 questions
  9. 4.10Carrying out a two-mean testNotes · 10 questions

All AP Statistics topics →

Draft: written by Scribe and checked automatically, not yet by a subject reviewer.

Practice questions are original, written by Scribe and checked automatically for correctness.

Topic codes follow the official numbering. Not endorsed by College Board or any exam board.

On this page

0/5 read

  1. 1Hypotheses describe the difference between two population means
  2. 2The alternative hypothesis can be one-sided or two-sided
  3. 3Three conditions must hold before running a two-sample t-test
  4. 4Small samples need graphs to support the normality condition
  5. 5The test statistic standardizes the difference in sample means
  6. Check your recall
  7. Practice: 10 questions
All coursesScribeHow it worksPricingPrivacyTerms

Notes and questions are written by Scribe in our own words. Topic codes follow the official course numbering so you can find your place. Not produced or endorsed by the IB, College Board, AQA, OCR, Pearson Edexcel or any exam board.

© 2026 Scribe