Scribe logoScribeNotes & practice
Sign inStart free
  1. Notes
  2. ›AP Statistics
  3. ›3 Inference for Categorical Data: Proportions
  4. ›3.12 Setting up a two-proportion test

AP Statistics · Unit 3 · Inference for Categorical Data: Proportions

3.12 Setting up a two-proportion test

Write hypotheses for a comparison of two population proportions, check the conditions for a two-proportion z-test, and recognize when that test is the right procedure.

  • 5 min read
  • 5 parts
  • 10 questions
  • Draft
Start a Quick 5 on this topic→Jump to the 10 questions
1/5Hypotheses compare two population proportions with each other
  1. 1Hypotheses compare two population proportions with each other
  2. 2The direction of the alternative comes from the claim
  3. 3Valid inference needs random, independent samples
  4. 4The large counts condition keeps the normal model reasonable
  5. 5The correct procedure is a two-proportion z-test
  6. Check your recall
  7. Practice: 10 questions
1

Part 1 of 5: Hypotheses compare two population proportions with each other

Suppose a school wants to know whether freshmen and seniors differ in how often they buy lunch. Each group has its own true proportion. A significance test asks whether the data give convincing evidence about how those two proportions compare.

The null hypothesis says there is no difference between the two population proportions. We write it as H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0. Here p1p_1p1​ and p2p_2p2​ are the true proportions in population 1 and population 2.

The alternative hypothesis is what the data might support instead. It can be two-sided, Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0. It can also be one-sided, using >>> or <<<.

Exam tip

Define p1p_1p1​ and p2p_2p2​ in words, in context, before writing any hypotheses. Say clearly which group is group 1.

Key terms · tap one for its definition

null hypothesis

The null hypothesis, H0H_0H0​, is the claim of no difference, here that the two population proportions are equal.

alternative hypothesis

The alternative hypothesis, HaH_aHa​, is the competing claim that the population proportions differ in the direction the research question gives.

Part 1 done

2

Part 2 of 5: The direction of the alternative comes from the claim

Once the symbols are defined, the sign in HaH_aHa​ depends on the wording of the claim. The direction is set by the research question, never by which sample proportion happens to be larger. Decide it before looking at the data.

Matching claim wording to the alternative hypothesis

Claim wordingAlternative hypothesis
The proportions differHa:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0
Group 1 is higher than group 2Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0
Group 1 is lower than group 2Ha:p1−p2<0H_a: p_1 - p_2 < 0Ha​:p1​−p2​<0
Claim wording
The proportions differ
Alternative hypothesis
Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0
Claim wording
Group 1 is higher than group 2
Alternative hypothesis
Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0
Claim wording
Group 1 is lower than group 2
Alternative hypothesis
Ha:p1−p2<0H_a: p_1 - p_2 < 0Ha​:p1​−p2​<0

Worked example

Writing the hypotheses

A counselor believes a higher proportion of seniors than freshmen plan to attend college. Write the hypotheses.
  1. 1
    Define p1p_1p1​ as the true proportion of all seniors who plan to attend college.
  2. 2
    Define p2p_2p2​ as the true proportion of all freshmen who plan to attend college.
  3. 3
    The null hypothesis states no difference: H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0.
  4. 4
    The claim says seniors are higher, so Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0.

Answer: H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 and Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0, with p1p_1p1​ for seniors and p2p_2p2​ for freshmen.

Watch the order of the groups. Reversing which group is group 1 flips the sign of a one-sided alternative. A claim that group 1 is higher becomes a claim that group 2 is lower.

Part 2 done

Quick check

One question on the part you just read

Easy

Identify the null hypothesis for a test comparing two population proportions.
Show answer and explanation

Answer: C · Worked explanation

The null hypothesis claims no difference between the population proportions, so p1−p2=0p_1 - p_2 = 0p1​−p2​=0. The version with p^\hat{p}p^​ is wrong because hypotheses describe parameters, not sample statistics, and sample proportions will almost never be exactly equal. A not-equal sign belongs in the alternative.
3

Part 3 of 5: Valid inference needs random, independent samples

A test is only trustworthy when its conditions hold, so we check them next. The data must come from two random samples, or from random assignment in an experiment. Randomness lets us generalize to the populations or draw conclusions about cause.

Observations must also be independent. When sampling without replacement, check the 10% condition: each sample is less than 10% of its population. The two groups must be independent samples. No person in one group may be linked to a person in the other.

Common mistake

Before-and-after answers from the same people are paired, not independent. A two-proportion test does not fit that design.

Key terms · tap one for its definition

10% condition

The 10% condition is the requirement that each sample is less than 10% of its population, so observations are approximately independent.

independent samples

Independent samples are two samples in which the individuals chosen for one sample give no information about the individuals in the other.

Part 3 done

4

Part 4 of 5: The large counts condition keeps the normal model reasonable

The last condition makes sure the sampling distribution of p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​ is approximately normal. Under H0H_0H0​, both populations share one proportion. We estimate it with the combined proportion, p^c=x1+x2n1+n2\hat{p}_c = \frac{x_1 + x_2}{n_1 + n_2}p^​c​=n1​+n2​x1​+x2​​, where x1x_1x1​ and x2x_2x2​ are the success counts.

The large counts condition asks that n1p^cn_1\hat{p}_cn1​p^​c​, n1(1−p^c)n_1(1-\hat{p}_c)n1​(1−p^​c​), n2p^cn_2\hat{p}_cn2​p^​c​, and n2(1−p^c)n_2(1-\hat{p}_c)n2​(1−p^​c​) are all at least 10.

To check it, multiply each sample size by p^c\hat{p}_cp^​c​ and by 1−p^c1-\hat{p}_c1−p^​c​. Small samples, or a proportion near 0 or 1, are the usual causes of failure. When the counts are too small, the normal model gives unreliable p-values.

Worked example

Checking large counts

A random sample of 120 students from one school has 66 successes. An independent random sample of 150 students from another school has 60 successes. Check the large counts condition.
  1. 1
    Combine the samples: p^c=66+60120+150=126270≈0.467\hat{p}_c = \frac{66 + 60}{120 + 150} = \frac{126}{270} \approx 0.467p^​c​=120+15066+60​=270126​≈0.467.
  2. 2
    For sample 1: 120(0.467)≈56.0120(0.467) \approx 56.0120(0.467)≈56.0 and 120(0.533)≈64.0120(0.533) \approx 64.0120(0.533)≈64.0.
  3. 3
    For sample 2: 150(0.467)≈70.0150(0.467) \approx 70.0150(0.467)≈70.0 and 150(0.533)≈80.0150(0.533) \approx 80.0150(0.533)≈80.0.
  4. 4
    Compare each value with 10.

Answer: All four values are at least 10, so the large counts condition is met.

Key terms · tap one for its definition

combined proportion

The combined proportion, p^c\hat{p}_cp^​c​, is the total number of successes in both samples divided by the total sample size, also called the pooled proportion.

large counts condition

The large counts condition is the requirement that both samples have at least 10 expected successes and 10 expected failures when computed with p^c\hat{p}_cp^​c​.

Part 4 done

Quick check

One question on the part you just read

Easy

Identify which claim leads to the alternative hypothesis Ha:p1−p2≠0H_a: p_1 - p_2 \neq 0Ha​:p1​−p2​=0.
Show answer and explanation

Answer: A · Worked explanation

A claim that the proportions are simply different, with no direction, gives a two-sided alternative. Claims of higher or lower give one-sided alternatives. A statement about the sample proportions is not a hypothesis, because hypotheses describe populations and the samples are already known to differ.
5

Part 5 of 5: The correct procedure is a two-proportion z-test

With hypotheses written and conditions checked, the remaining task is naming the procedure. A two-proportion z-test compares two population proportions. It uses the difference p^1−p^2\hat{p}_1 - \hat{p}_2p^​1​−p^​2​ and a standard normal model.

Choose it when the data match all of these features:

  • Two groups, each summarized by a proportion
  • One categorical variable with two outcomes, called success and failure
  • Independent random samples or randomized groups
  • A claim about whether the two proportions differ

One sample compared with a stated value calls for a one-proportion test instead. Paired data call for a different method altogether.

Exam tip

In a written answer, name the test and check each condition with the actual numbers. Then state the hypotheses with both parameters defined.

Key term

two-proportion z-test

The two-proportion z-test is a significance test of H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 that uses a z statistic and the standard normal model.

Note read

Check your recall[13 marks]

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

  1. 1.Identify[3 marks]

    Identify the parameters and the hypotheses for testing whether a higher proportion of students who use a study app than students who do not use it pass a quiz.

    Show mark schemeHide mark scheme

    Model answer

    Let p1p_1p1​ be the true proportion of app users who pass and p2p_2p2​ the true proportion of non-users who pass. H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0 and Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0.

    • 1 mark for defining both population proportions in context
    • 1 mark for writing H0:p1−p2=0H_0: p_1 - p_2 = 0H0​:p1​−p2​=0
    • 1 mark for writing the one-sided Ha:p1−p2>0H_a: p_1 - p_2 > 0Ha​:p1​−p2​>0
  2. 2.Describe[3 marks]

    Describe the conditions that must be checked before using a two-proportion z-test.

    Show mark schemeHide mark scheme

    Model answer

    The data must come from random samples or a randomized experiment. Observations must be independent, with each sample under 10% of its population and the two groups independent of each other. All expected success and failure counts must be at least 10.

    • 1 mark for stating the random sampling or random assignment condition
    • 1 mark for stating independence, including the 10% condition and independent groups
    • 1 mark for stating the large counts condition with at least 10 expected successes and failures
  3. 3.Determine[3 marks]

    Determine whether the large counts condition is met when 45 of 90 individuals in sample 1 and 30 of 110 individuals in sample 2 are successes.

    Show mark schemeHide mark scheme

    Model answer

    p^c=75200=0.375\hat{p}_c = \frac{75}{200} = 0.375p^​c​=20075​=0.375. Then 90(0.375)=33.7590(0.375) = 33.7590(0.375)=33.75, 90(0.625)=56.2590(0.625) = 56.2590(0.625)=56.25, 110(0.375)=41.25110(0.375) = 41.25110(0.375)=41.25 and 110(0.625)=68.75110(0.625) = 68.75110(0.625)=68.75. All are at least 10, so the condition is met.

    • 1 mark for finding p^c=0.375\hat{p}_c = 0.375p^​c​=0.375
    • 1 mark for calculating all four expected counts
    • 1 mark for concluding that all are at least 10 so the condition is met
  4. 4.Justify[2 marks]

    Justify why a two-proportion z-test is not appropriate when the same 50 people are asked before and after a campaign whether they recycle.

    Show mark schemeHide mark scheme

    Model answer

    The same people are in both groups, so the samples are paired and not independent. The test requires two independent samples.

    • 1 mark for identifying that the same individuals appear in both groups
    • 1 mark for linking this to the failure of independence between samples
  5. 5.Explain[2 marks]

    Explain why the direction of the alternative hypothesis should come from the research question rather than from the sample results.

    Show mark schemeHide mark scheme

    Model answer

    Hypotheses are claims about population proportions that are set before collecting data. Choosing the direction after seeing the data would build the answer into the test.

    • 1 mark for stating that hypotheses are set before seeing the data
    • 1 mark for explaining that choosing the direction from the sample would bias the test

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 correct formula for the combined proportion of two samples, where x1x_1x1​ and x2x_2x2​ are the success counts.
Show answer and explanation

Answer: C · Worked explanation

The combined proportion is total successes over total sample size. Averaging the two sample proportions is wrong unless the samples are the same size, because it gives the larger sample no extra weight. Adding the two separate proportions can exceed 1, which is impossible for a proportion.
4.

Medium·Calculate[2 marks]

Sample 1 has 30 successes out of 50 individuals. Sample 2 has 20 successes out of 100 individuals. Calculate the combined proportion p^c\hat{p}_cp^​c​.
Show answer and explanation

Answer: B · Worked explanation

p^c=30+2050+100=50150≈0.33\hat{p}_c = \frac{30 + 20}{50 + 100} = \frac{50}{150} \approx 0.33p^​c​=50+10030+20​=15050​≈0.33. The value 0.40 comes from averaging 0.60 and 0.20, which ignores that sample 2 is twice as large. The value 0.67 is the combined proportion of failures, not successes.
5.

Medium·Determine[2 marks]

A researcher has 12 successes in a sample of 40 and 8 successes in a sample of 50. Determine whether the large counts condition is met, using the combined proportion.
Show answer and explanation

Answer: D · Worked explanation

p^c=2090≈0.222\hat{p}_c = \frac{20}{90} \approx 0.222p^​c​=9020​≈0.222, so n1p^c≈8.9n_1\hat{p}_c \approx 8.9n1​p^​c​≈8.9, which is below 10. All four expected counts must be at least 10, so one small value is enough to fail. Checking only the failure counts misses the problem, and unequal sample proportions do not violate the condition.
6.

Medium·Identify[2 marks]

A clinic claims drug A has a higher cure rate than drug B. Let p1p_1p1​ be the true cure rate for drug A and p2p_2p2​ for drug B. Identify the alternative hypothesis.
Show answer and explanation

Answer: A · Worked explanation

Because group 1 is drug A and the claim says drug A is higher, the alternative is p1−p2>0p_1 - p_2 > 0p1​−p2​>0. The reversed sign would match a claim that drug A is lower. A not-equal sign would be right only if the claim said the drugs differ, and an equal sign belongs in the null.
7.

Medium[2 marks]

Which situation calls for a two-proportion z-test?
Show answer and explanation

Answer: A · Worked explanation

Two independent random samples with a success-or-failure variable fit the test. Surveying the same students twice gives paired data. Comparing one sample with a stated value needs a one-proportion test, and heights are measurements, not proportions, so a method for proportions does not apply.
8.

Hard·Determine[2 marks]

A random sample of 500 residents is taken from a town of 3,000 people. A second sample of 80 is taken from a town of 5,000 people. Determine which condition is violated.
Show answer and explanation

Answer: A · Worked explanation

5003000≈0.167\frac{500}{3000} \approx 0.1673000500​≈0.167, which is more than 10%, so independence of observations is in doubt for sample 1. Sample 2 is 805000=1.6%\frac{80}{5000} = 1.6\%500080​=1.6% of its population, which is fine. Random selection alone does not make the 10% condition hold, and small samples do not break it.
9.

Hard·Identify[2 marks]

Volunteers are randomly assigned to one of two treatments, and the proportion who improve is compared. Identify the statement that correctly describes the conditions for a two-proportion z-test.
Show answer and explanation

Answer: A · Worked explanation

In a randomized experiment, random assignment supports conclusions about cause and satisfies the randomness condition. The large counts condition is still needed for the normal model. Volunteers are not a random sample, so results cannot be generalized to all people, but that does not stop a valid test.
10.

Hard·Determine[2 marks]

Group 1 is defined as the old method and group 2 as the new method. A researcher claims the new method has a higher success rate. Determine the alternative hypothesis.
Show answer and explanation

Answer: C · Worked explanation

The new method is group 2, and the claim is p2>p1p_2 > p_1p2​>p1​, which is the same as p1−p2<0p_1 - p_2 < 0p1​−p2​<0. Writing >>> copies the word higher without checking which group is group 1. The expression p2−p1<0p_2 - p_1 < 0p2​−p1​<0 would say the new method is lower, which reverses the claim.

Keep going

Next topic3.13 Carrying out a two-proportion testPrevious topic3.11 Claims from a difference interval

More in Unit 3 · Inference for Categorical Data: Proportions

  1. 3.7Carrying out a test for a proportionNotes · 10 questions
  2. 3.8Errors in testsNotes · 10 questions
  3. 3.9Differences in sample proportionsNotes · 10 questions
  4. 3.10Interval for a difference of proportionsNotes · 10 questions
  5. 3.11Claims from a difference intervalNotes · 10 questions
  6. 3.12Setting up a two-proportion testNotes · 10 questions
  7. 3.13Carrying out a two-proportion testNotes · 10 questions
  8. 3.14Setting up a chi-square test for two-way tablesNotes · 10 questions
  9. 3.15Carrying out a chi-square test for two-way tablesNotes · 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 compare two population proportions with each other
  2. 2The direction of the alternative comes from the claim
  3. 3Valid inference needs random, independent samples
  4. 4The large counts condition keeps the normal model reasonable
  5. 5The correct procedure is a two-proportion z-test
  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