Exercises — Hypothesis testing — null - alternative, test statistic, p-value, errors (Type I & II)
This page is a self-testing ladder. Work each problem before opening its solution. Levels climb from "spot the pieces" to "design a whole test." The parent note Hypothesis testing — null - alternative, test statistic, p-value, errors (Type I & II) builds the theory; the prerequisites Central Limit Theorem, Standard Error, and Normal Distribution build the tools. But you should not need to leave this page — every symbol is re-anchored below before use.
A reference table of standard-normal tail areas we reuse (these are , the shaded area to the right of under the bell curve):
Level 1 — Recognition
Exercise 1.1
For each claim, write and , and state whether the test is two-, left-, or right-tailed. (a) "A drug changes average blood pressure from the known baseline ." (b) "A new fertilizer increases mean yield above kg." (c) "A factory's defect rate is below the old mean ."
Recall Solution 1.1
Remember: == always holds the equality== (why? the test needs one precise value to compute probabilities from — an inequality gives no single number to standardize against). The direction word in the claim picks the tail.
- (a) "changes" = could go either way → , → two-tailed.
- (b) "increases / above" → , → right-tailed.
- (c) "below" → , → left-tailed.
Exercise 1.2
A study reports at significance level . State the decision and phrase it correctly.
Recall Solution 1.2
Rule: reject when . Here → reject . Why this rule? is the chance of data this extreme if were true; is the fluke-rate we tolerate. When the data are rarer than our tolerance, so blaming pure luck stops being credible. Correct phrasing: "The data are inconsistent with at the level; we have evidence for ." We do not say " is proven."
Level 2 — Application
Exercise 2.1
A coffee machine should pour ml with known ml. A sample of cups gives ml. Test at whether the machine is mis-set.
Recall Solution 2.1
, (two-tailed — "mis-set" = either direction). Standard error . Why divide by ? Averaging noisy readings cancels much of the noise; the wobble of shrinks like . Here . Standardize: . Why? This converts " ml low" into " standard errors low," a unit-free score we can look up. Two-tailed p-value: . Why double the one-sided tail? "Mis-set" counts a mean this far above as equally surprising as this far below. So "as extreme as " means , i.e. the tail below plus the mirror tail above . Because the normal curve is symmetric, those two tails have equal area, so we take one tail and double it: → reject : the machine is mis-set (pouring low).
Exercise 2.2
A teacher claims a new method raises the mean score above . Sample: , , sample SD . Test at .
Recall Solution 2.2
is unknown (only the sample is given) → use the Student t-distribution statistic . , (right-tailed — "raises above"). . with . Why ? Estimating "uses up" one degree of freedom (the deviations from must sum to zero), leaving free. Critical value . Since → fail to reject . Wording: not enough evidence that the method raises scores.
Level 3 — Analysis
Exercise 3.1
Two students test the same data (, known, ). Student A runs a two-tailed test, Student B a right-tailed test, both at . Compute both p-values and explain why they disagree on the decision.
Recall Solution 3.1
From the table, .
- A (two-tailed): → fail to reject.
- B (right-tailed): → reject. Same number, opposite verdicts. Why? The two-tailed test spends on both sides ( each), so it demands a more extreme statistic before rejecting; the one-tailed test pours all into one side. This is exactly why the tail must be chosen before seeing data — otherwise you'd pick B because it gives you the result you want.
Exercise 3.2
In Exercise 2.1, describe in words what a Type I and a Type II error would mean for that machine, and say which one directly controls.
Recall Solution 3.2
- Type I (false alarm, prob ): the machine is actually pouring exactly ml, but we declare it mis-set and recalibrate a perfectly good machine.
- Type II (miss, prob ): the machine really is off, but our sample happened to look normal, so we leave it broken. directly controls the Type I rate: . It says nothing on its own about — that depends on the true and on (see Statistical Power & Sample Size).
Level 4 — Synthesis
Exercise 4.1
A quality engineer will reject a batch if the sample mean is far from . With , (so ), she uses a two-tailed test at , rejecting when . (a) Convert the rejection rule into a rule on (the two critical means). (b) Suppose the machine's true mean has drifted to . Find the power = probability she correctly rejects. (This is the shaded story in the figure below.)
Figure — how to read it. The figure draws two bell curves on the same -axis. The violet curve is (centred at ), the magenta curve is the true distribution of under the drift (, centred at ). The two navy dashed lines are the critical means and — outside them we reject. The orange shading is the slice of the magenta () curve that lies in the rejection region: its total area is the power. Notice almost all of the orange sits in the right tail, because is close to the upper cutoff and far from the lower one.

Recall Solution 4.1
(a) Rejection boundary in : . Convert with : So she rejects if or . (b) If the truth is , then — so we now standardize using , not . Power = area of the magenta curve past each cutoff:
- Upper tail: . Why ? By the symmetry of the standard normal, area right of = (area right of ) (area between and ) . Equivalently .
- Lower tail: (essentially no area that far out).
Power . Interpretation: even with a real -ml drift, she catches it only ~ of the time. To do better she must raise (narrows both curves) — the Statistical Power & Sample Size tradeoff, resting on the Central Limit Theorem.
Level 5 — Mastery
Exercise 5.1
You must design a two-tailed -test of with and . You want power to detect a true difference of . Find the minimum sample size . (Use the design formula , with for and for power .)
Recall Solution 5.1
Plug in , , , effect : Sample size must be a whole number and we round up (never down — rounding down loses power): Why this formula? It stitches two requirements onto one axis: the cutoff must sit SEs from (controls ) and SEs from the true mean on the other side (controls ). The gap between the means is ; setting it equal to and solving for gives the box. See Statistical Power & Sample Size and Standard Error.
Exercise 5.2
Explain, in one clean paragraph, why increasing is the only lever that shrinks both and once is held fixed, while adjusting the cutoff merely trades one for the other.
Recall Solution 5.2
First, clarify the two regimes so we don't conflate them. Regime 1 — fixed cutoff (in raw units): slide the cutoff toward and the tail past it shrinks () while the tail on the wrong side grows (): a pure trade, no free lunch. Regime 2 — fixed (the normal practice): we pin , which pins the cutoff at standard errors from , so is now a constant by construction — the only question left is how big is. Here is the payoff of increasing : because collapses as , both bell curves get narrower and, measured in SE units, pull apart. With the -cutoff held at its fixed -position, the narrower, better-separated curve now hangs almost entirely inside the rejection region, so falls while stays exactly . That is the sense in which shrinks "both": it holds where you set it and drives down — something no cutoff move can do. The Central Limit Theorem guarantees stays normal while its spread collapses, so the whole picture keeps working.
Recall One-line self-check on the whole ladder
Did you (i) fix each tail before computing, (ii) use whenever was estimated, (iii) standardize power under not , (iv) round sample sizes up, and (v) check the normality/CLT assumption before trusting any of it? ::: If yes to all five, you've cleared the classic traps L1–L5.