Here are ten corrected exercises on hypothesis tests for the CEGEP course Probability and Statistics, 201-SN1-RE, in Sciences de la nature, preceded by a list of calculations.They cover the null hypothesis and the alternative hypothesis, one-tailed and two-tailed tests, the significance level, the test statistic, the critical region, the p-value, Type I and Type II errors and power, on the three cases of the course framework: the test on a mean with n≥30, the test on a mean with n<30 using Student's t distribution, and the test on a proportion with n≥30, as well as the link between a test and a confidence interval.
What the set covers, the traps it targets
They cover the null hypothesis and the alternative hypothesis, one-tailed and two-tailed tests, the significance level, the test statistic, the critical region, the p-value, Type I and Type II errors and power, on the three cases of the course framework: the test on a mean with n≥30, the test on a mean with n<30 using Student's t distribution, and the test on a proportion with n≥30, as well as the link between a test and a confidence interval.
Exercise 0.1 lines up eleven direct calculations: z and t statistics, standard error under H0, critical values, p-values and decisions. The situations then come from the natural sciences: the yield under a fertilizer (exercise 2), the phosphorus of a lake (exercise 3), the malformed frogs of one pond and then of twelve ponds (exercises 4 and 10), measuring g in the laboratory (exercises 5 and 7), lead in drinking water against a standard (exercise 6), a catalyst (exercise 8) and the flowering duration of a plant, handled as a complete study (exercise 9).
By the end of the set, you can state H0 and H1 on the parameter (exercise 1), choose between the normal distribution and Student's t distribution, write a decision in context, prove that a two-tailed test and a confidence interval decide in the same way (exercise 5), compute the Type II error risk and the power (exercises 6 and 10), and recover a value of the Student table from an integral (exercise 7). The pitfalls covered: writing the hypotheses about x (exercise 1), discarding an inconvenient measurement (exercise 3), putting p^ instead of p0 in the standard error (exercise 4), comparing with 1.96 with a small sample (exercise 7) or in a one-tailed test (exercise 8), reading the p-value as the probability of H0 (exercise 8), and multiplying tests without counting the false alarms (exercise 10).
The thread of the set: everything is computed UNDER H0, and nothing proves H0. We assume the null hypothesis is true in order to calculate, with μ0 at the centre and p0 in the standard error; only a surprise larger than the level set in advance brings it down, and not rejecting it never proves it. Do each exercise in full before opening the solution.
•HYPOTHESES: about a PARAMETER of the population (μ or p), never about x or p^. H0 carries the equality (μ=μ0); H1 carries what the study wants to establish: μ=μ0 (two-tailed), μ<μ0 or μ>μ0 (one-tailed). The choice is made BEFORE seeing the data.
•TEST STATISTIC, computed under H0: mean with n≥30, z=s/nx−μ0 (normal distribution); mean with n<30 and a normal population, t=s/nx−μ0 (Student with n−1 degrees of freedom); proportion with np0≥5 and n(1−p0)≥5, z=p0(1−p0)/np^−p0.
•CRITICAL REGION at level α: two-tailed, ∣z∣>zα/2 (1.96 at 5%); one-tailed, z>zα or z<−zα (1.645 at 5%, 2.326 at 1%). With Student, the critical value is read with n−1 degrees of freedom.
•THE p-VALUE: the probability, IF H0 is true, of getting a result at least as far from H0 as the one observed, in the direction of H1 (both tails in a two-tailed test). Reject H0 if p≤α.
•ERRORS: Type I, rejecting a true H0, with probability α; Type II, not rejecting a false H0, with probability β, which depends on the true value of the parameter. Power =1−β. For a fixed n, lowering α increases β; increasing n reduces β.
•CONCLUSION: “at the 5% level, the data allow (or do not allow) us to conclude that...”, in the vocabulary of the problem. Never say “we accept H0”. A two-tailed test at level α rejects H0 exactly when μ0 falls outside the confidence interval of level 1−α.
Calculations: test statistics, p-values and decisions
Exercise 0.1: Test statistics, p-values and decisions: eleven direct calculations
12 answers to check
For each line, compute the requested quantity from the summary data, without writing a conclusion. Critical values of the normal distribution: z0.05=1.645, z0.025=1.96, z0.01=2.326, z0.005=2.576, where zα leaves an area α to its right. Normal probabilities are read from the table, with z rounded to two decimals. Statistics to two decimals, p-values to four decimals.
a) H0:μ=50, x=52.4, s=6, n=36: compute the z statistic.
b) H0:μ=12, x=11.1, s=2.7, n=81: compute the z statistic.
c) H0:μ=80, x=83, s=5, n=9, normal population: compute the t statistic and its number of degrees of freedom.
d) H0:p=0.40, 230 successes out of n=500: compute the z statistic.
e) H0:p=0.2, n=400: compute the standard error of P^ under H0.
f) Left-tailed test at the 2.5% significance level: give the critical value of z.
g) Two-tailed test, z=−2.15: compute the p-value.
h) Right-tailed test, z=1.32: compute the p-value.
i) Two-tailed test at the 5% level, z=2.05: give the decision.
j) H0:μ=200 against H1:μ>200, σ=15, n=25, 5% level: compute the bound c of the critical region x>c.
k) Two-tailed test at the 5% level on a mean, normal population, n=15, t=−2.40, and t0.025,14=2.145: give the decision.
Show the solution
Answers
a)z=2.40
b)z=−3.00
c)t=1.80 with 8 degrees of freedom
d)z≈2.74
e)σP^=0.02
f)z=−1.96
g)p≈0.0316
h)p≈0.0934
i)Reject H0
j)c≈204.94
k)Reject H0
a)
n≥30: replace σ by s and use the normal distribution.
z=s/nx−μ0=6/652.4−50=2.40
b)
z=2.7/8111.1−12=0.3−0.9=−3.00
The sign tells on which side of μ0 the sample falls; keep it.
c)
n<30 and normal population: Student's t distribution with n−1=8 degrees of freedom.
t=5/983−80=5/33=1.80
d)
p^=500230=0.46 and, under H0, σP^=5000.40×0.60≈0.02191.
z=0.021910.46−0.40≈2.74
e)
σP^=4000.2×0.8=0.0004=0.02
f)
The whole area α=0.025 is in the left tail: the critical value leaves 2.5% to its left, so it is −z0.025=−1.96.
Pitfall: taking −1.645 because the test is one-tailed. 1.645 corresponds to 5% in one tail, not to 2.5%.
g)
P(Z<−2.15)=1−0.9842=0.0158, and the test is two-tailed:
p=2×0.0158=0.0316
h)
p=P(Z>1.32)=1−0.9066=0.0934
i)
∣z∣=2.05>1.96: z falls in the critical region, so we reject H0 at the 5% level.
j)
We reject when 15/25x−200>1.645, that is, when
x>200+1.645×515=204.935
So c≈204.94.
k)
Student's t distribution with 14 degrees of freedom: we reject when ∣t∣>2.145. Here ∣t∣=2.40>2.145: we reject H0.
Points are earned before the solution; after it, you can keep practising.
For you:
Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.
Part A: the basics (/50)
Exercise 1: Stating H0 and H1: seven studies, seven pairs of hypotheses
23 answers to check
A hypothesis test starts before any calculation: name the parameter of the POPULATION, write the null hypothesis H0, which carries the equality, then the alternative hypothesis H1, the one the study is trying to establish. These seven situations come back throughout the set.
For each of questions a) to g), give the parameter tested, the form of H1 and the reference value, then write H0 and H1.
a) Fertilizer. Without fertilizer, the mean yield of a wheat variety is 3.20 t/ha on the station's plots. An agronomist wants to establish that his fertilizer INCREASES the mean yield.
b) Lead. A municipality declares the water of a network compliant only if the data establish that the mean lead concentration at the tap is BELOW a standard of 8 µg/L (a fictitious standard, set for this set).
c) Phosphorus. A lake association has set a management threshold of 20 µg/L of total phosphorus (a value chosen for the exercise). It wants to know whether the mean concentration this summer EXCEEDS that threshold.
d) Measuring g. A class wants to know whether its pendulum setup gives a biased value of g, in one direction or the other, compared with the reference value 9.81 m/s².
e) Catalyst. Without a catalyst, a reaction lasts 120 s on average under the laboratory's conditions. A chemist wants to establish that a catalyst REDUCES this mean duration.
f) Frogs. In control ponds, 5% of frogs have a limb malformation (a fictitious rate). A biologist suspects a HIGHER rate in a pond next to farm fields.
g) Flowering. Old surveys give a mean flowering duration of 18.0 days for a woodland understory plant. A botanist wants to establish that this duration has DECREASED.
h) For the fertilizer, a student writes “H0:x=3.20 and H1:x>3.20”. Explain his mistake.
i) For the lead, a city councillor proposes H0:μ=8 against H1:μ>8 instead, “so that the water is declared contaminated only if it is proved”. Explain what this choice changes when the sample is small or inconclusive.
Show the solution
Answers
a)H0:μ=3.20; H1:μ>3.20 (right-tailed)
b)H0:μ=8; H1:μ<8 (left-tailed)
c)H0:μ=20; H1:μ>20 (right-tailed)
d)H0:μ=9.81; H1:μ=9.81 (two-tailed)
e)H0:μ=120; H1:μ<120 (left-tailed)
f)H0:p=0.05; H1:p>0.05 (right-tailed)
g)H0:μ=18; H1:μ<18 (left-tailed)
h)The hypotheses are about the parameter μ, never about x, which is known
i)The water would stay in service by default, without its compliance being proved
a)
Parameter μ, the mean yield of all treated plots.
H0:μ=3.20 and H1:μ>3.20.
Right-tailed test, because only an INCREASE in yield interests the agronomist; a decrease would not lead him to adopt the fertilizer either, but that is not what he is trying to establish.
b)
Parameter μ, the mean lead concentration at the tap in the network.
H0:μ=8 and H1:μ<8.
Left-tailed test, because it is compliance that must be PROVED: the water is declared safe only if the data place the mean below the standard.
c)
Parameter μ, the mean total phosphorus concentration of the lake this summer.
H0:μ=20 and H1:μ>20.
Right-tailed test, because the association is only worried about an exceedance: a concentration lower than the threshold calls for no action.
d)
Parameter μ, the mean of all the measurements the setup would give.
H0:μ=9.81 and H1:μ=9.81.
Two-tailed test, because a bias in either direction is a defect of the setup: we do not know in advance on which side it falls.
e)
Parameter μ, the mean reaction time with the catalyst.
H0:μ=120 and H1:μ<120.
Left-tailed test, because the catalyst must REDUCE the duration; a longer duration would not make it useful.
f)
Parameter p, the proportion of malformed frogs in the pond.
H0:p=0.05 and H1:p>0.05.
Right-tailed test, because the suspicion is of a rate higher than that of the control ponds.
g)
Parameter μ, the current mean flowering duration.
H0:μ=18 and H1:μ<18.
Left-tailed test, because the question is a decrease; a longer duration would be a different study.
h)
The hypotheses are about an unknown PARAMETER of the population: here μ, the mean yield of all the plots that would be treated with the fertilizer.
x is a sample statistic: once the harvest is weighed, its value is known, and a hypothesis about it makes no sense.
The correct statement is H0:μ=3.20 and H1:μ>3.20. The equality goes in H0 even if we think “μ≤3.20”: it is the value under which all the calculations are done, the boundary case between the two hypotheses.
Pitfall: writing the claim to be established in H0. A test can only reject H0 or fail to reject it; what we want to establish therefore goes in H1.
i)
A test rejects H0 only if the data are clearly incompatible with it. With H1:μ>8, a small, inconclusive sample leads to not rejecting μ=8: contamination is not proved, and the water stays in service.
The water would therefore be declared acceptable BY DEFAULT, simply for lack of data. With H1:μ<8, it is the reverse: as long as compliance is not established, the water is not declared compliant.
The choice of H1 decides who carries the burden of proof. In public health, it is compliance that must be proved, and exercise 6 puts numbers on the two errors this choice distributes.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 2: Test on a mean with n ≥ 30: does the fertilizer increase the yield?
9 answers to check
We return to the fertilizer of exercise 1 a). Without fertilizer, the mean yield of the variety is μ0=3.20 t/ha. The fertilizer is spread on n=40 plots chosen at random in the station. From the raw data, the mean yield is x=3.38 t/ha and the standard deviation s=0.52 t/ha. We work at the level α=5%; we give z0.05=1.645 and z0.01=2.326.
The histogram below groups the 40 yields into classes.
a) State H0 and H1, naming the parameter.
b) The histogram is clearly skewed. Explain why we can still use the normal distribution for X, and why we are allowed to replace σ by s.
c) Compute the standard error of X and the z statistic.
d) Determine the critical region at the 5% level, first in terms of z, then in terms of the mean yield x.
e) Make the decision and write the conclusion in context.
f) Compute the p-value of the test and check that it leads to the same decision.
g) Redo the decision at the 1% level, computing the new bound of the critical region, and write the conclusion.
Show the solution
Answers
a)H0:μ=3.20; H1:μ>3.20, where μ is the mean yield with fertilizer
b)Central limit theorem (n=40≥30); s estimates σ precisely when n≥30
c)σX≈0.0822 t/ha; z≈2.19
d)z>1.645, that is, x>3.335 t/ha
e)Reject H0: at the 5% level, the data support an increase in the mean yield
f)p≈0.0143<0.05: same decision
g)c≈3.391; do not reject H0 at the 1% level
a)
The parameter is μ, the mean yield of ALL the station's plots that would be treated with the fertilizer.
H0:μ=3.20 t/ha (the fertilizer changes nothing) and H1:μ>3.20 t/ha (it increases the mean yield). Right-tailed test.
b)
The central limit theorem is about the MEAN: for n≥30 independent draws, X is approximately normal with mean μ and standard deviation nσ, whatever the shape of the distribution of yields, provided σ is finite.
The skewness of the histogram describes the DATA; it does not rule anything out for the distribution of X. With n=40, the normal approximation is reasonable, all the more so since the skewness remains moderate.
For the same reason, with n≥30, s estimates σ precisely enough for us to keep the normal distribution: this is the course's convention for a mean with n≥30.
Pitfall: concluding that a test is impossible because the data are not normal. That condition is needed only for n<30 (exercise 3).
c)
σX≈ns=400.52≈0.0822 t/ha
z=s/nx−μ0=0.08223.38−3.20≈2.19
The calculation is done UNDER H0: the distribution of X is centred on μ0=3.20, and it is the gap from this value that we measure in standard errors.
d)
Right-tailed test at the 5% level: we reject H0 when z>1.645.
In terms of yield: 0.0822x−3.20>1.645⟺x>3.20+1.645×0.0822≈3.335 t/ha.
The critical region is set BEFORE looking at x: it depends only on μ0, the standard error and the level.
e)
z≈2.19>1.645, or equivalently x=3.38>3.335: we reject H0.
Conclusion: at the 5% level, the data from the 40 plots allow us to conclude that the fertilizer increases the mean yield of this variety at this station.
The conclusion is about the mean yield and the station studied; it says nothing about another variety or another soil.
f)
p=P(Z>2.19)=1−0.9857=0.0143
If the fertilizer had no effect, a mean yield of at least 3.38 t/ha over 40 plots would appear in only about 1.4% of samples.
p=0.0143<0.05: we reject H0, as in e). The two rules, critical region and p-value, always give the same decision.
g)
At the 1% level, we reject when z>2.326, that is, x>3.20+2.326×0.0822≈3.391 t/ha.
x=3.38<3.391 (or p=0.0143>0.01): we do not reject H0.
Conclusion: at the 1% level, the data do not allow us to conclude that the mean yield has increased.
Pitfall: writing “at the 1% level, the fertilizer has no effect”. Not rejecting H0 does not prove it: the same data show a likely effect, just not clear enough for such a demanding level.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 3: Student's t test, n < 30: does the lake's phosphorus exceed the threshold?
8 answers to check
We return to the lake of exercise 1 c). This summer, the association collected n=10 water samples at points and on dates chosen at random. Total phosphorus concentrations, in µg/L: 22.4,19.6,23.4,21.1,17.2,24.1,20.3,22.7,18.8,21.4.
We assume that the summer concentrations follow a normal distribution. We test H0:μ=20 against H1:μ>20 at the 5% level. Values of Student's t distribution, where tα,ν leaves an area α to its right: t0.10,9=1.383, t0.05,9=1.833, t0.025,9=2.262 and t0.05,8=1.860.
The dot plot below places the ten measurements relative to the threshold.
a) Compute the mean x and the standard deviation s of the sample.
b) Explain why we use Student's t distribution and not the normal distribution, which condition allows it, and how the plot makes it plausible. Give the number of degrees of freedom.
c) Compute the t statistic.
d) Make the decision at the 5% level and write the conclusion.
e) Bracket the p-value of the test using the table values.
f) A member of the association proposes to discard the lowest measurement, 17.2 µg/L, “surely an error”. Recompute t without it, then explain why this second calculation has no right to replace the first one.
Show the solution
Answers
a)x=21.10 µg/L; s≈2.16 µg/L
b)n<30 and σ unknown; population assumed normal; 9 degrees of freedom
c)t≈1.61
d)Do not reject H0: the data do not allow us to conclude that the mean exceeds 20 µg/L
e)0.05<p<0.10
f)t≈2.60, but removing a measurement without an experimental reason invalidates the test
a)
x=10211.0=21.10 µg/L.
s=n−1∑(xi−x)2=942.02≈2.16 µg/L
On the calculator: statistics mode, list of the ten values, and read sx (not σx, which divides by n).
b)
With n=10<30, the central limit theorem no longer guarantees that X is normal, and s, computed on ten values, is an uncertain estimate of σ.
If the population of concentrations is NORMAL, the statistic T=S/nX−μ0 follows exactly a Student's t distribution with n−1=9 degrees of freedom: that is the condition that replaces n≥30.
The plot does not prove normality, but it makes it plausible: a single hump, no strong skewness, no value isolated far from the others.
Pitfall: using z0.05=1.645. The tails of Student's t distribution are heavier; its critical value, 1.833, is larger.
c)
t=s/nx−μ0=2.161/1021.10−20=0.6831.10≈1.61
d)
Right-tailed test, 9 degrees of freedom: we reject H0 if t>1.833.
t≈1.61<1.833: we do not reject H0.
Conclusion: at the 5% level, these ten measurements do not allow us to conclude that the mean phosphorus concentration of the summer exceeds 20 µg/L.
Pitfall: writing “the lake meets the threshold”. The observed mean, 21.10, is above 20; the test only says that this gap may come from the chance of ten samples.
e)
The p-value is the area to the right of t=1.61 under Student's t distribution with 9 degrees of freedom.
1.383<1.61<1.833, so 0.05<p<0.10.
A Student table only gives a bracket; software would give p≈0.071, consistent with the bracket.
f)
Without 17.2: x≈21.53, s≈1.77, n=9, so 8 degrees of freedom and
t=1.772/921.53−20≈2.60>1.860
This second test would reject H0, but it is worthless: the measurement was removed AFTER seeing that it stood in the way of the desired conclusion. The data were chosen to get the result.
A measurement may be discarded only for a documented experimental reason (contaminated bottle, protocol error), decided without looking at the effect on the test. Otherwise, the decision remains that of d).
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 4: Test on a proportion: the malformed frogs of the pond
11 answers to check
We return to the pond of exercise 1 f). In the region's control ponds, the proportion of frogs with a limb malformation is p0=0.05 (a fictitious rate). In a pond next to farm fields, a team catches n=220 frogs at random and finds 19 malformed ones. We test at the 1% level, with z0.01=2.326.
a) State H0 and H1, then compute the observed proportion p^.
b) Check the conditions for the normal approximation.
c) Compute the standard error of P^ under H0, then the z statistic.
d) Make the decision at the 1% level and write the conclusion.
e) Compute the p-value of the test.
f) A student computes the standard error with p^ instead of p0. Compute the statistic he obtains and the decision he makes at the 1% level. Explain why p0 is what must appear in the standard error.
g) In his report, the biologist writes: “the pesticides from the neighbouring fields cause the malformations”. Say what the test establishes, and what it does not establish.
Show the solution
Answers
a)H0:p=0.05; H1:p>0.05; p^=22019≈0.0864
b)np0=11≥5 and n(1−p0)=209≥5; sample drawn at random
c)σP^≈0.0147; z≈2.47
d)Reject H0: at the 1% level, the proportion of malformed frogs exceeds 5% in this pond
e)p≈0.0068
f)z≈1.92: he would not reject H0; yet the calculation is done under H0, hence with p0
g)A proportion above 5% in this pond; not the cause, the study is observational
a)
Parameter: p, the proportion of malformed frogs in the whole pond.
H0:p=0.05 and H1:p>0.05: right-tailed.
p^=22019≈0.0864
b)
np0=220×0.05=11≥5 and n(1−p0)=220×0.95=209≥5: under H0, P^ is approximately normal.
The conditions are checked with p0, the value under which we calculate. The captures must also be random and independent: if the team had caught only the slow frogs, more often malformed, the proportion would be biased, and no calculation would fix it.
c)
σP^=np0(1−p0)=2200.05×0.95≈0.0147
z=σP^p^−p0=0.01470.0864−0.05≈2.47
d)
We reject H0 if z>2.326. Here z≈2.47>2.326: we reject H0.
Conclusion: at the 1% level, the data allow us to conclude that the proportion of malformed frogs in this pond exceeds the 5% rate of the control ponds.
e)
p=P(Z>2.47)=1−0.9932=0.0068
If the pond's rate were 5%, we would find 19 or more malformed frogs out of 220 in only about 0.7% of samples. p<0.01: same decision as in d).
f)
With p^: 2200.0864×0.9136≈0.0189 and z≈0.01890.0364≈1.92<2.326: he would not reject H0.
Yet the whole test reasons UNDER H0: we compute the distribution of P^ assuming p=0.05, and in that world the standard error is 2200.05×0.95. Putting p^ in mixes two hypotheses in the same calculation.
Pitfall: the confidence interval formula, which uses p^ because there is no assumed value. Here the mistake costs the whole conclusion, as the figure shows.
The further p^ is from p0, the more the two standard errors differ, and the more this choice weighs on the decision.
g)
The test establishes only one thing: in this pond, the proportion of malformed frogs exceeds 5%, with a Type I error risk of 1%.
It says nothing about the CAUSE: the study is observational. The pond differs from the control ponds by the neighbouring fields, but perhaps also by its temperature, its parasites (some trematodes cause limb malformations) or its fauna.
To attribute the increase to the pesticides, one would need to measure their concentration in several ponds, or run a controlled laboratory experiment. The report should say “is associated with the proximity of the fields, without the cause being established”.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 5: Two-tailed test and confidence interval: is the measurement of g biased?
11 answers to check
We return to the class of exercise 1 d). Each team measures the period of a pendulum and deduces a value of g from g=T24π2L. Over n=50 measurements, the mean is x=9.774 m/s² and the standard deviation s=0.092 m/s². The laboratory's reference value is g0=9.81 m/s².
We give z0.025=1.96 and z0.005=2.576.
a) State H0 and H1, and justify the choice of a two-tailed test.
b) Compute the standard error and the z statistic, then make the decision at the 5% level.
c) Compute the p-value of the test.
d) Build the 95% confidence interval for μ, to three decimals. Does it contain 9.81?
e) Prove that, for a two-tailed test at level α, we reject H0:μ=μ0 if and only if μ0 does not belong to the confidence interval of level 1−α built with the same standard error.
f) Without redoing the test, deduce the decision at the 1% level from the 99% confidence interval.
g) Write the conclusion for the class, and choose a physical cause consistent with the direction of the gap.
Show the solution
Answers
a)H0:μ=9.81; H1:μ=9.81 (a bias in either direction is a defect)
b)σX≈0.0130 m/s²; z≈−2.77; reject H0
c)p≈0.0056
d)[9.748,9.800] m/s²; it does not contain 9.81
e)∣z∣>zα/2⟺∣x−μ0∣>zα/2σX⟺μ0∈/[x±zα/2σX]
f)[9.740,9.808] does not contain 9.81: reject H0 at the 1% level
g)The setup gives values of g that are too low on average; large amplitude of the oscillations
a)
Parameter: μ, the mean of all the values of g this setup would give. H0:μ=9.81 m/s² (no bias) and H1:μ=9.81 m/s².
Two-tailed: we are looking for a defect of the setup, and we do not know in advance whether it overestimates or underestimates g. The choice is made BEFORE seeing that x<9.81.
b)
n=50≥30: σX≈500.092≈0.0130 m/s².
z=0.01309.774−9.81≈−2.77
Two-tailed at the 5% level: we reject if ∣z∣>1.96. Here ∣z∣≈2.77>1.96: we reject H0.
c)
p=2×P(Z<−2.77)=2×(1−0.9972)=2×0.0028=0.0056
If the setup had no bias, a mean of 50 measurements at least as far from 9.81, on one side or the other, would appear in only about 0.56% of cases.
d)
x±1.96σX=9.774±1.96×0.01301=9.774±0.0255
The interval is [9.748,9.800] m/s²: it does not contain 9.81, which gives the same decision as in b).
e)
Let e=σX be the standard error, the same in the test and in the interval. The two-tailed test rejects H0 if and only if
ex−μ0>zα/2⟺∣x−μ0∣>zα/2e
⟺μ0<x−zα/2eorμ0>x+zα/2e
⟺μ0∈/[x−zα/2e,x+zα/2e]
That is exactly the confidence interval of level 1−α. Each step is an equivalence, so the two rules always give the same decision.
Two conditions hold this equivalence: a TWO-TAILED test, and the same standard error on both sides. For a proportion, the test uses p0 and the interval uses p^ (exercise 4): the equivalence is then only approximate.
f)
x±2.576×0.01301=9.774±0.0335, that is, [9.740,9.808] m/s².
9.81>9.808: the reference value lies outside the 99% interval, so we reject H0 at the 1% level, with no other calculation. This is consistent with p=0.0056<0.01.
The margin is thin: 9.81 is only 0.002 m/s² from the bound. Rounding the standard error too early to 0.013 would be enough to blur the reading.
g)
Conclusion: at the 1% level, the data from the 50 measurements allow us to conclude that the setup gives, on average, a value of g different from 9.81 m/s², and lower.
g=T24π2L underestimates g if T is too large. The formula is valid only for small oscillations: at large amplitude, the real period lengthens, which lowers g in every measurement, in the same direction.
A random timing error spreads the measurements without shifting them all to the same side: it increases s, not the mean gap. Measuring L to the centre of the mass is the correct practice.
Pitfall: concluding that g equals 9.774 m/s² in the laboratory. The test judges the SETUP, not the value of g.
Points are earned before the solution; after it, you can keep practising.
For you:
Part B: problems and reasoning (/50)
Exercise 6: The two errors of a test: lead in drinking water
10 answers to check
We return to the water network of exercise 1 b), with the fictitious standard of 8 µg/L. The laboratory collects n=40 tap samples, chosen at random in the network. Its years of monitoring allow the standard deviation of the concentrations to be treated as known: σ=2.4 µg/L. The municipality tests H0:μ=8 against H1:μ<8 at the 5% level, and declares the water compliant only if it rejects H0. We give z0.05=1.645 and z0.01=2.326.
The figure below shows the distribution of X if μ=8 (null hypothesis) and if μ=7 (water that is clearly compliant).
a) Describe, in this context, the Type I error and the Type II error. Say which one this choice of H1 makes rare, and why.
b) Determine the critical region in terms of mean concentration: x<c.
c) Prove that, if μ=8, the probability of rejecting H0 is 0.05, in the normal model of X.
d) The true mean of the network is in fact μ=7 µg/L. Compute the Type II error risk β and the power of the test.
e) The laboratory doubles its effort: n=80 samples, same level. Compute the new bound c and the new β for μ=7.
f) Back to n=40, but at the 1% level. Compute β for μ=7, then say what must be done to reduce both risks at once.
g) The 40 samples give x=7.45 µg/L. Compute z, make the decision and write the municipality's conclusion.
Show the solution
Answers
a)Type I: declaring compliant water that is not (a health risk, controlled at 5%); Type II: declaring compliant water non-compliant
b)x<7.376 µg/L
c)P(X<c)=P(Z<−1.645)=0.05 when μ=8
d)β≈0.161; power ≈0.839
e)c≈7.559; β≈0.019
f)β≈0.378; increase n
g)z≈−1.45; do not reject H0: the water cannot be declared compliant
a)
TYPE I error: rejecting H0 when it is true, that is, declaring the water compliant when its mean concentration reaches the standard. It is a health risk.
TYPE II error: not rejecting H0 when H1 is true, that is, refusing to declare compliant water that is. It costs new analyses or needless work.
The level α=5% bounds the first one, the more serious: with H1:μ<8, it is compliance that must be proved, and the error we control is the one that would expose the population.
b)
Standard error: σX=402.4≈0.3795 µg/L.
Left-tailed: we reject if 0.3795x−8<−1.645, that is,
x<8−1.645×0.3795≈7.376 µg/L
c)
If μ=8, X is approximately normal with mean 8 and standard deviation σX (n=40≥30). Then Z=σXX−8 follows the standard normal distribution.
The bound c was built for this: the level α IS the probability of rejecting H0 when it is true, up to the rounding of the table, whatever the values of σ and n.
d)
If μ=7, X is centred on 7 with the same standard error. We do not reject H0 when x≥7.376:
The power is 1−β≈0.839: water at 7 µg/L on average is declared compliant in only about 84% of campaigns of 40 samples. It is the blue area in the solution's figure.
Pitfall: believing that β=1−α=0.95. β depends on the true value of μ, which the test does not know; α and β are not computed under the same distribution.
e)
σX=802.4≈0.2683 and c=8−1.645×0.2683≈7.559 µg/L.
β=P(Z≥0.26837.559−7)=P(Z≥2.08)=1−0.9812=0.0188
Doubling n divides the standard error by 2: the two curves narrow, overlap much less, and β goes from about 16% to about 2%, with α unchanged.
f)
c=8−2.326×0.3795≈7.117 µg/L, and
β=P(Z≥0.37957.117−7)=P(Z≥0.31)=1−0.6217=0.3783
For a fixed n, lowering α moves the bound c to the left: we reject less often, so we miss compliant water more often. β goes from 0.161 to 0.378.
Only an increase in n reduces both risks at once, as in e). A two-tailed test, for its part, would make the test LESS powerful against μ<8.
g)
z=0.37957.45−8≈−1.45>−1.645: z is not in the critical region, so we do not reject H0.
Conclusion: at the 5% level, the data do not establish that the mean concentration is below the standard; the water therefore cannot be declared compliant on the basis of this campaign.
Pitfall: writing “the water is contaminated”. The observed mean is below 8; it is simply not far enough from it to rule out chance. A campaign of 80 samples, more powerful, could settle the question.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 7: Student's t with 2 degrees of freedom: the table value proved by the integral
9 answers to check
A team measures g by filming the free fall of a ball, and only has time for three trials: 9.52, 9.77 and 9.64 m/s². We assume the measurements come from a normal distribution, and we test H0:μ=9.81 against H1:μ=9.81 at the 5% level.
With n=3, the statistic T=S/3X−μ0 follows, under H0, a Student's t distribution with 2 degrees of freedom, whose density is f(t)=(2+t2)−3/2 for every real t. The figure compares this density with that of the standard normal distribution.
a) Show that F(t)=21+22+t2t satisfies F′(t)=f(t), then compute its limits at −∞ and at +∞. Conclude that f is a probability density function and that F is its cumulative distribution function.
b) Deduce the critical value t0.025,2, such that P(T>t0.025,2)=0.025, by solving F(t)=0.975. Compute t0.05,2 in the same way.
c) Compute x, s and the t statistic.
d) Make the decision at the 5% level and write the conclusion.
e) A classmate compares ∣t∣ with 1.96, “as usual”, and rejects H0. Compute the true Type I error risk of his rule, P(∣T∣>1.96).
f) Show that the p-value of the test is 1−2+t2∣t∣, then compute it.
g) In exercise 5, fifty measurements detected a gap of 0.036 m/s². Here the observed gap is 0.17 m/s², and the test does not conclude. Explain.
For large ∣t∣, 2+t2=∣t∣1+2/t2, so u(t)→−1 at −∞ and u(t)→1 at +∞. Hence lim−∞F=0 and lim+∞F=1.
f(t)>0 and ∫−∞+∞f(t)dt=lim+∞F−lim−∞F=1: f is a density. Since F′=f and F→0 at −∞, F(x)=∫−∞xf(t)dt=P(T≤x): it is the cumulative distribution function.
b)
F(t)=0.975⟺2+t2t=0.95, with t>0. Squaring:
t2=0.9025(2+t2)⟺t2=0.09752×0.9025≈18.513
t0.025,2≈4.303, exactly the table value. Likewise, F(t)=0.95 gives 2+t2t=0.9, t2=0.192×0.81 and t0.05,2≈2.920.
The Student table is therefore not a black box: each of its values is a bound of an integral of the density.
c)
x=39.52+9.77+9.64≈9.643 m/s²
s=2(−0.1233)2+0.12672+(−0.0033)2≈0.125 m/s²
t=0.125/39.643−9.81≈0.0722−0.1667≈−2.31
d)
Two-tailed with 2 degrees of freedom: we reject if ∣t∣>4.303. Here ∣t∣≈2.31<4.303: we do not reject H0.
Conclusion: at the 5% level, these three trials do not allow us to conclude that the filmed fall gives a biased value of g.
e)
By symmetry of f, P(∣T∣>1.96)=2(1−F(1.96))=1−2+1.9621.96≈1−0.8109=0.189
The rule “∣t∣>1.96” announces a risk of 5% but takes nearly 19%: with two degrees of freedom, Student's tails are much heavier than those of the normal distribution (red area in the solution's figure).
Pitfall: using the normal distribution with a small sample. The classmate's rejection is not a discovery, it is the effect of the wrong table.
With ∣t∣≈2.309: p≈1−7.3312.309≈1−0.853=0.147>0.05, same decision as in d).
g)
In exercise 5, the standard error was 0.013 m/s² and the critical value 1.96. Here, s/3≈0.072 m/s² and the critical value is 4.303: the gap must exceed about 4.303×0.072≈0.31 m/s² to be detected.
A real bias of 0.17 m/s² would therefore usually go unnoticed: the Type II error risk is large, the power low.
Not rejecting H0 does not prove that the filmed fall is accurate; it says that three trials are not enough to decide. To conclude, more trials are needed, which exercise 6 quantifies with β.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 8: Five claims to correct
9 answers to check
We return to the catalyst of exercise 1 e). Without a catalyst, the reaction lasts μ0=120 s on average. The chemist tests H0:μ=120 against H1:μ<120 at the 5% level, on n=36 trials with the catalyst; the standard deviation of the durations is about s=18 s, so the standard error is 3 s.
Each of the following five claims, heard in the laboratory, is false. For each one, choose the correct statement, do the requested calculation and explain the mistake.
a) “The test gives a p-value of 0.03: so there is a 3% chance that the catalyst has no effect.”
b) “With x=116 s, the test does not reject H0: so the catalyst has no effect at all.” Compute z.
c) “The test is at the 5% level, so we reject H0 as soon as ∣z∣>1.96.” Compute z for x=114.6 s and make the correct decision.
d) “At the 5% level, when we reject H0, we have a 5% chance of being wrong.” The laboratory estimates that 10% of the catalysts it tries are effective, and that the test detects an effective catalyst with a power of 0.80. Compute the probability that a catalyst declared effective is not.
e) “Increasing the number of trials decreases the Type I error risk.” For a catalyst whose true mean is 112 s, compute β with 36 trials, then with 100 trials (standard error 1.8 s).
Show the solution
Answers
a)The p-value is computed IF H0 is true; it is not the probability of H0
b)z≈−1.33: no evidence of an effect at the 5% level, which is not evidence of no effect
c)z=−1.80<−1.645: reject H0 (the rule ∣z∣>1.96 belongs to the two-tailed test)
d)P(no effect∣reject)=0.36, not 0.05
e)β≈0.154 then β≈0.003: n lowers β, α stays at 5%
a)
The p-value is computed ASSUMING H0 is true: it is P(a gap at least this large∣H0).
Correction: “if the catalyst had no effect, a mean duration this short or shorter would appear in only 3% of series of 36 trials”.
The probability that H0 is true given the data is a different quantity, P(H0∣data), which the test does not compute; question d) shows how different it can be.
b)
z=3116−120≈−1.33>−1.645: we do not reject H0.
Correction: “at the 5% level, the data do not allow us to conclude that the catalyst reduces the mean duration”.
A mean duration of 116 s is compatible with a catalyst that has no effect, but also with a catalyst that saves a few seconds: absence of evidence is not evidence of absence.
c)
z=3114.6−120=−1.80
The test is ONE-TAILED, to the left: the whole area α=0.05 is in the left tail, and we reject if z<−1.645. Here −1.80<−1.645: we reject H0.
The rule ∣z∣>1.96 belongs to the two-tailed test, which splits α between two tails. Here it would have led to not rejecting: the mistake changes the conclusion.
d)
Let E be “the catalyst is effective” and R “the test rejects H0”. P(E)=0.10, P(R∣E)=0.80 (power), P(R∣E)=0.05 (level).
More than one “effective” catalyst in three is not. The level α=P(R∣E) is not P(E∣R): this is Bayes' theorem again, and the confusion between a conditional probability and its reverse.
Correction: “when H0 is true, we reject it in 5% of cases”.
e)
With 36 trials, we reject if x<120−1.645×3=115.065. If μ=112:
β=P(Z≥3115.065−112)=P(Z≥1.02)=1−0.8461≈0.154
With 100 trials, c=120−1.645×1.8=117.039 and β=P(Z≥1.8117.039−112)=P(Z≥2.80)=1−0.9974≈0.003.
Correction: “increasing n decreases the Type II error risk β; the Type I error risk stays equal to the chosen level, 5%”. α is set by the experimenter, not by the sample size.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 9: Problem: a complete study, has the flowering period become shorter?
9 answers to check
We return to the understory plant of exercise 1 g), a trillium in a sugar maple stand. Old surveys (fictitious values) give a mean flowering duration of 18.0 days per plant. This spring, a botanist follows n=14 plants chosen at random in the population and records the flowering duration of each, in days: 15,18,14,19,17,20,13,17,16,15,18,16,17,19.
She wants to know whether the mean flowering duration has decreased, at the 5% level. Student values with 13 degrees of freedom: t0.05,13=1.771, t0.025,13=2.160, t0.01,13=2.650. The dot plot below shows the data.
a) Compute the mean x and the standard deviation s of the sample.
b) Choose the distribution of the test statistic. Justify this choice and say what the plot allows you to check.
c) State H0 and H1, then compute the t statistic.
d) Make the decision at the 5% level.
e) Bracket the p-value using the table values.
f) Compute the 95% upper confidence bound, x+t0.05,13ns, and show that it leads to the same decision.
g) Write the conclusion of the study in three sentences: the result, its scope, its limits. Does the test allow the decrease to be attributed to climate warming?
Show the solution
Answers
a)x≈16.71 days; s≈2.02 days
b)Student with 13 degrees of freedom: n<30, σ unknown, population assumed normal; the plot shows neither strong skewness nor an outlier
c)H0:μ=18; H1:μ<18; t≈−2.39
d)Reject H0: t<−1.771
e)0.01<p<0.025
f)17.67<18: the reference value is excluded, same decision
g)Mean duration shorter than 18 days in this population this spring; a single year, cause not established: no
a)
x=14234≈16.71 days.
s=13∑(xi−x)2=1352.857≈2.02 days
b)
n=14<30 and σ is unknown: if the flowering durations follow a normal distribution in the population, T=S/nX−μ0 follows a Student's t distribution with 13 degrees of freedom.
Normality cannot be proved with 14 values, but the plot makes it plausible: a single hump centred around 16 or 17 days, a range from 13 to 20 days, no marked skewness, no isolated value.
A duration counted in whole days is a discrete variable; the normal distribution is a model of it, reasonable when it takes many values.
c)
μ: current mean flowering duration of the population. H0:μ=18 and H1:μ<18, left-tailed.
t=2.016/1416.714−18=0.539−1.286≈−2.39
d)
We reject H0 if t<−1.771. Here t≈−2.39<−1.771: we reject H0 at the 5% level.
e)
The p-value is the area to the left of −2.39, equal by symmetry to the area to the right of 2.39.
2.160<2.39<2.650, so 0.01<p<0.025: we would also reject at the 2.5% level, but not at the 1% level.
f)
16.714+1.771×142.016≈16.714+0.954≈17.67 days.
With 95% confidence, the current mean duration is below 17.67 days. The value 18 is above this bound, so it is excluded: we reject H0, as in d).
This is the same equivalence as in exercise 5, in its one-sided version: a one-tailed test at the 5% level corresponds to a ONE-SIDED 95% confidence bound, not to the two-sided 95% interval.
g)
Result: at the 5% level, the data allow us to conclude that the mean flowering duration of this population, this spring, is below the 18 days of the old surveys; it is estimated at 16.7 days (0.01<p<0.025).
Scope: the conclusion holds for this maple stand and this spring, provided the 14 plants were indeed chosen at random.
Limits: a single season was observed, and the old reference may have been measured differently. The test compares two means, it points to no cause: heat, drought, shading or grazing can shorten a flowering period.
Pitfall: writing “climate warming has shortened the flowering period”. Attributing a cause requires series over several years, with the temperature measured, and a study designed for that purpose.
Points are earned before the solution; after it, you can keep practising.
For you:
Exercise 10: Problem: monitoring twelve ponds, false alarms and power
11 answers to check
After the study of exercise 4, a regional program monitors 12 ponds every year. In each one, n=150 frogs caught at random are examined, and we test H0:p=0.05 against H1:p>0.05, as in exercise 4, with the normal approximation (np0=7.5≥5) without continuity correction.
The chart below gives the number of malformed frogs found this year in each pond. We give z0.05=1.645 and z0.10=1.282.
a) At the 5% level per pond, determine the smallest number k of malformed frogs out of 150 that leads to rejecting H0. How many ponds are flagged this year?
b) Suppose the 12 ponds are all healthy (p=0.05) and the tests are independent, each with a Type I error risk of 5%. Let N be the number of false alarms. Give the distribution of N, then compute P(N≥1) and E(N).
c) What level a should be used in each pond so that the probability of at least one false alarm among the twelve is 5%? This level corresponds to za≈2.63: compute the new minimum number k′ and say how many ponds remain flagged.
d) At the 5% level per pond, compute the power of the test against a pond where p=0.10.
e) Show that, to detect p1=0.10 with a power of 0.90 at the 5% level, we need n≥p1−p0z0.05p0(1−p0)+z0.10p1(1−p1), then compute the smallest n.
f) Write the program's recommendation for pond 7.
Show the solution
Answers
a)k=12; two ponds flagged, numbers 7 and 11
b)N∼B(12,0.05); P(N≥1)=1−0.9512≈0.460; E(N)=0.6
c)a=1−0.951/12≈0.00427; k′=15; only pond 7 remains flagged
d)Power ≈0.802
e)n≥14.86, that is, n≥221
f)Pond 7: 16 malformed out of 150, signal maintained even with the corrected level; investigation recommended
a)
σP^=1500.05×0.95≈0.01780. We reject if p^>0.05+1.645×0.01780≈0.07927.
As a count: 150×0.07927≈11.89, so at least k=12 malformed frogs are needed.
On the chart, two ponds reach 12: pond 7 (16) and pond 11 (12). Pond 4, with 11, is not flagged.
b)
Each healthy pond triggers a false alarm with probability 0.05, independently of the others: N follows the binomial distribution with parameters 12 and 0.05.
P(N≥1)=1−P(N=0)=1−0.9512≈1−0.540=0.460
E(N)=12×0.05=0.6
Even if all the ponds were healthy, the program would flag at least one pond almost one year in two. Each test has a 5% risk; a family of twelve tests has a much larger one.
c)
We want 1−(1−a)12=0.05, that is, (1−a)12=0.95:
a=1−0.951/12≈0.00427
With za≈2.63: p^>0.05+2.63×0.01780≈0.0968, that is, more than 150×0.0968≈14.52 malformed frogs: k′=15.
Only pond 7 (16≥15) remains flagged. The signal of pond 11 is consistent with one false alarm among twelve tests.
This sharing of the risk among several tests goes beyond the minimum of the course framework; it requires only the binomial distribution and independence.
d)
If p=0.10, P^ is approximately normal with mean 0.10 and standard deviation 1500.10×0.90≈0.02449.
Power =P(P^>0.07927)=P(Z>0.024490.07927−0.10)=P(Z>−0.85)=0.8023
A pond whose rate has doubled escapes the program about one year in five: β≈0.20.
Pitfall: computing the power with the standard error of H0. Under the alternative, P^ spreads around p1, with p1(1−p1)/n.
e)
We reject if p^>c, with c=p0+z0.05np0(1−p0) (the level fixes α).
The power is 0.90 or more if P(P^>c)≥0.90 when p=p1, that is, if c≤p1−z0.10np1(1−p1).
Substitute c and multiply by n>0: n(p1−p0)≥z0.05p0(1−p0)+z0.10p1(1−p1), hence the stated inequality.
n≥0.051.645×0.2179+1.282×0.3≈0.050.7431≈14.86
n≥220.9: at least 221 frogs must be examined per pond.
f)
Pond 7 has 16 malformed frogs out of 150, that is, p^≈0.107 and z=0.01780.1067−0.05≈3.18: it exceeds the corrected threshold 2.63.
Recommendation: its signal cannot reasonably be explained by the number of tests; an investigation of this pond is justified (water, sediments, parasites), with 221 captures next year for a powerful enough test.
Pond 11 will simply be monitored: an isolated signal among twelve tests is expected one year in two. As in exercise 4, none of these tests identifies the cause of the malformations.
Points are earned before the solution; after it, you can keep practising.
Something missing from this set?A type of exercise your teacher gives, a problem you are stuck on, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
This chapter comes back in
The chapters that build on it, later in the year or in the years that follow.
Looking for a probability and statistics tutor in Montreal?
Get in touch for a first session. A hypothesis test is marked first on the method: the hypotheses on the right parameter, the right distribution, the decision and a conclusion written in context. That is where most of the exam's marks are won or lost.