When someone claims a population proportion is a certain number and our sample comes back lower or higher, we need a way to tell whether the gap is just ordinary random luck or real evidence that the claim is wrong.
1
Setting Up the Hypotheses
To test a claimed proportion, we first write down two competing explanations for our sample: the claim itself, and what we suspect is actually true.
Suppose a trading card company claims that 20% of its packs contain a rare holographic card, written in blue as p=0.20, and you open a random sample of n=100 packs only to find 12 holographic cards, giving a sample proportion in orange of p^=0.12.
Setting Up the Hypotheses
Text solution
Start by assuming the company's claim is true
H0:p=0.20(null hypothesis)
State whether we suspect the true proportion is lower, higher, or just different
Ha:p<0.20(alternative hypothesis)
So our test begins by assuming p=0.20 is true to see whether getting a sample as low as p^=0.12 could happen just by bad luck.
2
Checking Conditions Under the Null
We want to use a smooth normal bell curve centered at the claimed proportion p=0.20 to see how sample proportions from batches of n=100 behave.
Sample proportions p^ form an approximately normal bell curve around p when the sample is random and independent, and when we expect at least 10 successes and 10 failures so the curve stays away from the edges at 0% and 100%.
Here we have to be careful not to use p^ the way we did for confidence intervals:
Checking Conditions Under the Null
Text solution
Check that packs were selected at random and don't affect one another
Random and independent sampleof n=100 packs
Count expected successes and failures using the claimed p=0.20, not p^=0.12
n×pn×(1−p)=100×0.20=20≥10=100×0.80=80≥10
Both expected counts under H0 are at least 10, so the sampling distribution of p^ is approximately a normal bell curve centered at 0.20.
3
Finding the Standard Deviation Under the Null
Next, we want to find how far sample proportions of n=100 packs typically vary from 0.20 by pure chance, which is the standard deviation of the sampling distribution.
Sample proportions naturally vary from sample to sample by np(1−p), and in a hypothesis test we already have a claimed value of p to plug into that square root.
Finding the Standard Deviation Under the Null
Text solution
Substitute the claimed p=0.20 and sample size n=100 into the standard deviation formula
np(1−p)=1000.20×0.80=1000.16=100.40=0.04
So if the company's 20% claim is true, batches of 100 packs typically vary up or down from 0.20 by about 0.04 (4 percentage points) just by luck.
Whether our 0.08 gap from 0.20 to 0.12 looks ordinary or unusual depends on how wide the bell curve is: a 0.08 gap sits comfortably near the center of a wide curve, but far out in the left tail of a narrow one.
For the same fixed gap between our 0.12 sample and the claimed 0.20, the standard deviation of the bell curve decides whether the sample sits inside the main pile or far out in the tail.
4
Finding the z-Score and p-Value
Now we want to know how unusual our sample of p^=0.12 is on that bell curve, and whether the chance of getting a sample that far from 0.20 by luck is small enough to reject the company's claim.
Finding the z-Score and p-Value
Putting the gap and the standard deviation together gives the test formula:
z=standard deviation under H0np(1−p)p^−pgap from the claim
Text solution
Find how far the sample landed from the claim
p^−p=0.12−0.20=−0.08
Divide the gap by the standard deviation under H0 to find how many standard deviations away the sample is
z=0.04−0.08=−2
Find the left-tail area past z=−2 and compare it to α=0.05
p-value=0.0228≈2.3%<5%⟹Reject H0
Since random luck when p=0.20 produces a sample of 0.12 or lower only 2.3% of the time, we reject H0 and conclude there is convincing evidence that fewer than 20% of packs contain a holographic card.
Practical note: You already know from the 68–95–99.7 rule that about 95% of a normal curve lies within 2 standard deviations of the center, leaving 5% split between the two tails (2.5% in each tail). That immediately tells you that z=−2 has a left tail of about 2.5%, and a normal table or calculator gives the more precise 0.0228.
For a two-sided alternative Ha:p=0.20, double the one-tail area to include both directions:
Two-sided p-value=2×2.3%=4.6%
Sample proportions close to 0.20 leave a left-tail area above α=5%. That tail area drops below 5% once a sample lands about 1.645 standard deviations below 0.20, so at 0.12 (z=−2) the tail is only 2.3%, which is too unlikely to explain as bad luck.
As our sample lands more standard-deviation steps below the claim, the shaded left tail shrinks until getting a sample that low by chance happens less than 5% of the time.
5
The Four Steps of a One-Sample z-Test
Putting all four pieces together gives the complete method for testing any claimed population proportion from a single sample.
The Four Steps of a One-Sample z-Test
H0Ha:p=0.20:p<0.20
n=100,p^=0.12
reject H0 at α=0.05?
Key concepts
Everything in a one-sample z-test comes down to one question at the start: are we given a claimed proportion p to test?
When testing a claim (H0:p=0.20), use the claimed p everywhere
Since the test assumes the claim is true, use p=0.20 for both the Large Counts check (20≥10 and 80≥10) and the standard deviation (0.04). Your sample proportion p^=0.12 only shows up once, at the end, to find the gap on top of the z-score:
z=np(1−p)p^−p=0.040.12−0.20=−2
When NOT to use this setup
If a problem asks you to estimate an unknown proportion with a confidence interval and gives no claim to test, there is no H0 value of p. That is when you use the actual sample counts and plug p^ into the square root.
Matching the tail to Ha
A one-sided alternative (< or >) uses the single tail in that direction (2.3%). A two-sided alternative (=) counts samples that far away in both directions and doubles the single-tail area (2×2.3%=4.6%). When the p-value is below α, reject H0.
6
Practice
1
A mobile game studio claims that 50% of its daily mystery chests contain a bonus gem. You suspect the true rate is higher, so you open a random sample of 100 chests and find a bonus gem in 58 of them. State the null and alternative hypotheses, find the standard deviation of the sampling distribution under H0, and calculate the z-score for your sample.
Watch out: plugging p^=0.58 into the square root gives 1000.58×0.42≈0.0494 and a wrong z-score of 1.62; use the claimed p=0.50 from H0.
Which proportion belongs inside the square root when you are testing a claim: the studio's claimed rate or your sample result of 58 out of 100?
Hypotheses
H0:p=0.50,Ha:p>0.50
Sample proportion
p^=10058=0.58
Standard deviation under H0(Watch out: plugging p^=0.58 into the square root gives 1000.58×0.42≈0.0494 and a wrong z-score of 1.62; use the claimed p=0.50 from H0.)
np(1−p)=1000.50×0.50=1000.25=0.05
z-score(Watch out: subtracting in the reverse order, 0.50−0.58, flips the sign to −1.6; always compute sample minus claim, p^−p.)
z=0.050.58−0.50=0.050.08=1.6
2
A cereal company claims that 10% of its boxes contain a prize voucher. You buy a random sample of 120 boxes to test whether the true rate is lower than 10%, and you find only 6 vouchers (p^=0.05). Your friend says you cannot run a one-sample z-test because your sample has fewer than 10 successes. Is your friend right? Explain and check the Large Counts condition.
In a hypothesis test, are we checking the actual count in the sample, or the count we expect if the company's 10% claim is true?
Your friend is wrong.
(Watch out: checking the observed sample count np^=120×0.05=6<10 is the rule for a confidence interval when no claim exists, and falsely makes the test look invalid.)
In a hypothesis test we assume H0:p=0.10 is true and check the expected counts under the claim:
Because both 12≥10 and 108≥10, the Large Counts condition is met.
3
A battery manufacturer claims that 90% of its batteries last at least 12 hours. To test H0:p=0.90 against Ha:p<0.90 at α=0.05, you test a random sample of 100 batteries, find that 87 last at least 12 hours (p^=0.87), and get z=−1.00 with a p-value of 0.1587 (about 15.9%). Does this mean there is a 15.9% chance that the manufacturer's claim is true? State what the p-value actually means in context and what conclusion you should draw.
What are we already assuming is true when we calculate the area of that left tail?
No, the p-value is not the probability that the manufacturer's claim is true. It means that assuming the true proportion of batteries lasting at least 12 hours really is 0.90, there is a 15.9% chance of getting a random sample of 100 batteries with 87% or fewer lasting at least 12 hours just by random bad luck.
(Watch out: seeing a p-value above α=5% does not prove H0:p=0.90 is true. It only means random luck is still a believable explanation for the sample.)
Since 15.9%>5%, we do not reject H0; we do not have convincing evidence that the true proportion of batteries lasting at least 12 hours is less than 0.90.
4
A transit agency claims that 80% of its buses arrive on time. Suspecting that the true rate is lower, a commuter takes a random sample of 400 bus arrivals, finds 256 on time (p^=0.64), and calculates:
z=4000.64×0.360.64−0.80=0.024−0.16=−6.67
What mistake did the commuter make, and what is the correct z-score?
Watch out: forgetting to take the square root of the denominator 400 divides 0.40 by 400 instead of 20, giving a standard deviation of 0.001 and a wrong z-score of −160.The commuter plugged the sample proportion p^=0.64 into the standard deviation formula instead of the claimed proportion p=0.80 from H0.
Compare the numbers inside the commuter's square root with H0:p=0.80.
The commuter plugged the sample proportion p^=0.64 into the standard deviation formula instead of the claimed proportion p=0.80 from H0.
Correct standard deviation under H0(Watch out: forgetting to take the square root of the denominator 400 divides 0.40 by 400 instead of 20, giving a standard deviation of 0.001 and a wrong z-score of −160.)
np(1−p)=4000.80×0.20=4000.16=200.40=0.02
Correct z-score
z=0.020.64−0.80=0.02−0.16=−8
5
A factory machine is supposed to put dark-chocolate pretzels into 20% of its snack bags. A quality-control inspector wants to test whether the machine is off in either direction (H0:p=0.20 vs. Ha:p=0.20). In a random sample of 400 bags, she finds 96 bags with dark-chocolate pretzels. Using the fact that a single tail beyond 2 standard deviations has area 2.3%, find the z-score and the two-sided p-value, and explain how switching from a one-sided test (Ha:p>0.20) to this two-sided test changes the decision if α=0.03.
Once you find how many standard deviations p^ sits above 0.20, which tails of the bell curve count as at least that far from 0.20 when Ha has a = sign?
Sample proportion and standard deviation under H0
p^=40096=0.24
4000.20×0.80=4000.16=200.40=0.02
z-score
z=0.020.24−0.20=0.020.04=2
Two-sided p-value and decision(Watch out: leaving the p-value at the single-tail area of 2.3% ignores the left tail below z=−2 and wrongly rejects H0 at α=3%.) Because Ha:p=0.20 is two-sided, we shade both tails beyond z=2 and z=−2:
Two-sided p-value=2×2.3%=4.6%
At α=0.03 (3%), a one-sided test has a p-value of 2.3%<3% and rejects H0, whereas the two-sided test has a p-value of 4.6%>3% and fails to reject H0.