3.6 Practice Problems

Problem 3.1. A machine should be set to produce bags of sugar whose weights are normally distributed with mean \(1000\) g and standard deviation \(5\) g. To check the setting, a sample of nine bags is taken and the mean is found to be \(1003\) g.

(a).
Is the machine correctly set? (Assume the standard deviation cannot change.)
(b).
Is the machine set too high?

Show solution

Solution. Note first that \(\sigma = 5\) is known and cannot change, so the test statistic is \(Z\) – not \(t\), despite \(n = 9\) being small. The population is stated to be normal, which is what a small sample requires. \[Z=\frac {\overline {X}-\mu _0}{\sigma /\sqrt {n}} =\frac {1003-1000}{5/\sqrt {9}}=\frac {3}{5/3}=1.80.\]

(a). “Correctly set” means neither too high nor too low, so this is two-tailed: \[H_0:\mu =1000 \qquad \text {against}\qquad H_1:\mu \neq 1000.\] At \(\alpha =0.05\) the critical values are \(\pm 1.96\). Since \(|1.80|<1.96\) we fail to reject \(H_0\). Equivalently, the \(P\)-value is \(2\times P(Z>1.80)=0.072\), which exceeds \(0.05\). There is no evidence that the machine is incorrectly set.

(b). “Set too high” names a direction, so this is one-tailed: \[H_0:\mu =1000 \qquad \text {against}\qquad H_1:\mu >1000.\] The critical value is now \(Z_{0.05}=1.645\), and \(1.80>1.645\), so we reject \(H_0\). The \(P\)-value is \(P(Z>1.80)=0.036\), below \(0.05\).

The two parts use the same data and reach opposite conclusions, and that is the point of the question. A one-tailed test puts the whole of \(\alpha \) into one tail, so it is more willing to reject in that direction – \(1.645\) against \(1.96\). The price is that it cannot detect a departure the other way at all: had the mean come out at \(997\), part (b) would have found nothing whatever.

This is why the alternative hypothesis must be chosen before seeing the data. Picking the one-tailed version after noticing the mean came out high is not a stronger test; it is a way of manufacturing significance.

Problem 3.2. The times taken by a salesman to travel between two shops on 50 occasions averaged 64 minutes with a standard deviation of \(6.3\) minutes. He claims that this is evidence that the journey takes longer since he changed to a smaller car, as before he averaged 60 minutes. Do you agree with the salesman?

Show solution

Solution. Here \(\sigma \) is unknown, but \(n=50\) is large, so \(Z\) serves. Testing \(H_0:\mu =60\) against \(H_1:\mu >60\): \[Z=\frac {64-60}{6.3/\sqrt {50}}=\frac {4}{0.891}=4.49.\] This is far beyond \(1.645\); the \(P\)-value is about \(0.0000036\). The journey time has certainly increased.

But that is not what the salesman claimed. He claimed the journey takes longer because he changed to a smaller car. The test establishes that the times are longer; it says nothing whatever about the cause. These are observational data, not an experiment: the car was not assigned at random, and nothing was held constant. Traffic may have grown heavier, the route may have changed, roadworks may have appeared, he may be older or busier.

So: agree that the journey now takes significantly longer. Do not agree that the car is the reason. A statistical test can tell you that something changed; only a controlled comparison can tell you what changed it.

Problem 3.3. A manufacturer claims that his light bulbs have an average lifetime of \(1500\) hours. A purchaser checks this and finds that six bulbs last \[1472,\quad 1486,\quad 1401,\quad 1350,\quad 1610,\quad 1590 \text { hours}.\] Does this evidence support the manufacturer’s claim?

Show solution

Solution. With \(n=6\) and \(\sigma \) unknown, this calls for \(t\) with \(n-1=5\) degrees of freedom. \[\overline {X}=\frac {8909}{6}=1484.83, \qquad \hat {S}=102.08.\] Testing \(H_0:\mu =1500\) against \(H_1:\mu \neq 1500\): \[t=\frac {1484.83-1500}{102.08/\sqrt {6}}=\frac {-15.17}{41.67}=-0.364.\] The critical value is \(t_{5,\,0.025}=2.571\), and \(|-0.364|\) is nowhere near it. The \(P\)-value is \(0.73\). We fail to reject \(H_0\): the evidence is consistent with the claim.

Consider why it is consistent. The sample mean is 15 hours below the claim, but the bulbs themselves range from 1350 to 1610 – a standard deviation of over 100 hours. Against that much variation, and with only six observations, a shortfall of 15 hours is nothing.

Note what this does not say. It does not show the claim is true. With six bulbs the test would also have failed to detect a genuine mean of 1450, or 1550. The purchaser has not confirmed the manufacturer’s figure; they have merely failed to contradict it, which is a much weaker thing and would take a far larger sample to improve.

Problem 3.4. A firm employs 300 women and 100 men. The mean number of days absent last year for the women was \(5.3\) with a standard deviation of \(2.2\); for the men the figures were \(6.2\) and \(2.9\). Is the difference between the means significant?

Show solution

Solution. Two independent samples, both large, so \(Z\) applies. Testing \(H_0:\mu _M=\mu _W\) against \(H_1:\mu _M\neq \mu _W\), the standard error of the difference is \[SE=\sqrt {\frac {s_M^2}{n_M}+\frac {s_W^2}{n_W}} =\sqrt {\frac {2.9^2}{100}+\frac {2.2^2}{300}}=\sqrt {0.0841+0.0161}=0.317,\] and \[Z=\frac {6.2-5.3}{0.317}=2.84.\] Since \(|2.84|>1.96\) we reject \(H_0\) at the \(5\%\) level; the \(P\)-value is \(0.0045\). The difference is statistically significant.

Whether it matters is a separate question. The difference is \(0.9\) of a day per year. Whether that is worth acting on is a judgement about the firm, not a statistical one – and with 400 employees the study is large enough to detect differences far too small to be of any practical use. Significance and importance are not the same thing.

Problem 3.5. A market gardener tests a new pesticide, which the manufacturers claim increases yields, by applying it to one of his two orchards. The treated orchard contains twenty trees, with mean yield \(98\) kg and standard deviation \(10\) kg. The untreated orchard contains fifteen trees, with corresponding values \(94\) kg and \(8\) kg. Test whether these results are consistent with the yields being drawn from the same population.

Show solution

Solution. Both samples are small and \(\sigma \) is unknown, so this is a pooled two-sample \(t\)-test. The variances are close enough to pool – \(\tfrac {100}{64}=1.56\), comfortably inside the \(\tfrac 12\) to \(2\) guideline: \[S_p^2=\frac {(n_1-1)\hat {S}_1^2+(n_2-1)\hat {S}_2^2}{n_1+n_2-2} =\frac {19(100)+14(64)}{33}=\frac {2796}{33}=84.73, \qquad S_p=9.20.\] \[SE=S_p\sqrt {\frac {1}{20}+\frac {1}{15}}=9.20\times 0.342=3.14, \qquad t=\frac {98-94}{3.14}=1.27\] with \(n_1+n_2-2=33\) degrees of freedom. The critical value is \(t_{33,\,0.025}=2.035\), and the \(P\)-value is \(0.21\). We fail to reject \(H_0\): the results are consistent with both orchards being drawn from the same population.

Two remarks. First, the treated orchard did yield \(4\) kg more on average – but with trees varying by \(8\) to \(10\) kg about their own means, a gap that size is unremarkable. The pesticide has not been shown to work.

Second, and more seriously, the experiment cannot answer the question even in principle. One whole orchard was treated and the other was not, so “pesticide” is completely confounded with “orchard” – with its soil, drainage, aspect, age of trees and everything else. Had the difference been significant, we still could not have attributed it to the pesticide. A sound design would assign treatment to individual trees at random within both orchards, which is exactly what the next chapter’s randomised block design sets out to do.

Problem 3.6. The table gives the times taken, in minutes, by eight typists to type the same number of words on two different typewriters. Do the data indicate any difference in speed between the two machines?

Typist A B C D E F G H
\(X\) — Typewriter 1 6.3 4.5 7.1 8.4 3.7 3.9 4.7 5.2
\(Y\) — Typewriter 2 5.1 4.4 6.2 7.3 4.5 4.0 3.6 5.1

Show solution

Solution. The first decision matters more than the arithmetic: the same eight typists used both machines, so the two rows are not independent samples. They are eight pairs, and the test must be applied to the differences.

Typist A B C D E F G H
\(d=X-Y\) 1.2 0.1 0.9 1.1 \(-0.8\) \(-0.1\) 1.1 0.1
Table 30: Differences in typing time, machine 1 minus machine 2.

1.
\(H_0:\ \mu _d=0\) (no difference between the machines); \(H_1:\ \mu _d\neq 0\).
2.
\(\alpha =5\%\), two-tailed.
3.
From the differences, \(\overline {d}=0.45\) and \(\widehat {S}_d=0.729\), so \[t=\frac {\overline {d}}{\widehat {S}_d/\sqrt {n}}=\frac {0.45}{0.729/\sqrt {8}}=\frac {0.45}{0.2577}=1.75\] on \(n-1=7\) degrees of freedom.
4.
Critical region: \(t_{7,\,0.025}=2.365\), so reject if \(|t|>2.365\).
5.
\(1.75<2.365\), so we fail to reject \(H_0\). There is no evidence of a difference in speed between the two typewriters.

Why the pairing matters. The typists differ enormously among themselves — D takes over twice as long as E — and that variation has nothing to do with the machines. Pairing removes it: only the eight differences are used, and the typist-to-typist spread cancels. Had the data been treated as two independent samples of eight, the test statistic would have been \(t=0.62\) rather than \(1.75\), because the between-typist variation would have been left in the error term, swamping the effect being looked for.

Problem 3.7. Nationally the success rate for people taking their driving test for the first time is \(40\%\). A driving instructor claims his record is superior because, of his \(50\) pupils who took the test for the first time last year, \(25\) passed. Is his claim justified?

Show solution

Solution.

1.
\(H_0:\ P=0.40\) (the instructor’s pupils are no different from the national rate); \(H_1:\ P>0.40\). The claim is that he is better, so the test is one-tailed.
2.
\(\alpha =5\%\).
3.
\(\hat {P}=\frac {25}{50}=0.5\). Under \(H_0\) the standard error uses the hypothesised \(P\), not the observed one: \[\text {S.E}=\sqrt {\frac {P_0(1-P_0)}{n}}=\sqrt {\frac {0.4(0.6)}{50}}=0.0693\] \[Z=\frac {0.5-0.4}{0.0693}=1.44.\]
4.
Critical region: \(z_{0.05}=1.645\), so reject if \(Z>1.645\).
5.
\(1.44<1.645\), so we fail to reject \(H_0\). His claim is not justified at the \(5\%\) level.

A pass rate of \(50\%\) against a national \(40\%\) looks convincing until the sample size is taken into account. With only \(50\) pupils, a run of that size happens about \(7\) times in \(100\) by chance alone even for an average instructor. Note also that the standard error is computed from \(P_0=0.4\) and not from \(\hat {P}=0.5\): the test asks how surprising the data are if \(H_0\) is true, so every quantity in it is computed under \(H_0\).

Problem 3.8. In a random sample of \(500\) people in Lusaka, \(270\) are men of whom \(160\) are smokers, and \(230\) are women of whom \(110\) are smokers. Is there evidence that the men of Lusaka are more likely to smoke than the women?

Show solution

Solution.

1.
\(H_0:\ P_1=P_2\) (men and women are equally likely to smoke); \(H_1:\ P_1>P_2\), one-tailed.
2.
\(\alpha =5\%\).
3.
\(\hat {P}_1=\frac {160}{270}=0.593\) and \(\hat {P}_2=\frac {110}{230}=0.478\). Under \(H_0\) the two proportions are equal, so the best estimate of that common value pools both samples: \[\hat {P}=\frac {160+110}{270+230}=\frac {270}{500}=0.540\] \[\text {S.E}=\sqrt {\hat {P}(1-\hat {P})\left (\frac {1}{n_1}+\frac {1}{n_2}\right )} =\sqrt {0.540(0.460)\left (\frac {1}{270}+\frac {1}{230}\right )}=0.0447\] \[Z=\frac {0.593-0.478}{0.0447}=2.56.\]
4.
Critical region: \(z_{0.05}=1.645\).
5.
\(2.56>1.645\), so we reject \(H_0\). There is evidence, at the \(5\%\) level, that men in Lusaka are more likely to smoke than women (\(P=0.005\)).

The pooling is the point of this question. Since \(H_0\) asserts the two proportions are equal, the standard error must be built from a single pooled estimate of that shared proportion — not from \(\hat {P}_1\) and \(\hat {P}_2\) separately, which is what a confidence interval for the difference would use. The two calculations look similar and answer different questions.

Problem 3.9.

(a).
Explain why the \(\chi ^2\) statistic from a \(2\times 2\) contingency table has only one degree of freedom.
(b).
State what is meant by a Type I and a Type II error.
(c).
The mass of packs of unwrapped chocolates is normal with mean \(508\) g and standard deviation \(4\) g. A pack weighs \(520\) g and you are not told whether the chocolates are wrapped. Carry out a significance test to show there is evidence that they are wrapped.
(d).
For a test of \(H_0:\mu =\mu _0\) on a sample of \(n\) observations from a normal distribution, state how your decision to use the \(t\)-distribution would be influenced by (i) the value of \(n\), (ii) whether \(\sigma \) is known.

Show solution

Solution. (a) The row and column totals are treated as fixed. Once one cell of a \(2\times 2\) table is chosen, the other three follow by subtraction — the rest of the first row, the rest of the first column, and then the last cell twice over. Only one number is free to vary, so \(v=1\). The general formula says the same thing: \[v=(r-1)(c-1)=(2-1)(2-1)=1.\]

(b) A Type I error is rejecting \(H_0\) when it is true; its probability is \(\alpha \), the significance level, which the experimenter chooses. A Type II error is failing to reject \(H_0\) when it is false; its probability is \(\beta \), which depends on how far the truth lies from \(H_0\) and is not chosen directly. The power of the test is \(1-\beta \).

(c)

1.
\(H_0:\) the chocolates are unwrapped, so \(\mu =508\); \(H_1:\) they are wrapped, so \(\mu >508\). Wrapping can only add mass, so the test is one-tailed.
2.
\(\alpha =5\%\).
3.
\[Z=\frac {520-508}{4}=3.0.\]
4.
Critical region: \(Z>1.645\).
5.
\(3.0>1.645\), so we reject \(H_0\). There is evidence that the chocolates are wrapped.

Note the standard deviation used is \(\sigma =4\), not \(\sigma /\sqrt {n}\): this is a single pack, not the mean of a sample. A pack this heavy would occur in only about one unwrapped pack in \(740\), so the conclusion is not marginal.

(d) Both conditions matter, and they interact.

(i).
\(n\) enters through the degrees of freedom, \(n-1\). For small \(n\) the \(t\) distribution is appreciably wider than the normal; by about \(n=30\) the two are close enough that \(Z\) is used instead.
(ii).
This is the deciding condition. If \(\sigma \) is known, use \(Z\) whatever \(n\) is, because the population is normal and no estimation is involved. If \(\sigma \) is unknown and must be estimated by \(\widehat {S}\), that estimate carries its own uncertainty and \(t\) is the correct distribution.

So: \(\sigma \) known \(\Rightarrow \) \(Z\); \(\sigma \) unknown and \(n\) small \(\Rightarrow \) \(t\); \(\sigma \) unknown and \(n\) large \(\Rightarrow \) \(t\) strictly, but \(Z\) is an acceptable approximation.

Problem 3.10.

(a).
Explain the difference between a completely randomised design and a randomised block design.
(b).
Explain briefly how a scatter diagram can show whether there is correlation between two quantities. For the data below, calculate a coefficient of rank correlation and comment.

\(x\) 29 81 60 88 91 91 86 99 72 42
\(y\) 74 86 63 74 70 63 41 81 29 56

Show solution

Solution. (a) In a completely randomised design the treatments are allocated to experimental units entirely at random, and every difference not due to treatment falls into one undifferentiated error term. It is the simplest design and it is the right one when the units are genuinely alike.

In a randomised block design the units are first sorted into blocks of similar units — the same subject, the same field, the same day — and the treatments are then randomised within each block. Every treatment appears once in every block. The block-to-block variation is then measured and removed from the error term, so the comparison between treatments is made on a smaller residual and the test is more sensitive.

The cost is degrees of freedom: with \(b\) blocks, \(b-1\) of them leave the error term. Blocking pays when the blocks genuinely differ and wastes those degrees of freedom when they do not.

(b) A scatter diagram plots one variable against the other, one point per pair. If the points cluster about a rising line the correlation is positive; about a falling line, negative; if they fill the plot with no pattern, there is little or none. The tighter the points lie to a line, the stronger the correlation. The diagram also shows what a coefficient cannot: a curved relationship, or a single outlier that is driving the whole result.

Ranking each variable, and sharing ranks between the two \(91\)s and the two \(63\)s:

Rank \(x\) 1 5 3 7 8.5 8.5 6 10 4 2
Rank \(y\) 7.5 10 4.5 7.5 6 4.5 2 9 1 3
\(d\) \(-6.5\) \(-5\) \(-1.5\) \(-0.5\) 2.5 4 4 1 3 \(-1\)
\(d^2\) 42.25 25 2.25 0.25 6.25 16 16 1 9 1
Table 31: Ranks and differences. Tied values share the average of the ranks they occupy.

With \(\sum d^2=119\) and \(n=10\), \[r_s=1-\frac {6(119)}{10(99)}=1-0.721=0.279.\]

Comment. At \(0.279\), against a critical value of \(0.648\) for \(n=10\) at the \(5\%\) level, this is not significant. There is no evidence of any monotonic relationship between \(x\) and \(y\). The product-moment coefficient agrees, at \(r=0.113\). A scatter diagram of these points would show a shapeless cloud, which is exactly what such coefficients describe.

Problem 3.11. In a multiple-choice test a student chooses between three answers for each of ten questions. He gets six correct. Test at the \(5\%\) level the hypothesis that he was guessing.

Show solution

Solution. With only ten trials the normal approximation is not safe — \(np_0=10\left (\tfrac {1}{3}\right )=3.3\) is well under the usual threshold of \(5\) — so work with the binomial directly.

1.
\(H_0:\ P=\tfrac {1}{3}\) (he is guessing); \(H_1:\ P>\tfrac {1}{3}\) (he knows something).
2.
\(\alpha =5\%\), one-tailed.
3.
Under \(H_0\), \(X\sim B\!\left (10,\tfrac {1}{3}\right )\), and the evidence against \(H_0\) is \[P(X\geq 6)=\sum _{x=6}^{10}\binom {10}{x}\left (\tfrac {1}{3}\right )^x\left (\tfrac {2}{3}\right )^{10-x}=0.0766.\]
4.
Decision: \(0.0766>0.05\), so we fail to reject \(H_0\). There is not enough evidence, at the \(5\%\) level, to say he was doing better than guessing.

Six out of ten feels convincing, and it is not quite. Working out where the boundary lies is instructive: \(P(X\geq 7)=0.0197\), so seven correct would have been significant and six is not. With ten questions the test is a blunt instrument.

Problem 3.12. A die is suspected of being biased towards a six. It is thrown eight times and gives three sixes. Is there evidence at the \(2\%\) significance level that the die is biased towards a six?

Show solution

Solution.

1.
\(H_0:\ P=\tfrac {1}{6}\) (the die is fair); \(H_1:\ P>\tfrac {1}{6}\).
2.
\(\alpha =2\%\), one-tailed.
3.
Under \(H_0\), \(X\sim B\!\left (8,\tfrac {1}{6}\right )\): \[P(X\geq 3)=1-P(X\leq 2)=0.1348.\]
4.
\(0.1348>0.02\), so we fail to reject \(H_0\). There is no evidence at the \(2\%\) level that the die is biased.

Three sixes in eight throws is \(37.5\%\) against an expected \(16.7\%\) — more than double — and still nowhere near significant. Eight throws is simply too few. To detect bias of this size reliably the die would have to be thrown scores of times.

Problem 3.13. At one telephone exchange, \(200\) subscribers made a total of \(13\,248\) calls in a period. At another, \(300\) subscribers made \(20\,922\) calls. The standard deviation of the number of calls per subscriber at either exchange is \(8\). Is there evidence of a difference between the two exchanges in average frequency of calls?

Show solution

Solution. The means are \[\overline {X}_1=\frac {13\,248}{200}=66.24,\qquad \overline {X}_2=\frac {20\,922}{300}=69.74.\]

1.
\(H_0:\ \mu _1=\mu _2\); \(H_1:\ \mu _1\neq \mu _2\), two-tailed.
2.
\(\alpha =5\%\).
3.
\(\sigma =8\) is known for both, so \[\text {S.E}=\sigma \sqrt {\frac {1}{n_1}+\frac {1}{n_2}}=8\sqrt {\frac {1}{200}+\frac {1}{300}}=0.7303\] \[Z=\frac {66.24-69.74}{0.7303}=-4.79.\]
4.
Critical region: \(|Z|>1.96\).
5.
\(|-4.79|>1.96\), so we reject \(H_0\). There is very strong evidence that subscribers at the two exchanges differ in how often they call.

A difference of \(3.5\) calls, against a standard deviation of \(8\), is small for an individual subscriber — but the standard error of the difference in means is only \(0.73\) because the samples are large. This is the reverse of the previous two questions: there, large effects went undetected in tiny samples; here, a modest effect is detected easily in large ones.

Problem 3.14. In a butter packing plant the quantity packed in a day is normal with standard deviation \(39\) kg. Two packers, A and B, average \(1518\) kg and \(1499\) kg per day respectively over a \(26\)-day month. Is the performance of the two operators significantly different?

Show solution

Solution.

1.
\(H_0:\ \mu _A=\mu _B\); \(H_1:\ \mu _A\neq \mu _B\), two-tailed.
2.
\(\alpha =5\%\).
3.
\[\text {S.E}=39\sqrt {\frac {1}{26}+\frac {1}{26}}=10.82,\qquad Z=\frac {1518-1499}{10.82}=1.76.\]
4.
Critical region: \(|Z|>1.96\).
5.
\(1.76<1.96\), so we fail to reject \(H_0\). The difference of \(19\) kg per day is not significant at the \(5\%\) level.

This one is close — \(1.76\) against a critical \(1.96\), a \(P\)-value of about \(0.08\). Worth reporting as ”not significant at \(5\%\), but suggestive”, rather than as a flat verdict of no difference. A few more days of data could settle it either way.

Problem 3.15. You are an expert witness in a case where a gaming club is accused of running an unfair roulette wheel. Out of \(3700\) spins, zero — on which the club wins — came up \(140\) times. There are \(37\) equally likely scores, \(0\) to \(36\). Test whether there is evidence that the wheel is biased, and explain briefly what the test means, bearing in mind that you must convince a non-mathematical jury.

Show solution

Solution.

1.
\(H_0:\ P=\tfrac {1}{37}\) (the wheel is fair); \(H_1:\ P\neq \tfrac {1}{37}\).
2.
\(\alpha =5\%\).
3.
On a fair wheel the expected number of zeros in \(3700\) spins is \[np_0=3700\times \tfrac {1}{37}=100,\] with standard deviation \[\sqrt {np_0(1-p_0)}=\sqrt {3700\left (\tfrac {1}{37}\right )\left (\tfrac {36}{37}\right )}=9.86.\] So \[Z=\frac {140-100}{9.86}=4.06.\]
4.
\(|4.06|>1.96\), so we reject \(H_0\). There is strong evidence that the wheel is biased in the club’s favour.

For the jury. On an honest wheel, zero should come up about \(100\) times in \(3700\) spins. It came up \(140\). The question is whether \(40\) extra is the kind of thing luck produces. It is not: the natural run-to-run variation here is about \(10\) spins either way, so \(140\) is four times further out than ordinary luck accounts for. If this wheel were honest and the evening were repeated every night, a result this extreme would turn up less than once in twenty thousand nights.

Two cautions to state plainly, since the whole case may rest on them. The test does not prove the wheel was rigged deliberately — a warped wheel or a worn pocket would produce the same figures. And it does not prove bias with certainty; it says the result is far too extreme to be comfortably explained by chance.

Problem 3.16. The table shows cases of and deaths from malaria under two treatments.

Treatment Cases Deaths
Antitoxin 228 37
Ordinary 337 28

Test whether the proportion who die under antitoxin treatment differs significantly from the proportion who die under ordinary treatment.

Show solution

Solution. \[\hat {P}_1=\frac {37}{228}=0.1623,\qquad \hat {P}_2=\frac {28}{337}=0.0831.\]

1.
\(H_0:\ P_1=P_2\); \(H_1:\ P_1\neq P_2\), two-tailed.
2.
\(\alpha =5\%\).
3.
Pooling under \(H_0\): \[\hat {P}=\frac {37+28}{228+337}=\frac {65}{565}=0.1150\] \[\text {S.E}=\sqrt {0.1150(0.8850)\left (\frac {1}{228}+\frac {1}{337}\right )}=0.02736\] \[Z=\frac {0.1623-0.0831}{0.02736}=2.89.\]
4.
\(|2.89|>1.96\), so we reject \(H_0\). The death rates differ significantly; the antitoxin group fared worse, at about \(16\%\) against \(8\%\).

The same data as a \(2\times 2\) contingency table give \(\chi ^2=8.38\) on \(1\) degree of freedom, against a critical \(3.841\) — the same conclusion, and necessarily so, since \(Z^2=2.89^2=8.38\). For a \(2\times 2\) table the two tests are algebraically identical.

Worth saying what the test cannot show: this is observational data, not an experiment. If the sicker patients were the ones given antitoxin, that alone would produce this result.

Problem 3.17. A box contains either (\(H_0\)) ten white and ninety black counters, or (\(H_1\)) fifty white and fifty black. Four counters are drawn at random without replacement. If all four are black, \(H_0\) is accepted; otherwise it is rejected. Find the sizes of the Type I and Type II errors.

Show solution

Solution. Both errors come from the same probability, computed under different hypotheses: the chance that all four draws are black.

Under \(H_0\) there are \(90\) black of \(100\), drawn without replacement: \[P(\text {4 black}\mid H_0)=\frac {90}{100}\times \frac {89}{99}\times \frac {88}{98}\times \frac {87}{97}=0.6516.\] A Type I error is rejecting \(H_0\) when it is true, which happens whenever the four are not all black: \[\alpha =1-0.6516=0.3484.\]

Under \(H_1\) there are \(50\) black of \(100\): \[P(\text {4 black}\mid H_1)=\frac {50}{100}\times \frac {49}{99}\times \frac {48}{98}\times \frac {47}{97}=0.0587.\] A Type II error is accepting \(H_0\) when \(H_1\) is true, which is exactly this event: \[\beta =0.0587.\]

The test is badly unbalanced. It almost never lets a fifty-fifty box pass as ninety-ten (\(\beta \) under \(6\%\)), but it wrongly rejects a genuine ninety-ten box more than a third of the time. The power, \(1-\beta =0.941\), is excellent; the size, \(\alpha =0.348\), is unacceptable for most purposes. Requiring all four draws to be black is simply too strict a condition to impose on the null hypothesis, and drawing more counters — or accepting \(H_0\) on three blacks out of four — would balance it better.

Problem 3.18. A manufacturer claims that his new fishing line has a mean breaking strength of \(15\) kg and a standard deviation of \(0.5\) kg. To test the hypothesis that \(\mu =15\) against the alternative that \(\mu <15\), a random sample of \(50\) lines is tested. The critical region is defined to be \(\overline {X}<14.9\).

(a).
Explain how one can commit a type I error.
(b).
Explain how one can commit a type II error.
(c).
Find the probability of committing a type I error when \(H_0\) is true.
(d).
Evaluate \(\beta \) for the alternative \(\mu =14.8\).

Show solution

Solution. Throughout, \(\sigma =0.5\) is known and \(n=50\), so the sample mean has standard error \[\sigma _{\overline {X}}=\frac {\sigma }{\sqrt {n}}=\frac {0.5}{\sqrt {50}}=0.0707\ \text {kg}.\]

(a). A type I error is rejecting \(H_0\) when it is true. Here that means the \(50\) lines tested happen to give a mean breaking strength below \(14.9\) kg — so we declare the line weaker than advertised — when the true mean really is the claimed \(15\) kg. The manufacturer is wronged by an unlucky sample.

(b). A type II error is failing to reject \(H_0\) when it is false. Here that means the sample gives a mean of \(14.9\) kg or more — so we let the claim stand — when the true mean is in fact below \(15\) kg. A weak line passes.

(c). \(\alpha \) is computed under \(H_0\), taking \(\mu =15\): \begin {align*} \alpha &=P(\overline {X}<14.9 \mid \mu =15)\\ &=P\!\left (Z<\frac {14.9-15}{0.0707}\right )\\ &=P(Z<-1.41)\\ &=0.0793. \end {align*}

About eight tests in a hundred would condemn a line that meets its specification exactly.

(d). \(\beta \) is computed under the alternative, taking \(\mu =14.8\). A type II error occurs when the sample mean falls outside the critical region, that is when \(\overline {X}\geq 14.9\): \begin {align*} \beta &=P(\overline {X}\geq 14.9 \mid \mu =14.8)\\ &=P\!\left (Z\geq \frac {14.9-14.8}{0.0707}\right )\\ &=P(Z\geq 1.41)\\ &=0.0793. \end {align*}

The power of the test against this alternative is \(1-\beta =0.9207\).

The two answers agreeing is not a coincidence and is worth seeing. The boundary \(14.9\) sits exactly \(0.1\) kg below \(15\) and exactly \(0.1\) kg above \(14.8\), so in standard-error units it is \(1.41\) from each. The normal curve is symmetric, so the tail beyond it has the same area in both directions. Move the boundary and the symmetry breaks at once: a boundary at \(14.95\) would raise \(\alpha \) to \(0.24\) and drop \(\beta \) to \(0.017\). This is the trade-off in its plainest form — \(\alpha \) and \(\beta \) are two tails of two curves separated by a fixed distance, and sliding the boundary can only shrink one at the other’s expense. Only a larger \(n\), which pulls the curves apart in standard-error units, improves both.

Problem 3.19. The proportion of adults living in a small town who are university graduates is estimated to be \(p=0.3\). To test this hypothesis, a random sample of \(15\) adults is selected. If the number of university graduates in our sample is anywhere from \(2\) to \(7\), we accept the null hypothesis that \(p=0.3\); otherwise we conclude that \(p\neq 0.3\).

(a).
Evaluate \(\alpha \) assuming that \(p=0.3\).
(b).
Evaluate \(\beta \) for the alternative \(p=0.2\).

Show solution

Solution. The sample size is \(15\), far too small for a normal approximation to a proportion, so the binomial distribution is used exactly: \(X\sim B(15,p)\), where \(X\) is the number of graduates. The acceptance region is \(2\leq X\leq 7\); the critical region is \(X\leq 1\) or \(X\geq 8\).

(a). \(\alpha \) is the probability of landing in the critical region when \(p=0.3\): \begin {align*} \alpha &=P(X\leq 1)+P(X\geq 8)\ \big |\ p=0.3\\ &=\big [P(0)+P(1)\big ]+\big [1-P(X\leq 7)\big ]. \end {align*}

With \(P(x)=\binom {15}{x}(0.3)^x(0.7)^{15-x}\): \[P(0)=0.0047,\qquad P(1)=0.0305\quad \implies \quad P(X\leq 1)=0.0353,\] \[P(X\leq 7)=0.9500\quad \implies \quad P(X\geq 8)=0.0500.\] \[\alpha =0.0353+0.0500=0.0853.\]

(b). \(\beta \) is the probability of landing in the acceptance region when the alternative \(p=0.2\) holds: \begin {align*} \beta &=P(2\leq X\leq 7)\ \big |\ p=0.2\\ &=P(X\leq 7)-P(X\leq 1)\\ &=0.9958-0.1671\\ &=0.8287. \end {align*}

The power against \(p=0.2\) is therefore only \(1-\beta =0.1713\).

Two things this problem is designed to show. First, with a discrete test statistic you cannot choose \(\alpha \) freely: the acceptance region \(2\) to \(7\) delivers \(\alpha =0.0853\), and no rearrangement of whole numbers will produce exactly \(0.05\). That is why binomial tests are usually reported by their \(P\)-value rather than against a tidy critical region.

Second, \(\beta =0.83\) is dreadful. A true proportion of \(0.20\) against a hypothesised \(0.30\) is a large error in any practical sense, and this test misses it five times in six. Fifteen adults cannot distinguish those two populations, and no adjustment of the acceptance region would fix it — the fault is the sample size.

Problem 3.20. A random sample of \(36\) drinks from a soft-drink machine has an average content of \(21.9\) ml, with a standard deviation of \(1.42\) ml. Is there evidence to suggest that the average content is less than \(22.2\) ml? Use the \(0.05\) level of significance.

Show solution

Solution.

1.
\(H_0:\ \mu =22.2\) ml (the machine delivers as specified); \(H_1:\ \mu <22.2\) ml. The question asks only about under-filling, so the test is one-tailed to the left.
2.
\(\alpha =0.05\).
3.
\(\sigma \) is unknown but \(n=36\geq 30\), so \(\hat {S}=1.42\) replaces it and the statistic is \(Z\): \[Z=\frac {\overline {X}-\mu _0}{\hat {S}/\sqrt {n}} =\frac {21.9-22.2}{1.42/\sqrt {36}} =\frac {-0.3}{0.2367}=-1.27.\]
4.
Critical region: \(-z_{0.05}=-1.645\), so reject \(H_0\) if \(Z<-1.645\).
5.
\(-1.27>-1.645\), so we fail to reject \(H_0\). There is no evidence at the \(5\%\) level that the average content is less than \(22.2\) ml.

The \(P\)-value makes the verdict less abrupt: \(P=P(Z<-1.27)=0.1020\). Roughly one machine in ten filling correctly to \(22.2\) ml would produce a sample this low or lower, which is not rare enough to call the setting into question — but nor is it comfortable. A shortfall of \(0.3\) ml on every drink is a real loss to a customer, and the sensible response to \(P=0.10\) is to take a larger sample rather than to record “no evidence” and stop.

Problem 3.21. A random sample of \(10\) containers of a particular lubricant are found to be \(10.2\), \(9.7\), \(10.1\), \(10.3\), \(10.1\), \(9.8\), \(9.9\), \(10.4\), \(10.3\) and \(9.8\) litres. Assuming that the distribution of the contents is normal, use a \(0.01\) level of significance to test the hypothesis that the

(a).
average content of this particular lubricant is \(10\) litres.
(b).
variance of the contents of this particular lubricant is \(0.03\).

Show solution

Solution. From the ten values, \(\sum X=100.6\) and \(\sum X^2=1012.58\), so \[\overline {X}=\frac {100.6}{10}=10.06,\qquad \hat {S}^2=\frac {\sum X^2-(\sum X)^2/n}{n-1}=\frac {1012.58-1012.036}{9}=0.0604,\] giving \(\hat {S}=0.2459\).

(a). The mean.

1.
\(H_0:\ \mu =10\); \(H_1:\ \mu \neq 10\) (two-tailed — the question asks whether the content is \(10\) litres, not whether it is short).
2.
\(\alpha =0.01\).
3.
\(n=10\) is small and \(\sigma \) is unknown, so the statistic is \(t\) on \(n-1=9\) degrees of freedom: \[t=\frac {\overline {X}-\mu _0}{\hat {S}/\sqrt {n}} =\frac {10.06-10}{0.2459/\sqrt {10}}=\frac {0.06}{0.0777}=0.77.\]
4.
Critical region: \(t_{9,\,0.005}=3.250\), so reject if \(|t|>3.250\).
5.
\(0.77<3.250\), so we fail to reject \(H_0\). The containers are consistent with an average content of \(10\) litres.

(b). The variance.

1.
\(H_0:\ \sigma ^2=0.03\); \(H_1:\ \sigma ^2\neq 0.03\).
2.
\(\alpha =0.01\).
3.
The statistic for a single variance from a normal population is \[\chi ^2=\frac {(n-1)\hat {S}^2}{\sigma _0^2}=\frac {9(0.0604)}{0.03} =\frac {0.5440}{0.03}=18.13\] on \(9\) degrees of freedom.
4.
Critical region: the \(\chi ^2\) distribution is not symmetric, so the two tails must be looked up separately — \(\chi ^2_{9,\,0.995}=1.735\) and \(\chi ^2_{9,\,0.005}=23.589\). Reject if \(\chi ^2<1.735\) or \(\chi ^2>23.589\).
5.
\(1.735<18.13<23.589\), so we fail to reject \(H_0\). There is no evidence that the variance differs from \(0.03\).

Two remarks. The sample variance is \(0.0604\), double the hypothesised \(0.03\), and the test still does not reject — which shows how little nine degrees of freedom can settle about a variance. The acceptance region runs from \(\chi ^2=1.735\) to \(23.589\), a range of true variances from about \(0.023\) to \(0.31\).

Note also that the question says “variance \(\ldots \) is \(0.03\) litres”. A variance is in squared units: it should read \(0.03\) litres\(^2\), equivalently a standard deviation of about \(0.17\) litres. The arithmetic is unaffected, but the units as printed are wrong.

Problem 3.22. A random sample of \(8\) cigarettes of a certain brand has an average nicotine content of \(4.2\) mg and a standard deviation of \(1.4\) mg. Assume the distribution of the nicotine contents is normal.

(a).
Is this in line with a smoker’s claim that the average nicotine content exceeds \(4.9\) mg?
(b).
Is the standard deviation of the nicotine content of the brand less than \(1.2\) mg?

Show solution

Solution. Take \(\alpha =0.05\) throughout, since none is stated.

(a). The mean.

1.
\(H_0:\ \mu =4.9\) mg; \(H_1:\ \mu >4.9\) mg. The claim to be examined is that the content exceeds \(4.9\), so it belongs in \(H_1\) and the test is one-tailed to the right.
2.
\(\alpha =0.05\).
3.
\(n=8\), \(\sigma \) unknown, population normal, so \(t\) on \(7\) degrees of freedom: \[t=\frac {4.2-4.9}{1.4/\sqrt {8}}=\frac {-0.7}{0.4950}=-1.41.\]
4.
Critical region: \(t_{7,\,0.05}=1.895\), so reject if \(t>1.895\).
5.
\(-1.41<1.895\), so we fail to reject \(H_0\). The data are not in line with the smoker’s claim.

The arithmetic here is almost beside the point. The sample mean is \(4.2\) mg, which is below the \(4.9\) mg being claimed, so the evidence points in the opposite direction to the alternative and no sample of this kind could ever support it. Whenever the test statistic has the wrong sign for a one-tailed alternative, the conclusion is settled before the critical value is looked up.

(b). The standard deviation.

1.
\(H_0:\ \sigma =1.2\) mg; \(H_1:\ \sigma <1.2\) mg — one-tailed to the left.
2.
\(\alpha =0.05\).
3.
\[\chi ^2=\frac {(n-1)\hat {S}^2}{\sigma _0^2}=\frac {7(1.4)^2}{(1.2)^2} =\frac {7(1.96)}{1.44}=\frac {13.72}{1.44}=9.53\] on \(7\) degrees of freedom.
4.
Critical region: a small variance gives a small \(\chi ^2\), so the rejection region is the lower tail, \(\chi ^2<\chi ^2_{7,\,0.95}=2.167\).
5.
\(9.53>2.167\), so we fail to reject \(H_0\). There is no evidence that the standard deviation is less than \(1.2\) mg.

Again the direction settles it: the observed \(\hat {S}=1.4\) mg is larger than the \(1.2\) mg in the hypothesis, so it cannot be evidence that the true value is smaller. Note which tail belongs to which alternative — \(H_1:\sigma <\sigma _0\) puts the critical region in the lower tail, and \(\chi ^2_{7,\,0.95}\) (the value with \(95\%\) of the area above it) is the cut-off, not \(\chi ^2_{7,\,0.05}\).

Problem 3.23. A random sample of size \(n_1=25\), taken from a normal population with standard deviation \(\sigma _1=5.2\), has a mean \(\overline {X}_1=81\). A second random sample of size \(n_2=36\), taken from a different normal population with standard deviation \(\sigma _2=3.4\), has a mean \(\overline {X}_2=76\). Test the hypothesis that \(\mu _1=\mu _2\) against the alternative \(\mu _1\neq \mu _2\).

Show solution

Solution.

1.
\(H_0:\ \mu _1=\mu _2\), equivalently \(\mu _1-\mu _2=0\); \(H_1:\ \mu _1\neq \mu _2\).
2.
\(\alpha =0.05\) (none is stated).
3.
Both population standard deviations are known, so the statistic is \(Z\) whatever the sample sizes: \[Z=\frac {(\overline {X}_1-\overline {X}_2)-0} {\sqrt {\dfrac {\sigma _1^2}{n_1}+\dfrac {\sigma _2^2}{n_2}}} =\frac {81-76}{\sqrt {\dfrac {27.04}{25}+\dfrac {11.56}{36}}} =\frac {5}{\sqrt {1.0816+0.3211}}=\frac {5}{1.1844}=4.22.\]
4.
Critical region: \(\pm z_{0.025}=\pm 1.96\), so reject if \(|Z|>1.96\).
5.
\(4.22>1.96\), so we reject \(H_0\). The two population means differ.

The evidence is overwhelming rather than marginal: \(P=2\,P(Z>4.22)<0.0001\), so a difference this large would arise by chance about twice in a hundred thousand repetitions if the means were really equal. Compare this with Sheet 3, Problem 4, which used the same structure with \(\sigma _1=5\), \(\sigma _2=3\) and produced the interval \((2.90,\ 7.10)\) for \(\mu _1-\mu _2\). The interval excluded zero; this test rejects \(\mu _1-\mu _2=0\). They are the same statement in two forms, and that correspondence is exact: a two-tailed test at level \(\alpha \) rejects \(\mu _1-\mu _2=0\) precisely when the \(100(1-\alpha )\%\) interval fails to contain zero.

Problem 3.24. A cigarette manufacturing firm distributes two brands of cigarettes. If it is found that \(56\) of \(200\) smokers prefer brand A and that \(29\) of \(150\) smokers prefer brand B, can we conclude at the \(0.06\) level of significance that brand A outsells brand B?

Show solution

Solution.

1.
\(H_0:\ P_A=P_B\); \(H_1:\ P_A>P_B\) — “outsells” is directional, so the test is one-tailed.
2.
\(\alpha =0.06\).
3.
The sample proportions are \[\hat {P}_A=\frac {56}{200}=0.28,\qquad \hat {P}_B=\frac {29}{150}=0.1933.\] Because \(H_0\) asserts the two proportions are equal, the common value is estimated by pooling both samples: \[\hat {P}=\frac {56+29}{200+150}=\frac {85}{350}=0.2429.\] \begin {align*} Z&=\frac {\hat {P}_A-\hat {P}_B} {\sqrt {\hat {P}(1-\hat {P})\left (\dfrac {1}{n_A}+\dfrac {1}{n_B}\right )}}\\ &=\frac {0.0867}{\sqrt {0.2429(0.7571)\left (\dfrac {1}{200}+\dfrac {1}{150}\right )}}\\ &=\frac {0.0867}{\sqrt {0.002145}}=\frac {0.0867}{0.0463}=1.87. \end {align*}
4.
Critical region: \(\alpha =0.06\) in one tail gives \(z_{0.06}=1.55\), so reject if \(Z>1.55\).
5.
\(1.87>1.55\), so we reject \(H_0\). At the \(6\%\) level we conclude that brand A does outsell brand B.

The pooling deserves emphasis, because it is exactly what separates this test from the confidence interval of Sheet 3, Problem 6. A test computes everything under \(H_0\), and \(H_0\) here says the two proportions are one and the same number — so the best estimate of it uses all \(350\) smokers. A confidence interval assumes no such equality and lets each sample supply its own \(\hat {P}\).

Note also the level. \(P=P(Z>1.87)=0.0307\), so this result is significant at \(6\%\), at \(5\%\), and even at \(3.1\%\) — but not at \(1\%\). Choosing \(\alpha =0.06\) rather than the customary \(0.05\) is unusual and, strictly, ought to be justified before the data are seen rather than after.

Problem 3.25. To find out whether a new serum will arrest leukaemia, \(9\) mice which have all reached an advanced stage of the disease are selected. Five mice receive the treatment and four do not. The survival times, in years, from the time the experiment commenced are:

Treatment 2.1 5.3 1.4 4.6 0.9
No treatment 1.9 0.5 2.8 3.1

Assume that the two distributions are normally distributed.

(a).
Can the serum be said to be effective? Assume the variances are equal.
(b).
Is the assumption of equal variances made in (a) justified?

Show solution

Solution. The summary statistics are \[n_1=5,\quad \overline {X}_1=\frac {14.3}{5}=2.86,\quad \hat {S}_1^2=3.883;\qquad n_2=4,\quad \overline {X}_2=\frac {8.3}{4}=2.075,\quad \hat {S}_2^2=1.3625.\]

(a). Is the serum effective?

1.
\(H_0:\ \mu _1=\mu _2\) (the serum makes no difference); \(H_1:\ \mu _1>\mu _2\) (treated mice survive longer). “Effective” means longer survival, so the test is one-tailed.
2.
\(\alpha =0.05\).
3.
Small samples, unknown but assumed equal variances, so the pooled \(t\): \[S_p^2=\frac {4(3.883)+3(1.3625)}{5+4-2}=\frac {15.532+4.0875}{7}=2.803, \qquad S_p=1.674,\] \[t=\frac {\overline {X}_1-\overline {X}_2}{S_p\sqrt {\dfrac {1}{n_1}+\dfrac {1}{n_2}}} =\frac {2.86-2.075}{1.674\sqrt {\dfrac {1}{5}+\dfrac {1}{4}}} =\frac {0.785}{1.674(0.6708)}=\frac {0.785}{1.123}=0.70\] on \(n_1+n_2-2=7\) degrees of freedom.
4.
Critical region: \(t_{7,\,0.05}=1.895\), so reject if \(t>1.895\).
5.
\(0.70<1.895\), so we fail to reject \(H_0\). The serum cannot be said to be effective.

(b). Are the variances equal?

1.
\(H_0:\ \sigma _1^2=\sigma _2^2\); \(H_1:\ \sigma _1^2\neq \sigma _2^2\).
2.
\(\alpha =0.05\).
3.
The statistic is the ratio of the two sample variances, larger over smaller: \[F=\frac {\hat {S}_1^2}{\hat {S}_2^2}=\frac {3.883}{1.3625}=2.85\] on \(v_1=n_1-1=4\) and \(v_2=n_2-1=3\) degrees of freedom.
4.
Critical region: \(F_{0.025,\,4,3}=15.10\) in the upper tail, and in the lower tail \[F_{0.975,\,4,3}=\frac {1}{F_{0.025,\,3,4}}=\frac {1}{9.979}=0.100.\] Reject if \(F>15.10\) or \(F<0.100\).
5.
\(0.100<2.85<15.10\), so we fail to reject \(H_0\). The assumption of equal variances is justified — or, more precisely, not contradicted by these data.

The critical values in (b) tell the real story: with four and three degrees of freedom, one variance would have to be fifteen times the other before the test noticed. Almost no equal-variance assumption is ever rejected on samples this small, so passing this check is weak reassurance, not proof.

The result in (a) is also worth reading carefully. Treated mice survived \(0.785\) years longer on average, an increase of nearly \(40\%\) — but with five mice and four, and survival times ranging from \(0.9\) to \(5.3\) years, that is well inside chance variation. “Not proved effective” is not the same as “proved ineffective”; here it means the experiment was too small to settle the question either way.

Problem 3.26. A taxi company is trying to decide whether to purchase brand A or brand B tyres for its fleet. To help arrive at a decision, an experiment is conducted using \(12\) tyres of each brand, run until they wear out:

Brand A: \(\overline {X}_1=37{,}900\) km \(\hat {S}_1=5100\) km
Brand B: \(\overline {X}_2=39{,}800\) km \(\hat {S}_2=5900\) km

Assume the populations to be approximately normal.

(a).
Is there a difference in the two brands of tyres?
(b).
Is the standard deviation of the distances of brand A tyres smaller?

Show solution

Solution. (a). The means.

1.
\(H_0:\ \mu _1=\mu _2\); \(H_1:\ \mu _1\neq \mu _2\) — “is there a difference” is two-tailed.
2.
\(\alpha =0.05\).
3.
With \(n_1=n_2=12\) the pooled variance is the plain average of the two: \[S_p^2=\frac {(5100)^2+(5900)^2}{2}=\frac {26{,}010{,}000+34{,}810{,}000}{2}=30{,}410{,}000,\] so \(S_p=5514.5\) km, and \[t=\frac {37{,}900-39{,}800}{5514.5\sqrt {\dfrac {1}{12}+\dfrac {1}{12}}} =\frac {-1900}{5514.5(0.4082)}=\frac {-1900}{2251.3}=-0.84\] on \(22\) degrees of freedom.
4.
Critical region: \(t_{22,\,0.025}=2.074\), so reject if \(|t|>2.074\).
5.
\(0.84<2.074\), so we fail to reject \(H_0\). There is no evidence of a difference between the two brands.

(b). The standard deviations.

1.
\(H_0:\ \sigma _1^2=\sigma _2^2\); \(H_1:\ \sigma _1^2<\sigma _2^2\) — the question asks whether brand A is less variable, so this is one-tailed.
2.
\(\alpha =0.05\).
3.
\[F=\frac {\hat {S}_1^2}{\hat {S}_2^2}=\frac {26{,}010{,}000}{34{,}810{,}000}=0.747\] on \(v_1=11\), \(v_2=11\) degrees of freedom.
4.
Critical region: the alternative says the numerator variance is the smaller, so small values of \(F\) are the evidence and the critical region is the lower tail: \[F_{0.95,\,11,11}=\frac {1}{F_{0.05,\,11,11}}=\frac {1}{2.818}=0.355.\] Reject if \(F<0.355\).
5.
\(0.747>0.355\), so we fail to reject \(H_0\). There is no evidence that brand A tyres are less variable in the distance they last.

Part (b) is the check that part (a) quietly assumed: pooling in (a) requires \(\sigma _1=\sigma _2\), and (b) confirms that assumption survives. In practice the variance test is done first, and its outcome decides whether the pooled \(t\) or the Welch alternative is used for the means.

Note how the tail was chosen in (b). Putting the smaller variance on top produced \(F<1\), and the alternative pointed to the lower tail. Had the ratio been taken the other way round, \(F=1/0.747=1.34\) with the same degrees of freedom, the alternative would have pointed to the upper tail, and the critical value would have been \(2.818\) — the same test, and the same conclusion, written upside down.

Problem 3.27. A taxi company is trying to decide whether to use radial or belted tyres to improve fuel economy. Twelve cars were equipped with radial tyres and driven over a prescribed test course. Without changing drivers, the same cars were then equipped with belted tyres and driven once again over the test course. The fuel consumption in km per litre was recorded:

Car 1 2 3 4 5 6 7 8 9 10 11 12
Radial tyres 4.2 4.7 6.6 7.0 6.7 4.5 5.7 6.0 7.4 4.9 6.1 5.2
Belted tyres 4.1 4.9 6.2 6.9 6.8 4.4 5.7 5.8 6.9 4.7 6.0 4.9

Assume the populations to be normally distributed. Can we conclude that cars equipped with radial tyres give better fuel economy than those equipped with belted tyres? Use a \(0.025\) level of significance.

Show solution

Solution. The same twelve cars were driven on both sets of tyres, with the same drivers over the same course. The two rows are therefore twelve pairs, not two independent samples, and the test is applied to the differences.

Car 1 2 3 4 5 6 7 8 9 10 11 12
\(d\) = radial \(-\) belted 0.1 \(-0.2\) 0.4 0.1 \(-0.1\) 0.1 0.0 0.2 0.5 0.2 0.1 0.3
Table 32: Differences in fuel consumption, km per litre, radial minus belted.

1.
\(H_0:\ \mu _d=0\) (the two types of tyre give the same fuel economy); \(H_1:\ \mu _d>0\) (radial is better) — one-tailed.
2.
\(\alpha =0.025\).
3.
From the twelve differences, \(\sum d=1.7\) and \(\sum d^2=0.67\), so \[\overline {d}=\frac {1.7}{12}=0.1417,\qquad \hat {S}_d^2=\frac {0.67-(1.7)^2/12}{11}=\frac {0.4292}{11}=0.03902,\] giving \(\hat {S}_d=0.1975\) and \[t=\frac {\overline {d}}{\hat {S}_d/\sqrt {n}}=\frac {0.1417}{0.1975/\sqrt {12}} =\frac {0.1417}{0.0570}=2.48\] on \(n-1=11\) degrees of freedom.
4.
Critical region: \(t_{11,\,0.025}=2.201\), so reject if \(t>2.201\).
5.
\(2.48>2.201\), so we reject \(H_0\). We conclude that radial tyres do give better fuel economy.

The pairing is what makes this result possible. Fuel consumption across the twelve cars runs from \(4.2\) to \(7.4\) km per litre — a spread of over \(3\) — while the tyre effect is about \(0.14\). Treated as two independent samples of twelve, the between-car variation would sit in the standard error and produce \(t=0.18\): nothing at all. Pairing removes every car’s own characteristics from the comparison, leaving a difference of \(0.14\) against a difference standard deviation of only \(0.20\).

The design detail matters as much as the arithmetic. Keeping the same drivers and the same course removes two further sources of variation that would otherwise be confounded with the tyres. That is deliberate experimental design, not luck.

Problem 3.28. A coin is tossed \(20\) times, resulting in \(5\) heads. Is this sufficient evidence to suggest that heads occur less than \(50\%\) of the time?

Show solution

Solution.

1.
\(H_0:\ P=0.5\) (the coin is fair); \(H_1:\ P<0.5\) — one-tailed.
2.
\(\alpha =0.05\).
3.
With \(n=20\) the binomial can be used exactly. If \(X\) is the number of heads, \(X\sim B(20,0.5)\) under \(H_0\), and the evidence against \(H_0\) is a small \(X\): \[P(X\leq 5)=\sum _{x=0}^{5}\binom {20}{x}(0.5)^{20} =\frac {1+20+190+1140+4845+15504}{1{,}048{,}576} =\frac {21{,}700}{1{,}048{,}576}=0.0207.\]
4.
Decision rule: reject \(H_0\) if this probability is below \(\alpha =0.05\).
5.
\(0.0207<0.05\), so we reject \(H_0\). There is sufficient evidence that heads occur less than half the time.

The normal approximation is available as a check, since \(nP=nQ=10\geq 5\). Without a continuity correction, \[Z=\frac {X-nP}{\sqrt {nPQ}}=\frac {5-10}{\sqrt {5}}=-2.24,\qquad P=0.0125,\] and with the correction, using \(5.5\) in place of \(5\), \[Z=\frac {5.5-10}{2.236}=-2.01,\qquad P=0.0222.\] The corrected value is much the closer to the exact \(0.0207\), which is the point of the correction: a discrete count is being approximated by a continuous curve, and the half-unit compensates for the difference. When \(n\) is small enough to sum the binomial directly, as it is here, do that instead — the approximation is a convenience, not an improvement.

Problem 3.29. A die is tossed \(180\) times with the following results:

\(x\) 1 2 3 4 5 6
\(f\) 28 36 36 30 27 23

Is this a balanced die? Use a \(0.01\) level of significance.

Show solution

Solution.

1.
\(H_0:\) the die is balanced, \(P(1)=P(2)=\cdots =P(6)=\frac {1}{6}\); \(H_1:\) the die is not balanced.
2.
\(\alpha =0.01\).
3.
If the die is balanced, each face is expected \(E=180\times \frac {1}{6}=30\) times:

Face 1 2 3 4 5 6 Total
Observed \(O\) 28 36 36 30 27 23 180
Expected \(E\) 30 30 30 30 30 30 180
\((O-E)^2/E\) 0.133 1.200 1.200 0.000 0.300 1.633 4.467

\[\chi ^2=\sum \frac {(O-E)^2}{E}=\frac {134}{30}=4.47\] on \(k-1=5\) degrees of freedom. One degree of freedom is lost because the total, \(180\), is fixed: once five of the counts are known the sixth follows.

4.
Critical region: \(\chi ^2_{5,\,0.01}=15.086\), so reject if \(\chi ^2>15.086\).
5.
\(4.47<15.086\), so we fail to reject \(H_0\). The die may be regarded as balanced.

The \(P\)-value is \(0.48\): a fair die would produce a set of counts at least this uneven about half the time. The observed range from \(23\) to \(36\) looks lopsided to the eye, but random counts around a mean of \(30\) have a standard deviation of \(\sqrt {180\cdot \frac {1}{6}\cdot \frac {5}{6}}=5\), so departures of five or six from \(30\) are entirely routine. The \(\chi ^2\) test exists precisely because unaided intuition reads too much into that kind of scatter.

Problem 3.30. A machine is supposed to mix peanuts, hazelnuts, cashews and pecans in the ratio \(5:2:2:1\). A can containing \(500\) of these mixed nuts was found to have \(269\) peanuts, \(112\) hazelnuts, \(74\) cashews and \(45\) pecans. At the \(0.05\) level of significance, test the hypothesis that the machine is mixing the nuts in the ratio \(5:2:2:1\).

Show solution

Solution.

1.
\(H_0:\) the nuts are mixed in the ratio \(5:2:2:1\), that is \(P_1=\frac {5}{10}\), \(P_2=P_3=\frac {2}{10}\), \(P_4=\frac {1}{10}\); \(H_1:\) the mixing ratio is not \(5:2:2:1\).
2.
\(\alpha =0.05\).
3.
The ratio parts sum to \(5+2+2+1=10\), so the expected counts out of \(500\) are \[E_1=500\times \tfrac {5}{10}=250,\quad E_2=E_3=500\times \tfrac {2}{10}=100,\quad E_4=500\times \tfrac {1}{10}=50.\]

Peanuts Hazelnuts Cashews Pecans Total
Observed \(O\) 269 112 74 45 500
Expected \(E\) 250 100 100 50 500
\((O-E)^2/E\) 1.444 1.440 6.760 0.500 10.144

\[\chi ^2=10.144\] on \(k-1=3\) degrees of freedom.

4.
Critical region: \(\chi ^2_{3,\,0.05}=7.815\), so reject if \(\chi ^2>7.815\).
5.
\(10.144>7.815\), so we reject \(H_0\). The machine is not mixing the nuts in the ratio \(5:2:2:1\).

The table also says where the fault lies, which the single statistic does not. The cashews alone contribute \(6.76\) of the \(10.14\) — two-thirds of the total — with \(74\) observed against \(100\) expected. Every other category is close to its expectation. An engineer told only that “the ratio is wrong” learns much less than one told that the machine is short-changing the cashews specifically. Always inspect the individual contributions after a significant \(\chi ^2\); the test locates a discrepancy, and the table names it.

Problem 3.31. A random sample of \(90\) adults is classified according to sex and the number of hours they watch television during the week:

Male Female
Over 25 hours 15 29
Under 25 hours 27 19

Use a \(0.01\) level of significance and test the hypothesis that time spent watching television is independent of whether the viewer is male or female.

Show solution

Solution.

1.
\(H_0:\) viewing time and sex are independent; \(H_1:\) viewing time and sex are not independent.
2.
\(\alpha =0.01\).
3.
Under independence the expected count in a cell is \[E=\frac {(\text {row total})\times (\text {column total})}{\text {grand total}}.\] The row totals are \(44\) and \(46\); the column totals are \(42\) and \(48\); the grand total is \(90\).

Male Female Row total
Over 25 hours 15  (20.53) 29  (23.47) 44
Under 25 hours 27  (21.47) 19  (24.53) 46
Column total 42 48 90
Table 33: Observed counts with expected counts in brackets.

For example \(E_{11}=\frac {44\times 42}{90}=20.53\). Then \begin {align*} \chi ^2&=\frac {(15-20.53)^2}{20.53}+\frac {(29-23.47)^2}{23.47} +\frac {(27-21.47)^2}{21.47}+\frac {(19-24.53)^2}{24.53}\\ &=1.491+1.305+1.426+1.248\\ &=5.47 \end {align*}

on \((r-1)(c-1)=(2-1)(2-1)=1\) degree of freedom.

4.
Critical region: \(\chi ^2_{1,\,0.01}=6.635\), so reject if \(\chi ^2>6.635\).
5.
\(5.47<6.635\), so we fail to reject \(H_0\). At the \(1\%\) level, viewing time is independent of sex.

Notice how close this is. The \(P\)-value is \(0.019\), so the same data would reject independence at the \(5\%\) level and fail to at the \(1\%\) level. The verdict is a property of the significance level chosen as much as of the data, which is the argument for reporting the \(P\)-value rather than a bare accept-or-reject.

One technical point about \(2\times 2\) tables. With a single degree of freedom the continuous \(\chi ^2\) curve is a poorer approximation to a discrete set of counts, and Yates’ continuity correction \[\chi ^2_{\text {Yates}}=\sum \frac {\left (|O-E|-0.5\right )^2}{E}\] is sometimes applied. Here it gives \(4.53\) instead of \(5.47\), which does not change the conclusion at \(1\%\) but would change it at \(5\%\). The correction applies only to \(2\times 2\) tables; for anything larger it is neither needed nor correct.

Problem 3.32. A random sample of \(200\) married men, all retired, were classified according to education and number of children:

Number of children
Education \(0-1\) \(2-3\) over 3
Primary 14 37 32
Secondary 19 42 17
College 12 17 10

Are family size and level of education attained by the father independent? Use a \(0.05\) level of significance.

Show solution

Solution.

1.
\(H_0:\) family size and level of education are independent; \(H_1:\) they are not independent.
2.
\(\alpha =0.05\).
3.
The row totals are \(83\), \(78\) and \(39\); the column totals are \(45\), \(96\) and \(59\); the grand total is \(200\). Each expected count is (row total)\(\times \)(column total)\(/200\) — for instance \(E_{11}=\frac {83\times 45}{200}=18.675\).

\(0-1\) \(2-3\) over 3 Row total
Primary 14  (18.675) 37  (39.840) 32  (24.485) 83
Secondary 19  (17.550) 42  (37.440) 17  (23.010) 78
College 12   (8.775) 17  (18.720) 10  (11.505) 39
Column total 45 96 59 200
Table 34: Observed counts with expected counts in brackets.

The individual contributions \((O-E)^2/E\) are

\(0-1\) \(2-3\) over 3
Primary 1.170 0.202 2.307
Secondary 0.120 0.555 1.570
College 1.185 0.158 0.197

\[\chi ^2=\sum \frac {(O-E)^2}{E}=7.46\] on \((r-1)(c-1)=(3-1)(3-1)=4\) degrees of freedom.

4.
Critical region: \(\chi ^2_{4,\,0.05}=9.488\), so reject if \(\chi ^2>9.488\).
5.
\(7.46<9.488\), so we fail to reject \(H_0\). There is no evidence at the \(5\%\) level that family size and the father’s level of education are related.

The largest contributions come from the corners of the table — primary-educated fathers with more than three children (\(32\) observed against \(24.5\) expected) and secondary-educated fathers with more than three (\(17\) against \(23.0\)) — so the data lean in the expected direction, with less education accompanying larger families. The test simply says that lean is not pronounced enough, on \(200\) men, to rule out chance.

A caution on the degrees of freedom. They are \((r-1)(c-1)=4\), not the number of cells minus one. Nine cells with fixed row and column totals leave only four free: fill in any \(2\times 2\) corner and the remaining five cells are determined. Using \(k-1=8\) here would give a critical value of \(15.51\) and could reverse a genuine result.

Finally, a condition to check before trusting any \(\chi ^2\) table test: no expected count should fall below \(5\). The smallest here is \(8.775\), so the test is valid. Had a category been sparser, the usual remedy is to combine adjacent categories — here, for example, merging “\(2-3\)” with “over 3” — and recompute with fewer degrees of freedom.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.