Statistics · Solutions
Descriptive Statistics
Work this sheet on paper, showing every step — the solutions are written as methods, so you can check your route and not just your final number. Name every result you use (“by the identity ”, “by Chebyshev's inequality”, “because deviations from the mean sum to zero”) and say which hypotheses it needs, in particular whether independence or normality is being assumed. Every number has been chosen so that no calculator is needed; leave answers as exact fractions or roots. Full worked solutions are on a separate page, and each question has its own reveal, so you can check one answer without seeing the rest.
- 1.Computation
A bakery bakes loaves in a day. To monitor the ovens, an inspector weighs loaves chosen at random from the day's output and finds a mean weight of g with a sample standard deviation of g.
- (a)Identify the population, the sample, one parameter and one statistic in this scenario, and write each parameter and statistic with its standard symbol.
- (b)The inspector writes “, so .” Explain what is wrong with this sentence, distinguishing from .
- (c)A colleague proposes estimating the day's mean weight by , arguing that the ovens “usually run light”. Compute the bias of under the random-sample assumption, and state exactly what unbiasedness of does and does not promise about the single value .
Solution
(a) Population and sample. The population is the day's entire output, all loaves; the sample is the loaves actually weighed. A parameter is a number computed from the whole population, fixed and unknown: the day's mean weight and variance (or the proportion of underweight loaves). A statistic is computed from the sample and would change with a different sample: g and g, so g (or ).
(b) Random variable versus observed value. Upper-case is the sample mean regarded as a random variable, before the sample is drawn; lower-case is the one number it turned out to be. An expectation is a long-run average over all the samples that might have been drawn, so it is a statement about , and under the random-sample assumption the theorem that the sample mean is unbiased gives — an unknown constant, not . Substituting one realisation into an expectation is a category error. The two correct sentences are and .
(c) Bias of the shifted estimator. By linearity of expectation and ,
The estimator is biased upward by g whatever the ovens do: if they run light, that is already built into , and tracks it without help. Unbiasedness of promises only that, averaged over every random sample of loaves that could have been drawn, the sample means would centre exactly on . It promises nothing about how far the single value is from ; that is governed by , which here is estimated by g and is a separate quantity altogether.
- 2.Computation
Five readings of a room's temperature, in degrees Celsius, are .
- (a)Compute and verify that the five deviations sum to zero. Then compute .
- (b)Without touching the raw data again, find by quoting the appropriate identity. Then check it directly.
- (c)The readings are converted to Fahrenheit by . Find the mean in Fahrenheit without converting the individual readings, and name the result that licenses this.
- (d)A second room was measured times with mean C. Find the mean of all readings, and explain why is wrong.
Solution
(a) Mean and deviations. The sum is , so . The deviations are , and , as the proposition that deviations from the mean sum to zero guarantees for every dataset. Their squares are , so .
(b) Shift the centre with the identity. The theorem that the mean minimises total squared deviation gives the exact identity . With ,
Direct check: . ✓ The excess is the cost of centring two degrees away from the minimiser.
(c) Linear transformation. with and , so by the proposition on the mean under a linear transformation,
No individual reading was needed.
(d) Combined mean. By the proposition on the combined mean of two groups,
The pooled mean is a weighted mean of the two group means with the group sizes as weights, here . The unweighted average treats the two rooms as equally represented, but the second room contributes three times as many readings, so the truth is pulled toward . Averaging averages is correct only when .
- 3.Computation
Ten commute times, in minutes, were recorded as .
- (a)Find the median and the mean.
- (b)The value turns out to have been a — a day with a road closure. Recompute both centres with in place of , and state by how much each moved.
- (c)Compute the trimmed mean of the corrected data (the one containing ), and say where it sits relative to the mean and the median.
- (d)Using the theorem that characterises the median as a minimiser, explain — without recomputing anything — why the median could not have moved in (b), and for which replacement values of the this argument continues to hold.
Solution
(a) Sort first. In order: . With even the median is the average of the th and th values, . The sum is and , total , so .
(b) One value changes. The was already the largest observation, so replacing it by leaves the order of the other nine untouched and is still last. The th and th values are still and : the median is , a move of . The sum becomes , so , a move of minutes — one observation out of ten has tripled the mean.
(c) Trimmed mean. With and we discard the lowest and the highest value, leaving , whose sum is . The trimmed mean is . It sits between the median and the mean , but right next to the median: trimming removed the single value that was driving the mean, which is exactly what the trimmed mean is for.
(d) Why the median cannot move. The theorem that the median minimises total absolute deviation shows that has, between data values, slope : the number of observations to the left of minus the number to the right. That slope depends only on how many points lie on each side, never on how far away they are. Replacing by leaves it on the right of every , so for in the counts are still , the slope is still zero there, and the minimising set is still with midpoint .
The argument holds for any replacement value that is at least , since then 's replacement still lies to the right of the middle interval and the sorted positions and are unchanged. A replacement below would change the ordering, and the median could then move.
- 4.Computation
A sample of five machined parts has lengths, in centimetres, .
- (a)Compute and from the definition, showing the deviations. State what would be if these five parts were the entire population.
- (b)Confirm the sum of squares using the computational formula .
- (c)Each length is converted to millimetres and then reported as its deviation from a mm target, . Find , and without recomputing from the data, and name the results used.
- (d)Compute the coefficient of variation of the data. Explain why the coefficient of variation of the data is not a meaningful quantity, even though the data are just the data in different units.
Solution
(a) From the definition. The sum is , so . The deviations are (they sum to , as they must), with squares summing to . Dividing by ,
If the five parts were the whole population the divisor would be : cm and cm.
(b) Computational formula. and , so . ✓
(c) Linear transformation. Here and . By the proposition on the mean under a linear transformation, . By the proposition on the variance under a linear transformation, mm and mm. The shift by moved the mean and left the spread alone; the factor scaled the standard deviation by and the variance by .
(d) Coefficient of variation. , that is . For the data the formula would divide by , but the failure is deeper than a zero denominator: the CV measures spread relative to level, which only means something when zero is a genuine zero of the quantity. The shift moved the origin to an arbitrary target, so “level” no longer has meaning and the ratio is uninterpretable. A pure rescaling with and would have left the CV unchanged, since ; it is the shift that destroys it, which is why the CV is a ratio-scale tool.
- 5.Proof
Take throughout. Let each have mean and variance .
- (a)Show from the definitions that and that .
- (b)Assuming and are independent, prove directly that . Deduce the expectation of the -divisor estimator and state its bias.
- (c)Now suppose instead that for some . Show that , say which hypothesis of the unbiasedness theorem this shows to be indispensable, and interpret the sign of the bias when .
Solution
(a) The two-point sample. By definition . The deviations are
which sum to zero as deviations from the mean must. Each squares to , so the sum of squares is , and dividing by gives .
(b) Independent case. Put . By linearity, , so by the computational formula for the variance, . For independent summands the variance of a sum is the sum of the variances, and , so
The -divisor estimator is , so and its bias is with . This is the corollary that the -divisor estimator is biased downward, in the case where it is off by half.
(c) Correlated case. Expand and take expectations of the square:
Still , so .
This equals only when . The indispensable hypothesis is independence of the observations (uncorrelatedness is what the algebra actually uses); it enters the general proof through , which fails when the cross terms do not vanish. Normality was never needed and still is not. When the bias is negative: positively correlated observations sit closer to each other than independent ones would, so their spread understates the population spread — two measurements on the same subject look less variable than two subjects do.
- 6.Critique
A student's write-up on Bessel's correction contains the following two arguments.
Argument A. “Dividing by makes the sample standard deviation unbiased. Proof: the sample variance satisfies , so .”
Argument B. “The correction only matters for small samples. Once is large, dividing by is also unbiased, so for either divisor gives an unbiased estimator of . In any case the real reason for is that it makes the answer bigger, which is the cautious choice.”
- (a)Identify the exact step in Argument A that is invalid and name the result that shows it fails. Then confirm the failure with a concrete example: a statistic taking the values and with probability each. Compute , and .
- (b)Identify both false claims in Argument B and correct them. For and , compute exactly the expectation and the bias of the -divisor estimator.
- (c)Write one correct sentence stating what Bessel's correction actually achieves, including the hypotheses it needs.
Solution
(a) The square root is not linear. The invalid step is : the expectation has been moved inside the square root. Expectation commutes with linear operations only. The square root is strictly concave, so Jensen's inequality gives for any non-negative , with strict inequality whenever is genuinely random. Hence : the sample standard deviation underestimates on average even though is unbiased for .
Example: , so , while . Since , we have and the two sides differ. The size of the gap depends on the distribution of , which is why no universal correction to exists.
(b) Two false claims. First, “for large dividing by is also unbiased.” By the corollary that the -divisor estimator is biased downward, , which is nonzero for every finite . It tends to zero, but unbiasedness is an exact property and this estimator never has it. For and ,
Small, but not zero, and “negligible” is a different claim from “unbiased”.
Second, “the reason is that it makes the answer bigger.” The divisor is chosen because the lemma on the expected sum of squares about the sample mean gives , so is the unique divisor making . Being larger than the -divisor version is a consequence, not a justification: dividing by would be larger still, and biased upward.
(c) The correct statement. “For a random sample — independent, identically distributed observations with finite variance, with no assumption of normality — dividing the sum of squared deviations about by produces an estimator with exactly; the same is not true of , for which .”
- 7.Computation
Eleven response times, in milliseconds, were logged as . Use the median-of-halves rule for quartiles throughout.
- (a)Give the five-number summary and the IQR. Say explicitly what you did with the median when forming the two halves.
- (b)Compute Tukey's mild and extreme fences and classify every observation that lies outside a fence. Say where each whisker of a box plot would end.
- (c)Compute the mean, compare it with the median, and state what the comparison suggests about the shape of the data.
- (d)The logging system is found to have truncated the largest value, which was really , not . Without recomputing from scratch, state which of the quantities in (a)–(c) change and which do not, and by how much the mean changes.
Solution
(a) Sort, then split. In order: . With odd the median is the th value, . The rule excludes the median itself from both halves: the lower half is with median , and the upper half is with median . The five-number summary is and .
(b) Fences. , so the mild fences are and ; , so the extreme fences are and . The only value outside a fence is : it exceeds but not , so it is a mild outlier and not an extreme one. Nothing lies below . The lower whisker runs from down to the minimum ; the upper whisker runs from to the largest observation inside the fence, , with plotted separately.
(c) Mean versus median. The sum is and , total , so
The mean exceeds the median by ms. By the proposition that skew separates the mean from the median, this suggests right skew — a long upper tail, visible here as and . It is a rule of thumb, to be confirmed by a plot.
(d) What a distant value can and cannot touch. The was already the largest observation, so replacing it by changes no sorted position. Minimum, , , , the IQR, both sets of fences and both whisker ends are all unchanged; in the five-number summary only the maximum becomes . The classification does change: , so the point is now an extreme outlier. The mean rises by ms to ms, which now exceeds ten of the eleven observations — the skew diagnosis in (c) is sharpened, and the IQR's indifference to the tail is the robustness claim made concrete.
- 8.Computation
In a course, the midterm had mean and standard deviation ; the final had mean and standard deviation . A student scored on the midterm and on the final. Nothing is known about the shape of either score distribution unless a part says so.
- (a)Compute both z-scores and say on which exam the student did relatively better.
- (b)The instructor curves the midterm by . Recompute the student's midterm z-score on the curved scale, then prove in general that a linear rescaling with leaves every z-score unchanged. What happens if ?
- (c)Using only the mean and standard deviation, what is the largest possible fraction of final-exam scores lying outside ? Name the result used. What fraction would you expect outside that interval if the final scores were approximately normal?
- (d)Within how many standard deviations of the mean must at least of the final scores lie, whatever the shape of the distribution? Give the corresponding interval of scores.
Solution
(a) Standardise. and . The midterm was the relatively better performance: standard deviations above its mean against , even though the raw final score is higher. The z-score is the common ruler that makes the two comparable.
(b) Invariance under rescaling. On the curved scale the mean is , the standard deviation is (by the proposition on the variance under a linear transformation, ), and the student's score is . So , unchanged.
In general, with : and , hence
If then , and the same computation gives : a reflection swaps which side of the mean each score is on, so every z-score changes sign but not size.
(c) Chebyshev with . . Chebyshev's inequality, which needs only a finite variance, gives , so at most of scores lie outside the interval. Under approximate normality the empirical rule puts about inside , so only about outside. The universal guarantee is far weaker than the normal figure, as it must be — it has to hold for the worst-case shape.
(d) Solve for . We need , i.e. , i.e. , so . Then and the interval is . Its upper end exceeds any score the exam could award, which is a reminder that Chebyshev uses only two numbers and knows nothing about the scale of the data; the bound is a guarantee, not a description.
- 9.Proof
Let with be sample data with standard deviation , and let be the standardised values.
- (a)Prove directly from the definitions of and that and .
- (b)Deduce that no observation in a sample of size can have . For which sample sizes is a “four standard deviation” observation impossible?
- (c)Let and let be the number of observations with . Prove that . Compare with Chebyshev's inequality, and explain why this bound needs no assumption about the data at all — not even that they are a random sample.
Solution
(a) Two sums. Since does not depend on ,
using , the definition of the mean rearranged. For the squares, the definition says , so
(These are the statements and of the proposition on standardised data, proved here without the linear-transformation propositions.)
(b) A bound on every z-score. Every term is non-negative, so for any fixed ,
A value with requires , i.e. ; for it is impossible. In a sample of no z-score can exceed . Equality in the bound would need every other to be , i.e. every other , but then the deviations summing to zero would force as well and ; so the bound is never attained for , though it is the right order of magnitude. The practical moral: an “outlier” rule of the form cannot fire in a small sample, however extreme the point, which is one reason Tukey's fences are preferred.
(c) A Chebyshev inequality for data. Discard the non-negative terms that do not satisfy the condition, then bound each remaining term below:
Dividing by gives .
Chebyshev's inequality says for a random variable with finite variance; this is the same statement for the empirical distribution of a dataset, and slightly stronger, by the factor that Bessel's divisor introduces. It rests on nothing probabilistic: it is an algebraic inequality about fixed numbers, so there is no randomness, no independence and no distribution to assume. (Chebyshev's own hypothesis is almost as light — only a finite variance — which is why both bounds are loose: they must survive the worst possible shape.)
- 10.Sketch
Twenty waiting times at a clinic, in minutes, already sorted:
- (a)Using bins of width starting at — — tabulate the counts and sketch the histogram. Describe its shape (modality and skew).
- (b)Compute the five-number summary, the IQR and Tukey's mild fences, and identify any outliers.
- (c)Directly beneath the histogram, on the same horizontal axis, draw the box plot. Mark on it every feature it preserves from the histogram, and name one feature of the histogram it loses.
- (d)Compute the mean, mark both the mean and the median on the histogram, and explain — citing the two minimisation theorems — why they fall in the order they do.
Solution
(a) Counts and shape. Binning the sorted list:
: — count . : — count . : — count . : — count . : — count . : — count . : none — count . : — count . Total . ✓
The histogram has bars of heights over those intervals, with the horizontal axis labelled “waiting time (minutes)” and the vertical “count”. It is unimodal, peaking in , and right-skewed: the bars fall off steeply to the left (nothing below ) and slowly to the right, with a tail reaching , an empty bin at and an isolated bar beyond it.
(b) Five-number summary. is even, so the median is . The lower half is the first ten values, whose median is ; the upper half is , whose median is . The summary is and . The mild fences are and . The single outlier is ; it is mild, not extreme, since the extreme fence is .
(c) The box plot beneath. On the same axis draw a box from to with a line at ; a lower whisker from down to the minimum (inside the fence); an upper whisker from to , the largest value not exceeding ; and as a separate point.
Preserved: the centre (the median line sits under the tall left-of-centre bars), the spread of the middle half (the box), the skew (the median is left of the box's centre, from but from , and the upper whisker, of length , is more than twice the lower one, of length ), and the outlier. Lost: modality — the box cannot show that the data pile up in rather than being spread evenly across — and the gap at . Five numbers do not determine a shape.
(d) Mean against median. The first ten values sum to and the last ten to , so . Mark the median at and the mean at , both inside the bar, with the mean to the right.
The order is what right skew predicts, and the two minimisation theorems say why. The mean minimises , so the far-out values and contribute squared distances that grow fast, and the minimiser is dragged toward them. The median minimises , whose slope between data points is the count on the left minus the count on the right — so counts exactly once, like every other observation, and its distance is irrelevant.
- 11.Critique
An internal report on customer waiting times at two branches contains the following four claims. Each is wrong. For each claim, identify the error, name the result or principle it violates, and give the corrected statement — with the corrected number wherever one can be computed.
- (a)“Branch A served customers with a mean wait of minutes; Branch B served customers with a mean wait of minutes. The company-wide mean wait is therefore minutes.”
- (b)“At Branch B the mean wait is minutes but the median is only . Since the mean uses every observation and the median throws most of them away, the mean is the more informative summary of a typical wait at B.”
- (c)“Applying the rule to Branch B flagged of the waits as outliers. These were deleted before computing the standard deviation, so the reported is now free of contamination.”
- (d)“Using the corrected company-wide mean of minutes and minutes, a customer who waited minutes has and is therefore at the th percentile, so fewer than of customers waited longer.”
Solution
(a) Averaging averages. The error is treating the two branch means as equally weighted. By the proposition on the combined mean of two groups, the pooled mean is weighted by group size:
The figure would be right only if the branches had served equally many customers; with A four times busier, the truth sits much closer to A's .
(b) Wrong centre for a skewed distribution. A mean of against a median of says, by the proposition that skew separates the mean from the median, that the waits at B are strongly right-skewed: a few very long waits. “Uses every observation” is the mean's weakness here, not its strength — the mean minimises total squared deviation, so it chases the tail, while the median minimises total absolute deviation and only counts observations, so it stays with the bulk. The recipe for choosing a summary says: skewed data or unremovable outliers, report the median and IQR. Corrected statement: “A typical wait at B is about minutes (median, ); the mean of is inflated by a few very long waits and should be reported with the IQR, not on its own.”
(c) A flag is not a licence to delete. Tukey's fences are calibrated on normal data, where they flag about of values. On right-skewed waiting times the long tail is the distribution, not a contamination of it, and the rule flags legitimate observations wholesale — out of is itself evidence of skew, not of three errors. Deleting them removes the longest waits from the record, biases downward, and produces a summary of a dataset that does not exist. Corrected procedure: investigate each flagged wait and delete only if a recording error is found; otherwise keep all , report the five-number summary and IQR (which the tail cannot distort) alongside computed on all the data, and state .
(d) A z-score is not a percentile. The computation is fine. The conversion of into the th percentile assumes a normal distribution, and the data are not normal: they are right-skewed by (b), and waits cannot be negative while a normal with , extends well below zero. Without a shape, only Chebyshev's inequality applies: . Since , the event is exactly — the lower tail is empty — so the honest statement is “at most of customers waited minutes or longer; nothing sharper can be said from and alone.” The figure is unsupported, and on skewed data could be badly wrong in either direction.
- 12.Proof
Group consists of values with mean and within-group sum of squares ; group likewise has , and . Let be the mean of the pooled data of values.
- (a)Prove that , and name the identity that does the work.
- (b)Show that the last two terms together equal .
- (c)Group : , , . Group : , , . Find the pooled mean, the pooled sum of squares, and the sample variance of the pooled ten values.
- (d)Your answer in (c) exceeds both and . Explain why this is not a contradiction, and state the one condition under which the pooled variance is a weighted average of the two group variances.
Solution
(a) Decompose each group about its own mean. Within group , write and expand the square:
The middle sum is the total deviation of group from its own mean, which is zero by the proposition that deviations from the mean sum to zero. What remains is — this is exactly the identity from the theorem that the mean minimises total squared deviation, applied to group with . The same computation for group gives , and since every observation belongs to exactly one group, adding the two gives the claim.
(b) The between-groups term. Since ,
Writing ,
The between-groups contribution depends only on the two sizes and the gap between the two means.
(c) Numbers. The pooled mean is . Recover each sum of squares from its variance via : and . The between term is ; as a check, . ✓ So the pooled sum of squares is and
(d) Why the pooled variance can exceed both. Each group's variance measures spread about that group's own centre. The pooled variance measures spread about , a point that group sits below and group sits above; that displacement is what the between term records, and here it outweighs the two within terms combined (). Sums of squares add; variances about different centres do not. Naively averaging and would be wrong twice over — wrong weights, and no between term at all.
The between term vanishes exactly when . Then and
a weighted average of the two variances with weights and — the degrees of freedom of each group. This is the pooled variance that a two-sample comparison of means uses, and the condition of equal group means is precisely what makes it legitimate as a description of a single spread.