This page is a drill . The parent note built the machinery — here we walk through every case class the four tests can throw at you: known vs unknown spread, one-sided vs two-sided, tiny samples, degenerate/limiting inputs, and exam traps.
Before symbols show up, one reminder in plain words so line one is followable:
Intuition The one idea behind all of it
Every test builds a weirdness score = how much wobble is normal how far the data sits from the boring guess . If that score lands in the far tail of a known "luck curve," the boring story stops being believable and we ==reject H 0 == (the boring guess).
"how far" = a difference like x ˉ − μ 0 , or O i − E i .
"wobble" = a standard error σ / n or E i , or a second variance.
Definition The three symbols we reuse everywhere below
H 0 = the null hypothesis , the "boring guess" or status-quo claim we try to knock down — e.g. "the mean is exactly μ 0 " or "the die is fair." Every test assumes H 0 is true while computing the luck curve, then asks whether the data still fits. We either reject H 0 (data too weird for luck) or fail to reject H 0 (luck is a fine explanation). We never "prove H 0 true."
k = the number of categories (bins) in a chi-squared goodness-of-fit test — e.g. the 6 faces of a die give k = 6 .
Critical-value subscript convention: we write c p , ν where the subscript p is the tail area to the right (the area cut off in the far tail) and ν is the degrees of freedom. So z 0.025 = 1.96 means "the point with 2.5% of a standard Normal above it," and t 0.025 , 5 = 2.571 means the same idea for a t with ν = 5 . For a two-sided test at level α we split α into two tails and use tail area α /2 ; for a one-sided test we keep the whole α in one tail and use tail area α .
Definition p-value — the alternative to critical values
The p-value is the probability, computed as if H 0 were true , of getting a test statistic as extreme or more extreme than the one we actually saw. Small p-value = our data would be a rare fluke under H 0 = evidence against H 0 .
There are two equivalent verdict rules, and every example below states both:
Critical-value rule: reject H 0 if the statistic passes the fence c p , ν .
p-value rule: reject H 0 if p-value < α .
They always agree because the fence is defined as the point whose tail area equals α (or α /2 per side): "statistic beyond the fence" and "tail area below α " are the same sentence. "Extreme" means both tails for a two-sided test and one tail (the predicted direction) for a one-sided test. See p-value .
Each row is a case class you must be able to handle. The right column names the worked example that lands on it.
#
Case class
What makes it tricky
Example
A
Mean, σ known , two-sided
denominator is a fixed constant
Ex 1
B
Mean, σ known, one-sided
tail lives on one side only (sign of cutoff)
Ex 2
C
Mean, σ unknown , small n
must use s → fatter-tailed t
Ex 3
D
Limiting case: n → ∞
t collapses into z
Ex 4
E
GOF, uniform expected
all E i equal, ν = k − 1
Ex 5
F
GOF, estimated parameter
lose an extra d.f., ν = k − 1 − m
Ex 6
G
Degenerate GOF: O i = E i
zero surprise, χ 2 = 0
Ex 7
H
F-test, two variances, two-sided
larger s 2 on top, F ≥ 1
Ex 8
I
Word problem end-to-end
choosing the right test yourself
Ex 9
J
Exam twist : same data, wrong test
how the verdict flips
Ex 10
We lean on Central Limit Theorem , Student's t-distribution , Chi-squared Distribution , F-distribution , Degrees of Freedom and Bessel's Correction throughout — the parent note defined them; here we use them.
How to read the figure (four small panels):
Top-left overlays the standard Normal (blue, the z curve) and a t with ν = 3 (orange). The shaded orange slivers past ± 1.9 are the extra tail area the t carries — that shaded region is precisely why the t critical value (2.571 in Ex 3) sits farther out than the z 's 1.96 .
Top-right shows two χ 2 curves (used in Ex 5–7); the red dashed line at 7.82 is the ν = 3 upper-tail fence — note χ 2 lives only on the positive axis, so there is no lower tail.
Bottom-left shows F 7 , 10 (Ex 8) with its upper critical value at 4.03 .
Bottom-right stacks t curves for ν = 1 then ν = 8 against the Normal, so you can watch the tails thin as ν grows — the visual meaning of "t → z " in Ex 4.
Keep this figure in view: every example below points back to one of its four panels.
Worked example Ex 1 · Cereal box weight
A machine should fill boxes to μ 0 = 500 g. Long factory history gives a known σ = 6 g. A sample of n = 36 boxes averages x ˉ = 502.4 g. At α = 0.05 , is the machine off-target (either way)?
Forecast: guess now — will ∣ Z ∣ beat 1.96 , or not? Jot a yes/no.
Standard error SE = n σ = 36 6 = 6 6 = 1 .
Why this step? Averaging 36 boxes shrinks the wobble by 36 = 6 ; the mean is 6 × steadier than one box.
Z-statistic Z = SE x ˉ − μ 0 = 1 502.4 − 500 = 2.4 .
Why this step? This counts how many standard errors the sample sits above the target — a pure, unit-free distance.
Critical-value rule: two-sided tail area α /2 = 0.025 gives z 0.025 = 1.96 ; ∣2.4∣ > 1.96 .
Why this step? "Either way" off-target means both tails count, so we split α and use tail area 0.025 per side (top-left panel of the figure).
p-value rule: for a two-sided z = 2.4 , the tail area beyond ± 2.4 is 2 × P ( Z > 2.4 ) ≈ 2 × 0.0082 = 0.0164 . Since 0.0164 < 0.05 , same verdict.
Why this step? The p-value quantifies how rare — under H 0 we'd see a deviation this big only about 1.6% of the time.
Both rules ⇒ reject H 0 . The machine is significantly off-target.
Why this step? Statistic beyond the fence and p-value below α are the same fact stated two ways.
Verify: σ was known , so the denominator is a constant — only x ˉ is random, and by the Central Limit Theorem it is Normal. Using z (not t ) is correct. Units: g / g = dimensionless ✓.
Worked example Ex 2 · Is the drug
faster ?
A standard painkiller acts in μ 0 = 30 min, known σ = 8 min. A new pill on n = 64 patients averages x ˉ = 28 min. Does it act faster (H 1 : μ < 30 )? Use α = 0.05 .
Forecast: one-sided cutoff is closer to zero than 1.96 — will that change the verdict?
SE = 64 8 = 8 8 = 1 .
Why this step? Same shrink-by-n logic; n = 64 ⇒ factor 8 .
Z = 1 28 − 30 = − 2.0 .
Why this step? Negative because the sample is below the claim — exactly the direction "faster" predicts.
Sign of the cutoff. Our subscript rule gives z 0.05 = 1.645 , which is the point with 5% of the Normal above it. But H 1 : μ < 30 pushes the rejection region into the lower tail, so the actual fence is the mirror-image point − z 0.05 = − 1.645 . Critical-value rule: reject if Z < − 1.645 .
Why this step? The subscript p always names an upper tail area, so a lower-tail test flips the sign: the fence is − z 0.05 , not + z 0.05 . Forgetting the minus is a classic error.
− 2.0 < − 1.645 ⇒ statistic passes the lower fence.
Why this step? The result sits farther into the lower tail than the cutoff allows under luck alone.
p-value rule: one-sided, lower tail, p = P ( Z < − 2.0 ) ≈ 0.0228 . Since 0.0228 < 0.05 , same verdict.
Why this step? We only count the predicted (lower) direction, so we do not double it — a one-sided p-value is half of the two-sided one for the same ∣ Z ∣ .
Both rules ⇒ reject H 0 . Evidence the pill is faster.
Verify: the same ∣ Z ∣ = 2.0 gives two-sided p ≈ 0.0455 and one-sided p ≈ 0.0228 — exactly half. The one-sided test is easier to reject in the predicted direction. Consistent ✓.
Worked example Ex 3 · Handmade nails length
Target μ 0 = 50 mm. We measure n = 6 nails: 51 , 49 , 52 , 50 , 48 , 50 . We have no known σ . Is the length off-target at α = 0.05 (two-sided)?
Forecast: with only 6 nails and unknown spread, do you expect the critical value to be near 1.96 or noticeably bigger?
Mean x ˉ = 6 51 + 49 + 52 + 50 + 48 + 50 = 6 300 = 50 .
Why this step? The centre of the data — our best guess of μ .
Deviations 1 , − 1 , 2 , 0 , − 2 , 0 ; squares 1 , 1 , 4 , 0 , 4 , 0 ; sum = 10 .
Why this step? Squaring removes signs so pluses and minuses don't cancel; big misses count more.
Sample variance with Bessel's Correction : s 2 = n − 1 10 = 5 10 = 2 , so s = 2 ≈ 1.414 .
Why divide by n − 1 ? Deviations are from x ˉ , not the true μ ; the data hugs its own mean, so we'd underestimate spread using n . One d.f. is spent on the constraint ∑ ( x i − x ˉ ) = 0 .
SE = n s = 6 1.414 ≈ 0.577 .
Why this step? Convert the spread of single nails into the spread of their average by dividing by n .
t = SE x ˉ − μ 0 = 0.577 50 − 50 = 0 , with ν = n − 1 = 5 .
Why this step? Same "distance in SE" idea, but with the estimated s → we read it against Student's t-distribution (top-left/bottom-right panels).
Critical-value rule: two-sided tail area α /2 = 0.025 gives t 0.025 , 5 = 2.571 ; ∣0∣ < 2.571 . p-value rule: p = 2 × P ( t 5 > 0 ) = 2 × 0.5 = 1.0 > 0.05 . Both ⇒ fail to reject .
Why this step? A statistic of exactly 0 is the least surprising outcome possible; its p-value is the maximum, 1.0 .
Verify: x ˉ landed exactly on μ 0 , so the numerator is 0 and t = 0 regardless of s — the maximally boring outcome. No evidence of off-target ✓. Note 2.571 > 1.96 : the t is more demanding, as its fatter tails require.
Worked example Ex 4 · When
t becomes z
Same style as Ex 3 but with a huge sample: n = 2001 , x ˉ = 50.2 , s = 1.414 , target μ 0 = 50 . Two-sided, α = 0.05 .
Forecast: with ν = 2000 , will the critical value be closer to 1.96 or to 2.571 ?
SE = 2001 1.414 ≈ 44.73 1.414 ≈ 0.03162 .
Why this step? Enormous n makes the mean extremely steady.
t = 0.03162 50.2 − 50 ≈ 6.32 , ν = 2000 .
Why this step? Same standardized-distance formula as Ex 3; the tiny SE turns a modest 0.2 mm gap into a huge number of standard errors.
Critical-value rule: two-sided tail area 0.025 gives t 0.025 , 2000 ≈ 1.961 — essentially the z value 1.96 ; 6.32 > 1.961 . p-value rule: p = 2 × P ( t 2000 > 6.32 ) ≈ 3 × 1 0 − 10 , far below 0.05 . Both ⇒ reject H 0 .
Why this step? As n → ∞ , s → σ , the extra denominator-noise vanishes, and t → N ( 0 , 1 ) ; the fat tails thin out (bottom-right panel).
Verify: the ratio t 0.025 , 2000 /1.96 ≈ 1.0005 — within 0.1% of the Normal. This is the concrete meaning of "t → z ." Using z here would give the same verdict ✓.
Worked example Ex 5 · Is the spinner fair?
A 4 -colour spinner is spun n = 100 times: O = ( 30 , 20 , 22 , 28 ) . A fair spinner predicts each colour equally. Here the number of categories is k = 4 . Test fairness at α = 0.05 .
Forecast: the counts wobble around 25 — do you think that wobble is "just luck"?
Expected each cell E i = 4 100 = 25 .
Why this step? "Fair" spreads the total evenly across k = 4 categories.
Check the E i ≥ 5 rule. All E i = 25 ≥ 5 , so the χ 2 approximation is valid — proceed.
Why this step? The chi-squared curve only approximates the true count-distribution when expected cells aren't tiny; we confirm before trusting the fence.
Cell contributions E i ( O i − E i ) 2 : deviations 5 , − 5 , − 3 , 3 ; squares 25 , 25 , 9 , 9 ; each over 25 : 1 , 1 , 0.36 , 0.36 .
Why divide by E i ? A count in a cell behaves roughly Poisson with variance ≈ E i , so E i O i − E i is a standardized z -like quantity; squaring and summing gives a Chi-squared Distribution .
χ 2 = 1 + 1 + 0.36 + 0.36 = 2.72 .
Why this step? Summing the per-cell surprises gives one total "how badly does the model fit" number.
Degrees of freedom ν = k − 1 = 4 − 1 = 3 (the total is fixed at 100 , costing one d.f.).
Why this step? The counts must sum to n , so only k − 1 of them wander freely. See Degrees of Freedom .
Critical-value rule: tail area α = 0.05 gives χ 0.05 , 3 2 = 7.815 ; 2.72 < 7.815 . p-value rule: p = P ( χ 3 2 > 2.72 ) ≈ 0.437 > 0.05 . Both ⇒ spinner looks fair .
Why this step? Chi-squared has only an upper tail (surprise can't be negative), so "extreme" means "large" and the whole α sits on the right.
Verify: all E i = 25 ≥ 5 ✓. Our surprise (2.72 ) is well under what luck routinely produces (up to ∼ 7.8 ); p-value ≈ 0.44 says such a mismatch happens 44% of the time by chance ✓.
Worked example Ex 6 · Counting typos per page (Poisson fit)
We count typos on n = 100 pages and bin them into k = 4 categories (0, 1, 2, 3+). We estimated the Poisson rate λ from the same data (that's m = 1 fitted parameter). The expected counts come out E = ( 37 , 37 , 18 , 8 ) and observed O = ( 40 , 34 , 20 , 6 ) . Does the Poisson model fit at α = 0.05 ?
Forecast: estimating λ costs a d.f. — will ν be 3 or 2 ?
Check the E i ≥ 5 rule. The expecteds are 37 , 37 , 18 , 8 — the smallest is 8 ≥ 5 , so the χ 2 approximation holds and no pooling is needed.
Why this step? If any E i had fallen below 5 (say the "3+" bin came out E = 2 ), we would merge it with a neighbouring bin (e.g. combine "2" and "3+"), recompute, and reduce k by one — tiny expecteds inflate the statistic and break the approximation.
Cell contributions E i ( O i − E i ) 2 :
37 ( 40 − 37 ) 2 = 37 9 ≈ 0.2432
37 ( 34 − 37 ) 2 = 37 9 ≈ 0.2432
18 ( 20 − 18 ) 2 = 18 4 ≈ 0.2222
8 ( 6 − 8 ) 2 = 8 4 = 0.5
Why this step? Each cell's squared miss is scaled by the count we expected there, turning raw errors into standardized, comparable surprises.
χ 2 ≈ 0.2432 + 0.2432 + 0.2222 + 0.5 = 1.2087 .
Why this step? Adding the four standardized surprises gives the single total we test against the Chi-squared Distribution .
Degrees of freedom ν = k − 1 − m = 4 − 1 − 1 = 2 .
Why this step? Two constraints now: the total is fixed (−1) and we forced λ to match the data (−1 more). Each fitted parameter buys one extra constraint.
Critical-value rule: tail area α = 0.05 gives χ 0.05 , 2 2 = 5.991 ; 1.21 < 5.991 . p-value rule: p = P ( χ 2 2 > 1.2087 ) ≈ 0.546 > 0.05 . Both ⇒ Poisson model fits .
Why this step? The total surprise is tiny next to the upper-tail fence, and a mismatch this small happens over half the time by chance.
Verify: compare to the trap of using ν = 3 : critical would be 7.815 and p = P ( χ 3 2 > 1.2087 ) ≈ 0.751 — the verdict survives either way here, but with a borderline statistic the wrong ν flips it. Always subtract fitted parameters m ✓.
Worked example Ex 7 · The suspiciously perfect die
A die is rolled 60 times and lands O = ( 10 , 10 , 10 , 10 , 10 , 10 ) — exactly the fair expectation E i = 10 . Here the number of categories is k = 6 .
Forecast: what is the smallest a χ 2 can ever be?
Check the E i ≥ 5 rule. Every E i = 10 ≥ 5 ✓ — the approximation is valid.
Why this step? Same guard as Ex 5–6; even a degenerate case needs the expecteds large enough for the fence to mean anything.
Every cell E i ( O i − E i ) 2 = 10 ( 10 − 10 ) 2 = 0 .
Why this step? Zero deviation everywhere means zero squared surprise.
χ 2 = 0 .
Why this step? A sum of zeros is zero — the model matched every category exactly.
With ν = k − 1 = 5 : critical-value rule — any fence > 0 , so we never reject. p-value rule — p = P ( χ 5 2 > 0 ) = 1.0 , the maximum. Both ⇒ never reject ; the fit is as good as arithmetically possible.
Why this step? χ 2 ≥ 0 always (a sum of squares over positives); 0 is the floor, so nothing pushes it into the rejection tail, and its p-value is 1 .
Verify: χ 2 can never be negative and equals 0 iff every O i = E i ; then p-value = 1 . In real life a perfect match is itself odd, but the GOF test only flags bad fits in its upper tail, not "too good" fits — so a suspiciously tidy dataset needs a different check, not this one. ✓
How to read this figure: the blue curve is the F 7 , 10 luck curve for the ratio of two sample variances. The red dashed line at 4.03 is the upper-tail fence; the red-shaded region beyond it is the rejection zone. The orange line marks our observed F = 3.0 — sitting left of the fence, inside the "could be luck" region.
Worked example Ex 8 · Which lathe is more consistent?
Lathe A: s 1 2 = 45 , n 1 = 8 . Lathe B: s 2 2 = 15 , n 2 = 11 . Are their variances significantly different at α = 0.05 (two-sided)?
Forecast: the ratio is 3 — big enough to beat the critical F ?
Put the larger s 2 on top: F = s 2 2 s 1 2 = 15 45 = 3.0 .
Why this step? Forcing F ≥ 1 lets us use a single upper-tail critical value instead of chasing the lower tail. See F-distribution .
Degrees of freedom ν 1 = n 1 − 1 = 7 (numerator), ν 2 = n 2 − 1 = 10 (denominator).
Why this step? Each variance estimate is a χ 2 / ν ; the F is a ratio of two such, one d.f. per estimate.
Critical-value rule: two-sided at α = 0.05 puts 2.5% in each tail; with the bigger variance on top we read the upper value with tail area α /2 = 0.025 : F 0.025 , 7 , 10 ≈ 4.03 ; 3.0 < 4.03 .
Why this step? "Different" allows either lathe to be noisier, so we split 5% ; placing the bigger on top means only the upper 2.5% tail is ever tested.
p-value rule: p = 2 × P ( F 7 , 10 > 3.0 ) ≈ 2 × 0.0503 ≈ 0.101 > 0.05 . Same verdict.
Why this step? We double the one-tail area because a two-sided variance test allows an extreme ratio either way; 0.101 says a ratio this far from 1 happens about 10% of the time under equal variances.
Both rules ⇒ fail to reject . Variances not significantly different.
Verify: the figure shows F = 3.0 (orange) left of 4.03 (red dashed) — inside the "could be luck" region, matching p ≈ 0.10 > 0.05 . Order-of-magnitude F ≈ 3 with ∼ 10 d.f. is common under H 0 ✓.
Worked example Ex 9 · The café owner
"My espresso machine is supposed to dispense 30 ml per shot. I don't trust the factory's spread, so I measured 10 shots myself: x ˉ = 31.2 ml, s = 2.4 ml. Am I over-dispensing at α = 0.05 ?"
Forecast: which of the four tests, and why? Decide before reading step 1.
Pick the test. We compare one mean to a target, σ is unknown (owner doesn't trust the factory value) and n = 10 is small ⇒ one-sample t -test , one-sided (H 1 : μ > 30 ).
Why this step? Unknown σ + estimated s = the exact signature that forces t over z (Hypothesis Testing ).
SE = n s = 10 2.4 ≈ 0.7589 .
Why this step? Turn the spread of single shots into the spread of their average by dividing by n — the wobble of the quantity we actually test.
t = SE x ˉ − μ 0 = 0.7589 31.2 − 30 ≈ 1.581 , ν = 9 .
Why this step? The standardized distance: how many standard errors the measured average sits above the target, read against t with ν = n − 1 = 9 .
Critical-value rule. "Over-dispensing" is a one-direction upper claim, so the whole α = 0.05 sits in the upper tail: t 0.05 , 9 = 1.833 ; reject if t > 1.833 . Here 1.581 < 1.833 — no sign flip needed because the claim is upper-tail, so the fence is + t 0.05 , 9 .
Why this step? Contrast with Ex 2: there the claim was lower -tail so we used − z 0.05 ; here it is upper -tail so we keep the plus sign. The direction of H 1 dictates the sign.
p-value rule. p = P ( t 9 > 1.581 ) ≈ 0.074 > 0.05 . Same verdict.
Why this step? One-sided, upper direction only, so no doubling; 0.074 narrowly exceeds α .
Both rules ⇒ fail to reject . Not enough evidence of over-dispensing.
Verify: the p-value ≈ 0.074 > 0.05 is consistent with "fail to reject," and it is close to α — a slightly larger x ˉ would tip it over. Units ml/ ml cancel ✓.
Worked example Ex 10 · The tempting shortcut
Take Ex 9's numbers (x ˉ = 31.2 , s = 2.4 , n = 10 , target 30 ). A student says: "The CLT makes everything Normal, so I'll just use a z -test with 1.645 ." Does the verdict change?
Forecast: same statistic value 1.581 — but a different reference curve. Reject or not?
The student computes the same ratio z = 2.4/ 10 31.2 − 30 ≈ 1.581 (they plug s where σ should be).
Why this step? Numerically identical to Ex 9's t ; only the reference curve differs, so the arithmetic can't reveal the mistake.
Wrong critical value. They compare to the one-sided z 0.05 = 1.645 instead of t 0.05 , 9 = 1.833 .
Why this step? A z -test reads the Normal, whose one-sided 5% point is 1.645 ; the correct t curve for ν = 9 has a farther fence at 1.833 .
Wrong p-value too. The Normal p-value P ( Z > 1.581 ) ≈ 0.057 is smaller than the correct t p-value P ( t 9 > 1.581 ) ≈ 0.074 , because the t 's fatter tail piles more probability past 1.581 .
Why this step? Both the fence and the p-value get distorted; the shortcut makes the result look more significant than it is.
1.581 < 1.645 ⇒ still fail to reject here — but only barely. Had x ˉ been 31.3 , the wrong-test z (z p ≈ 0.041 < 0.05 ) would reject while the correct t would not.
Why this step? Since 1.645 < 1.833 , the z rejection region is wider : the shortcut rejects too easily , inflating the Type I error rate above the promised 5% .
Verify: with unknown σ and n = 10 , the correct critical value is 1.833 , not 1.645 . The gap 1.833 − 1.645 = 0.188 is the exact cost of pretending s is σ ✓.
Recall Fast self-check
Which cell has χ 2 exactly 0 , and when? ::: Cell G — degenerate GOF, whenever every O i = E i ; χ 2 is a sum of squares so 0 is its floor and its p-value is 1 .
In Ex 2 why is the fence − 1.645 not + 1.645 ? ::: The subscript p names an upper tail area, but H 1 : μ < 30 puts the rejection region in the lower tail, so we mirror to − z 0.05 .
In Ex 8 why is the larger variance on top? ::: So F ≥ 1 and we only ever read the single upper-tail critical value.
In Ex 6 why is ν = 2 not 3 ? ::: We estimated one parameter (λ ) from the data, costing an extra degree of freedom: ν = k − 1 − m = 4 − 1 − 1 .
State both verdict rules. ::: Critical-value rule: reject if statistic beyond c p , ν . p-value rule: reject if p-value < α . They always agree.
Common mistake The three sign-and-count traps this page defused
Lower-tail cutoff sign (Ex 2): the subscript p is always an upper area; a lower-tail test uses − z p .
Tiny expected counts (Ex 6): if any E i < 5 , pool categories before trusting χ 2 .
Wrong reference curve (Ex 10): unknown σ + small n needs t ; using z inflates Type I error.
Mnemonic Picking a cell in an exam
Mean? → known σ = z , unknown σ = t . Counts in bins? → chi-squared (subtract fitted params from ν ; check E i ≥ 5 ). Two spreads? → F (big on top). One-sided keeps the whole α in one tail (mind the cutoff sign); two-sided splits α into α /2 per tail. Either verdict rule works: fence or p-value.