Print this page and work through it on paper. Revealed answers are never printed, so you can check one question and still print a clean sheet.

  1. Show the solution to question 1

    (a) Marginals by summing the table. Column sums give the pmf of : , , . Row sums give the pmf of : and . Hence

    (b) Computational formula. Only cells with both coordinates nonzero contribute to : the cell gives and the cell gives , so . By the computational formula for the covariance,

    For the sign check, the deviations are and . In the cells , and the two deviations have the same sign, so those cells push the covariance up; in and they have opposite signs and push it down; the cell has probability zero and contributes nothing. Weighting each product of deviations by its cell probability,

    the same number from the definition. It is positive because the two heaviest cells, and together with , all sit in the agreeing quadrants.

    (c) Variance of a sum, no hypotheses. , so . is Bernoulli with , so . By the theorem on the variance of a sum, which needs no independence,

    Direct check: reading off each cell, it equals on [probability ], on and [probability ], and on and [probability ]. So , which agrees with , and , giving . ✓

    (d) Bilinearity. By the theorem on bilinearity and symmetry of covariance, additive shifts are invisible and scale factors come out of each slot: .

  2. Show the solution to question 2

    (a) Expand by bilinearity. Linearity in the first slot, then in the second, gives

    By symmetry , so the two middle terms cancel, and the outer terms are and because variance is a self-covariance. Hence .

    If the right-hand side is , which is the definition of and being uncorrelated. Nothing in the argument mentioned itself — it cancelled — so the conclusion holds however strongly and are related. (Uncorrelated is not the same as independent: for , independent with equal variances, and are uncorrelated but and are typically dependent.)

    (b) One row of the covariance matrix at a time. Fix . By linearity in the second slot,

    since the terms vanish by pairwise uncorrelatedness. For the variance, use and linearity in the first slot:

    (Equivalently, the corollary on the variance of a linear combination with all and no cross terms gives .)

    (c) Residual against mean. By bilinearity and (b),

    For the variance, apply the variance-of-a-sum theorem to :

    Each residual is a little less variable than the observations themselves, because has already absorbed a share of . Summing the residual variances gives , which is exactly why a sample variance divides the sum of squared residuals by rather than .

  3. Show the solution to question 3

    (a) Bilinearity, with the cross term killed by independence. Since and are independent, by the theorem that independence implies zero covariance. Expanding,

    the two terms cancelling by symmetry regardless. By the variance-of-a-sum theorem, and . Therefore

    (b) The general formula. The same computation gives and , so .

    Directly: since we have , so strictly.

    From the equality case of the correlation bound: would force almost surely for constants , , i.e. almost surely. If this makes an affine function of ; but is independent of , hence independent of every function of , hence independent of itself, and a variable independent of itself satisfies for every and so is constant — contradicting . If the relation reads , so is constant, contradicting . Either way an exact linear relation between and is impossible, which is what the formula was saying.

    exactly when : the sum and difference of two independent variables are uncorrelated precisely when the variances match.

    (c) Correlation is unit-free. By the proposition that : for the scale factors are and , so the sign flips and . For the factors are and , whose product is positive, so , unchanged.

  4. Show the solution to question 4

    (a) Odd symmetry kills the cross moment. The distribution of is symmetric about , so . Next takes the value with probability and with probability , so . The product takes the values with probability each, so . By the computational formula,

    and are uncorrelated.

    (b) One failing pair of events suffices. Take and . They cannot both happen, since forces , so . But . The product rule fails, so and are not independent. (Indeed is a function of : they are as dependent as possible, and still uncorrelated.)

    (c) Two routes to . . , so . By the variance-of-a-sum theorem,

    Directly: equals when or , equals when , and equals when . So is with probability , with probability , with probability . Then and , so . ✓

    The hypothesis used to drop the cross term is only — uncorrelatedness. It is not independence, and (b) shows independence is false here; the identity did not need it.

    (d) Where uncorrelatedness stops. takes the values with probability each, so . On the other hand . They are not equal.

    Uncorrelated means exactly one factorisation, . Independence would give for every pair of functions, and here , already breaks it. So for an uncorrelated pair you may add variances, but you may not factorise expectations of products of arbitrary functions — that requires genuine independence.

  5. Show the solution to question 5

    (a) Slice, then normalise. For the marginal is

    which integrates to over as it must. The conditional density is the joint divided by the marginal:

    and . ✓ Its mean is

    Given , the variable has a density increasing linearly across , so its mean sits two-thirds of the way along — a sensible answer.

    (b) Substitute the random variable for the value. The function evaluated at gives the random variable . The number .

    For the variance of we need the moments of : and , so . Hence

    is the single number : the mean of in the sub-population where . A number has no distribution, so asking for its variance is a type error (or, if one insists, trivially ). Only the random variable , which varies with , has a variance worth computing — and it is , not .

    (c) Taking out what is known. Conditional on , the factor is a constant, so by the take-out-what-is-known property . For the second moment, compute in the conditional world:

    (d) Condition the other way. The marginal of is, for ,

    and . ✓ Then

    and

    using and . Sanity checks: as the value tends to , and at it is , the mean of the density on .

    For the inequality, is equivalent to , i.e. , i.e. , which holds throughout . This had to be true: given , the variable lives on , so its conditional mean exceeds .

  6. Show the solution to question 6

    (a) Condition on the bias. Given the count is binomial with and success probability , so ; substituting the random variable, . By the tower property,

    For the probability, write it as the expectation of an indicator and condition: , and . So

    By contrast , about half as large. The tower property averages the conditional probabilities ; it does not let you average first and then raise to the fourth power, because is not linear. (It is convex, so the true answer is the larger one — that is Jensen's inequality.)

    (b) Wald's identity. Let be the number of items bought by the -th customer and . The are i.i.d. with finite mean

    is non-negative integer valued with finite mean , and is independent of the sequence . Those are exactly the hypotheses of Wald's identity. Conditioning on : on the sum has terms whose distribution is unaffected by the conditioning, so and . Then

    (c) First-step analysis. Condition on the first toss, and if it is a head, on the second. Three cases cover everything:

    First toss tails (probability ): one toss has been spent and nothing has been achieved. The tosses that follow are a fresh independent sequence, so the remaining wait has the same distribution as : .

    First toss heads, second tails (probability ): two tosses spent, and again the process restarts from scratch: .

    First two tosses heads (probability ): finished, .

    By the tower property (the law of total expectation over these three events),

    Hence and . The finiteness of is what permits subtracting from both sides. Sanity check: a single head takes tosses on average, and a run of two must take longer; is plausible.

  7. Show the solution to question 7

    (a) Three errors, one per step.

    Step 1 averages without weights. The tower property says : the group means are weighted by group size. A plain average is right only when the groups are equally likely, and here they are not. This changes the number: , not .

    Step 2 drops a term and again forgets the weights. The law of total variance has two terms, ; writing only the first is not the law. Also, the within term is itself a weighted average, . Because the two conditional variances happen to be equal, the missing weights do not change the number here ( either way) — but the method is wrong and would fail the moment the sections had different spreads, as (c) shows.

    Step 3 is a type error. is indeed a number, but is the variance of the random variable , which equals on and on — it takes two values and is not constant. Confusing the number with the random variable is precisely what makes the between-group term disappear. This changes the number.

    (b) The correct computation. from above.

    Between term: takes with probability and with probability , with mean , so

    (For a two-point variable this is , a useful check.)

    Within term: .

    By the law of total variance, , so the standard deviation is , a little over rather than . The fraction explained by section is the between share, .

    (c) Only the within term moves. The conditional means are untouched, so the between term is still . The within term becomes — and now the unweighted average would be wrong, which is the error Step 2 was lucky to hide. Hence .

  8. Show the solution to question 8

    (a) Within plus between. Given , the count is binomial, so and . The moments of : and , so .

    Within:

    Between:

    By the law of total variance, .

    A fair coin tossed four times has variance . The mixture is more variable by : not knowing the bias adds a between-group term of that a fixed coin does not have (it also trims the within term slightly, from to , because is largest at , but the between term dominates).

    (b) Variance of a random sum. With the items bought by customer : , , so . For a Poisson, . By the corollary on the variance of a random sum,

    The first term, , is the within part (uncertainty about how much each customer buys); the second, , is the between part (uncertainty about how many customers there are).

    In general, when is Poisson with mean the two coefficients coincide, , so

    by the computational formula for the variance. Here . ✓

    (c) Direct check via . In the conditional world, . By the tower property,

    Since , , agreeing with (a). ✓

  9. Show the solution to question 9

    (a) The conditional mean and its error. The group means are , , . So takes the values , , with probability each — note it is not monotone in .

    By the theorem that conditional expectation minimises mean squared error, its error is . The conditional variances are , and for the two-point groups and , each symmetric about its mean at distance , . Hence

    (b) The best line. First the moments. and . By the tower property and, taking out what is known, , so . For , takes the values , , , so and .

    By the proposition on the best linear predictor,

    so the best line is , predicting , , at .

    Via the formula: , so the error is .

    Via the decomposition: the gaps between the line and at are , , , with squares , , and mean . Adding the irreducible error from (a), . ✓ (The cross term vanishes because is uncorrelated with every function of , which is what makes the decomposition Pythagorean.)

    (c) The best constant. By the corollary on the best constant predictor, the minimiser is with error . Ranking the errors: conditional mean best line best constant . Each enlargement of the class of allowed predictors can only help, and here each one does.

    (d) Two different fractions of variance explained. is the fraction of removed by the best linear predictor: indeed .

    , so . By the law of total variance this is the between share — the fraction of removed by the best predictor of any form, since the remaining is exactly the within term.

    They differ because is not a linear function of : it goes , and a straight line can only capture the tilt of that pattern, not its bend. The gap of the variance is the price of insisting on a line. Had been linear in , the two fractions would coincide.

  10. Show the solution to question 10

    (a) The numbers. , so . And .

    Since and , we have , with gap . This is Jensen's inequality for a convex : on , , so is strictly convex there, and takes values in with probability one.

    (b) The drawing, feature by feature. The curve is decreasing and bends upward (convex) through , , , , .

    The chord. It joins to ; its slope is and its equation is . Because is convex, the chord lies above the curve on — draw it so.

    The two marked points above . On the chord, ; on the curve, . Label them and ; the vertical gap between them is .

    Why the chord point is . The point is a weighted average of the two endpoints of the chord, with the weights of the distribution, so it lies on the chord. Its -coordinate is and its -coordinate is . So the chord point above is not a generic average — it is the exact point , sitting one quarter of the way from to . The curve point below it is . Jensen's inequality is the statement that the first lies above the second.

    The supporting line at . Since is differentiable the supporting line is the tangent, with slope :

    It touches the curve at and lies below the curve everywhere else. At its height is , and at it is ; mark both crossings. (It meets the -axis at .) A check that reproduces the proof of Jensen: the expected height of the tangent at is , because a line through has expectation when . Since lies above the tangent at both mass points, — the picture is the proof.

    (c) Equality, and the concave case. Equality in Jensen would mean the chord point coincides with the curve point . For a strictly convex curve the chord lies strictly above the graph between its endpoints, so the two points can only coincide if the chord has no interior — its endpoints are the same point — i.e. the two mass points of are equal and is constant almost surely. That is the equality clause of Jensen's inequality for strictly convex .

    For : , so is strictly concave and the inequality reverses. Numerically , while ; since , we have . ✓ The feature that reverses is the position of the chord: for a concave curve the chord lies below the graph, so the point now sits under the curve point rather than over it, and the supporting line sits above the curve.

  11. Show the solution to question 11

    (a) The prediction error is orthogonal to every function of . By the tower property,

    Inside, is a function of , so by the property taking out what is known it passes through the conditional expectation:

    where the middle step uses linearity of conditional expectation and, once more, taking out what is known applied to , itself a function of . The outer expectation of the zero random variable is .

    For the covariance, bilinearity gives , and by the computational formula

    since the first term vanishes by what was just proved and by the tower property. Hence .

    (b) Regression only sees the conditional mean. By the proposition on the best linear predictor, the line predicting from has slope and intercept . Take in (a): , so the slope is the same for ; and by the tower property, so the intercept is the same too. The two best lines coincide.

    For the bound, . If then is almost surely constant, its covariance with is , and the inequality reads . Otherwise the correlation bound (Cauchy–Schwarz applied to the centred pair and ) gives , and dividing,

    The variance explained linearly can never exceed the variance explained by conditioning.

    (c) Pythagoras for variances. Write . By the variance-of-a-sum theorem,

    Apply (a) with (legitimate since ): the covariance is . The cross term vanishes and the identity follows.

    Since , we get . Equality holds if and only if , i.e. is almost surely equal to a constant; that constant is its mean, which is by the tower property. So equality holds if and only if almost surely — is a function of , and conditioning on leaves nothing unexplained.

    As for the law of total variance: has mean , so , and by the tower property this is . The inner quantity is, by definition, — the variance of about its conditional mean, computed in the conditional world. So the identity reads , which is the law of total variance, with the within term revealed as the variance of the best predictor's error and the between term as the variance of the prediction itself.

  12. Show the solution to question 12

    (a) AM–GM is Jensen for the logarithm. Let be the random variable taking the value with probability (if some values coincide, their probabilities add). Then with probability one, , and by the law of the unconscious statistician .

    On , has , so it is strictly concave. Jensen's inequality for a concave function gives , that is,

    Since is increasing, .

    By the equality clause for a strictly concave (equivalently, strictly convex) function, equality holds if and only if is almost surely constant. Every is positive, so each is a value taken with positive probability, and "almost surely constant" means all equal that one constant. Conversely if all both sides equal .

    (b) Lyapunov's inequality. Put and , so that and . First, is finite: for we have (if then ; if then because ), so by monotonicity of expectation . Thus has a finite mean in , and exists.

    The function on is convex: on its second derivative is positive because , and is continuous at , so the chord condition holds on the whole closed half-line. By Jensen's inequality,

    Both sides are non-negative and is increasing on , so raising both sides to the power preserves the inequality:

    (As is strictly convex, equality holds if and only if , hence , is almost surely constant.)

    (c) The case , , and a numerical check. With , the inequality reads , i.e. for — the statement that a variance is non-negative. The Cauchy–Schwarz inequality for random variables, applied to the pair and , gives

    the same inequality; and its equality clause — proportional to the constant almost surely — is the same as Jensen's: almost surely constant.

    For the two-point variable, , so , while . Lyapunov with , predicts , and indeed — strictly, as it must be since is not constant. ✓

Full solutions sheet →