CalcPath
ProgressProblem setsFeedback
← Question sheet

Statistics · Solutions

Statistical Inference: Estimation

12 questions · about 108 minutes

Work this sheet on paper and show every step: the solutions are written out as methods, so that you can check your route and not just your final number. Name every result you lean on (“by the bias–variance decomposition”, “by the invariance of maximum likelihood”, “by the pivotal method”) and state the hypotheses it needs — normal population? known σ? independence? — each time you use it. No calculator is needed: every number has been chosen to come out exactly, and wherever a critical value is required it is given in the question. Full worked solutions are on a separate page; each question also has its own reveal, so you can check one answer without seeing the rest.

  1. 1.Computation

    A population has mean μ and variance σ2>0, and X1​,…,Xn​ is an i.i.d. sample from it with n≥2. Three estimators of μ are proposed:

    μ^​A​=Xˉ,μ^​B​=2X1​+X2​​,μ^​C​=n+1n​Xˉ.

    1. (a)Find the bias and the variance of each estimator.
    2. (b)Find the mean squared error of each, and show that μ^​C​ beats Xˉ on MSE exactly when μ2<(2+n1​)σ2. Then evaluate all three MSEs for n=4, μ=2, σ=2.
    3. (c)Which of the three are consistent for μ? Where a theorem settles it, name the theorem; where an estimator is not consistent, argue directly from the definition.

    Solution

    (a) Expectations and variances. By the theorem Mean and variance of the sample mean, E(Xˉ)=μ and Var(Xˉ)=σ2/n, so μ^​A​ has bias 0 and variance σ2/n.

    μ^​B​ is itself the sample mean of a sample of size 2, so E(μ^​B​)=μ and the bias is 0; by independence the variances add, Var(μ^​B​)=41​(σ2+σ2)=σ2/2.

    For μ^​C​, linearity of expectation gives E(μ^​C​)=n+1n​μ, so

    Bias(μ^​C​)=n+1n​μ−μ=−n+1μ​,Var(μ^​C​)=(n+1n​)2nσ2​=(n+1)2nσ2​,

    the constant coming out of the variance squared.

    (b) Bias–variance decomposition. MSE=Var+Bias2, so

    MSEA​=nσ2​,MSEB​=2σ2​,MSEC​=(n+1)2nσ2​+(n+1)2μ2​=(n+1)2nσ2+μ2​.

    MSEC​<MSEA​ if and only if n(nσ2+μ2)<(n+1)2σ2. Expanding the right side, n2σ2+nμ2<n2σ2+2nσ2+σ2, which is nμ2<(2n+1)σ2, i.e. μ2<(2+n1​)σ2. Shrinking toward zero pays when the true mean is within about 2​ population standard deviations of zero: the bias it introduces is then smaller than the variance it removes.

    With n=4, μ=2, σ=2: MSEA​=4/4=1, MSEB​=4/2=2, and MSEC​=(16+4)/25=4/5. Check against the criterion: μ2=4<49​⋅4=9 ✓, so μ^​C​ should win, and it does.

    (c) Consistency. μ^​A​ is consistent by the corollary The sample mean is consistent. For μ^​C​, the bias −μ/(n+1)→0 and the variance nσ2/(n+1)2≤σ2/n→0, so MSEC​→0 and the theorem MSE consistency gives consistency.

    μ^​B​ has MSE=σ2/2, which does not vanish — but that alone proves nothing, because the theorem runs one way only (MSE to zero implies consistency). Argue from the definition. The estimator μ^​B​ does not depend on n at all, so for each ε>0 the number c(ε)=P(∣μ^​B​−μ∣≥ε) is the same for every n, and the limit as n→∞ is simply c(ε). If c(ε)=0 for every ε>0, then taking ε=1/k and a countable union gives P(μ^​B​=μ)=0, so Var(μ^​B​)=0 — contradicting Var(μ^​B​)=σ2/2>0. Hence some ε has c(ε)>0, the probability does not tend to 0, and μ^​B​ is not consistent.

    The moral: discarding n−2 observations keeps unbiasedness perfectly intact and destroys consistency.

  2. 2.Proof

    Two independent, unbiased estimators θ^1​ and θ^2​ of the same parameter θ have variances v1​>0 and v2​>0 — think of the means of two independent surveys of different sizes. For a real number w define the combination

    θ^w​=wθ^1​+(1−w)θ^2​.

    1. (a)Prove that θ^w​ is unbiased for every w, and find Var(θ^w​) as a function of w.
    2. (b)Prove that the variance is minimised at w∗=v1​+v2​v2​​ and that the minimum value is v1​+v2​v1​v2​​.
    3. (c)Prove that this minimum is strictly smaller than both v1​ and v2​. Then take θ^1​=Xˉ1​ and θ^2​=Xˉ2​, the means of independent samples of sizes n1​ and n2​ from one population with variance σ2: identify θ^w∗​ and its variance.

    Solution

    (a) Linearity. E(θ^w​)=wE(θ^1​)+(1−w)E(θ^2​)=wθ+(1−w)θ=θ for every real w — no restriction to [0,1] is needed for unbiasedness. Since the two estimators are independent, the variance of the sum is the sum of the variances, and constants come out squared:

    Var(θ^w​)=w2v1​+(1−w)2v2​=:g(w).

    (b) Minimise the parabola. g′(w)=2wv1​−2(1−w)v2​, which vanishes when w(v1​+v2​)=v2​, i.e. at w∗=v2​/(v1​+v2​). Since g′′(w)=2(v1​+v2​)>0, g is a convex parabola and the stationary point is its global minimum. With 1−w∗=v1​/(v1​+v2​),

    g(w∗)=(v1​+v2​)2v22​v1​​+(v1​+v2​)2v12​v2​​=(v1​+v2​)2v1​v2​(v2​+v1​)​=v1​+v2​v1​v2​​. ■

    Equivalently g(w∗)=1/(1/v1​+1/v2​): the precisions (reciprocal variances) add, and each estimator is weighted in proportion to its precision.

    (c) The combination beats both. v1​+v2​v1​v2​​<v1​ is equivalent, after multiplying by the positive v1​+v2​ and dividing by v1​>0, to v2​<v1​+v2​, i.e. v1​>0, which holds. By symmetry the minimum is also below v2​. ■

    So throwing the noisier estimator away (which is w=1 or w=0) is never optimal: however poor it is, it carries some information, and the right weight extracts it. For instance if v2​=9v1​ the minimum is 9v12​/(10v1​)=0.9v1​, a 10% reduction bought from an estimator nine times noisier.

    Sample means. Here vi​=σ2/ni​, so

    w∗=σ2/n1​+σ2/n2​σ2/n2​​=(n1​+n2​)/(n1​n2​)1/n2​​=n1​+n2​n1​​,

    and therefore

    θ^w∗​=n1​+n2​n1​Xˉ1​+n2​Xˉ2​​=n1​+n2​sum of all n1​+n2​ observations​,

    the grand mean of the pooled sample. Its variance is σ2/(n1​+n2​), which agrees with the formula: σ2/n1​+σ2/n2​(σ2/n1​)(σ2/n2​)​=n1​+n2​σ2​ ✓. Sample means are to be weighted by sample size, not averaged equally.

  3. 3.Computation

    Lifetimes X1​,…,Xn​ are modelled as i.i.d. exponential with rate λ>0, density f(x;λ)=λe−λx for x≥0, for which E(X)=1/λ. Three observed lifetimes are 2, 3 and 7.

    1. (a)Find the method of moments estimator of λ and evaluate it on the data.
    2. (b)Find the maximum likelihood estimator of λ: write the log-likelihood, solve the score equation, and confirm that the stationary point is the global maximum over λ>0.
    3. (c)By naming the theorem that allows it, write down the MLE of the mean lifetime 1/λ and of the survival probability P(X>6)=e−6λ. Then decide, with justification, whether the MLE of the mean is unbiased and whether the MLE of λ is unbiased.

    Solution

    (a) Match the first moment. One parameter needs one equation: set the population mean equal to the sample mean, 1/λ=xˉ, so λ~=1/xˉ. On the data xˉ=(2+3+7)/3=4 and λ~=1/4.

    (b) Maximum likelihood. The likelihood is

    L(λ)=i=1∏n​λe−λxi​=λne−λ∑xi​,ℓ(λ)=nlogλ−λi=1∑n​xi​.

    The score is ℓ′(λ)=n/λ−∑xi​, which vanishes at λ^=n/∑xi​=1/xˉ. Second derivative: ℓ′′(λ)=−n/λ2<0 for every λ>0, so ℓ is strictly concave on (0,∞); a strictly concave function has at most one stationary point and it is the global maximum. The boundary check confirms it: ℓ→−∞ as λ→0+ (the nlogλ term) and as λ→∞ (the −λ∑xi​ term dominates), so nothing larger hides at the edges. On the data λ^=3/12=1/4, agreeing with the method of moments.

    (c) Invariance. By the theorem Invariance of maximum likelihood, the MLE of any function of λ is that function of λ^. So the MLE of the mean 1/λ is 1/λ^=xˉ=4, and the MLE of P(X>6)=e−6λ is e−6/4=e−3/2.

    Is Xˉ unbiased for 1/λ? Yes: E(Xˉ)=E(X)=1/λ by linearity.

    Is λ^=1/Xˉ unbiased for λ? No. The map u↦1/u is strictly convex on (0,∞) and Xˉ is not a constant, so Jensen's inequality gives E(1/Xˉ)>1/E(Xˉ)=λ: the MLE of the rate is biased upward. (One can show E(λ^)=n−1n​λ for n≥2, so for these three observations the estimator overshoots by 50% on average.) Invariance transports the maximiser through g; it says nothing about expectations, which is why unbiasedness has no invariance property.

  4. 4.Sketch

    Four observations from a Uniform(0,θ) population are 1, 2, 3 and 10. The density is f(x;θ)=1/θ for 0≤x≤θ and 0 otherwise.

    1. (a)Write the likelihood L(θ) as an explicit piecewise formula valid for every θ>0, and explain why it is zero on part of its domain.
    2. (b)Sketch L(θ) for 0<θ≤20, measuring the vertical axis in units of 10−4. Mark the maximum likelihood estimate and the value of L there, plot the exact values at θ=12, 15 and 20, and mark where the method of moments estimate 2xˉ falls. Every feature you draw must be justified.
    3. (c)Explain why solving ℓ′(θ)=0 produces nothing here, and say which step of the maximum likelihood recipe locates the estimate instead.
    4. (d)Given that E(X(n)​)=n+1n​θ for the sample maximum, produce an unbiased estimator from the MLE and evaluate it. Explain why it must sit to the right of the MLE on your sketch.

    Solution

    (a) The likelihood is a product of indicator-like factors. Each factor f(xi​;θ) equals 1/θ if θ≥xi​ and 0 otherwise, so the product is nonzero only when θ is at least every observation, i.e. θ≥maxi​xi​=10:

    L(θ)={0,θ−4,​0<θ<10,θ≥10.​

    It is zero below 10 because a Uniform(0,θ) population with θ<10 cannot produce the observation 10: such a θ assigns the observed data density zero, and a single zero factor kills the whole product.

    (b) The sketch. Axes: θ from 0 to 20 horizontally, L vertically in units of 10−4, so that L(10)=10−4 is 1 unit.

    Zero segment. From θ=0 to θ=10 the graph runs along the horizontal axis.

    Jump at θ=10. At θ=10 the value is 10−4=1 unit, and it belongs to the curve (a filled dot), because x≤θ is allowed with equality. So the graph jumps vertically from 0 to 1 unit; the point just to the left is at height 0.

    Decreasing tail. For θ>10, L(θ)=θ−4 is strictly decreasing (L′=−4θ−5<0) and convex (L′′=20θ−6>0), bending toward the axis without reaching it. Exact values, in units of 10−4: L(12)=(10/12)4=(5/6)4=625/1296≈0.48, L(15)=(2/3)4=16/81≈0.20, L(20)=(1/2)4=1/16=0.0625.

    The MLE. The highest point of the graph is the top of the jump, at θ=10: mark θ^=10 with L(θ^)=10−4.

    The method of moments estimate. xˉ=(1+2+3+10)/4=4, so 2xˉ=8. Mark θ=8 on the axis; there L(8)=0. The sketch shows at a glance what is wrong with it: the estimate lies in the region the data have ruled out, since the observed 10 cannot come from Uniform(0,8).

    (c) No stationary point. On θ≥10, ℓ(θ)=−4logθ and ℓ′(θ)=−4/θ<0, never zero; below 10 the likelihood is identically zero and ℓ is undefined. So "differentiate and solve" returns nothing. It is step 4 of the recipe, check the boundary, that finds the answer: the parameter values compatible with the data form [10,∞), L is decreasing there, so the maximum is at the left endpoint θ^=x(4)​=10, a point where the derivative is not zero because the graph has a jump, not a peak.

    (d) The unbiased correction. From E(X(n)​)=n+1n​θ, the estimator nn+1​X(n)​ has expectation θ. With n=4 it is 45​⋅10=12.5.

    It lies to the right of the MLE because the correction multiplies by nn+1​>1, and the reason it should is visible on the sketch: the maximum of four draws can never exceed θ, so it systematically falls short of the true ceiling and must be inflated to be right on average. On the graph, 12.5 sits on the decreasing tail at height (10/12.5)4=(4/5)4=256/625≈0.41 units — a lower likelihood than the MLE, but a positive one. The two estimators disagree because they optimise different things: fit to the data in hand, against correctness on average over repeated samples.

  5. 5.Computation

    Let X1​,…,Xn​ be i.i.d. Uniform(0,θ) with n≥2. Three estimators of θ are in play: the maximum likelihood estimator θ^ML​=X(n)​=maxi​Xi​, its unbiased correction θ^U​=nn+1​X(n)​, and the method of moments estimator θ^MM​=2Xˉ. You may use that X(n)​ has density g(x)=θnnxn−1​ on [0,θ], and that a Uniform(0,θ) variable has variance θ2/12.

    1. (a)Compute E(X(n)​) and E(X(n)2​), and hence show that Var(X(n)​)=(n+1)2(n+2)nθ2​.
    2. (b)Find the mean squared error of each of the three estimators as an exact function of n and θ.
    3. (c)Rank the three by MSE for n≥3, proving each inequality, and find the one value of n at which two of them tie. Evaluate all three MSEs for n=4, θ=10.
    4. (d)The Cramér–Rao bound says an unbiased estimator's variance is at least 1/(nI(θ)), which is of order 1/n — yet θ^U​ is unbiased with variance of order 1/n2. Identify the hypothesis of the theorem that fails for this model, and demonstrate the failure by computing the expectation of the score.

    Solution

    (a) Moments of the maximum. Integrate against the given density:

    E(X(n)​)=∫0θ​x⋅θnnxn−1​dx=θnn​⋅n+1θn+1​=n+1nθ​,E(X(n)2​)=θnn​⋅n+2θn+2​=n+2nθ2​.

    Then

    Var(X(n)​)=n+2nθ2​−(n+1)2n2θ2​=nθ2(n+2)(n+1)2(n+1)2−n(n+2)​=(n+1)2(n+2)nθ2​,

    since (n+1)2−n(n+2)=n2+2n+1−n2−2n=1.

    (b) Three MSEs by the bias–variance decomposition.

    MLE. Bias =n+1nθ​−θ=−n+1θ​, so

    MSEML​=(n+1)2(n+2)nθ2​+(n+1)2θ2​=(n+1)2(n+2)θ2(n+n+2)​=(n+1)(n+2)2θ2​.

    Unbiased correction. Zero bias, and the constant comes out squared:

    MSEU​=(nn+1​)2(n+1)2(n+2)nθ2​=n(n+2)θ2​.

    Method of moments. E(2Xˉ)=2⋅θ/2=θ, unbiased, and Var(2Xˉ)=4Var(Xˉ)=4⋅nθ2/12​, so MSEMM​=3nθ2​.

    (c) Ranking. MSEU​<MSEML​ iff n(n+2)1​<(n+1)(n+2)2​ iff n+1<2n iff n>1: true for every n≥2. MSEML​<MSEMM​ iff (n+1)(n+2)2​<3n1​ iff 6n<n2+3n+2 iff n2−3n+2>0 iff (n−1)(n−2)>0 iff n≥3. So for n≥3,

    MSEU​<MSEML​<MSEMM​,

    and the tie is at n=2, where MSEML​=2θ2/12=θ2/6=MSEMM​.

    With n=4, θ=10: MSEU​=100/24=25/6, MSEML​=200/30=20/3, MSEMM​=100/12=25/3. The corrected maximum has half the error of the method of moments, and the gap widens with n: the maximum-based errors fall like 1/n2, the moment-based error like 1/n, so the ratio grows like n/3.

    (d) The regularity conditions fail. The Cramér–Rao theorem rests on the lemma The score has mean zero, which is proved by differentiating ∫f(x;θ)dx=1 under the integral sign. That step needs the support of f not to depend on θ; here the support is [0,θ], and moving θ moves the endpoint of the integral, producing a boundary term the lemma ignores. The failure is checkable: on the support, logf(x;θ)=−logθ, so the score is ∂θ​logf=−1/θ, a constant, and

    E[∂θ​logf(X;θ)]=−θ1​=0.

    The first conclusion of the lemma is false for this model, so the bound built on it does not apply, and there is nothing to stop an unbiased estimator from converging at the faster rate 1/n2. This is the general pattern: when the parameter sets the edge of the support, the extreme observations carry far more information than any average of the sample.

  6. 6.Computation

    In each model below a single observation X has the stated mass function. Work with one observation first, then with an i.i.d. sample of size n.

    1. (a)Poisson: f(x;λ)=e−λλx/x! for x=0,1,2,…, with E(X)=Var(X)=λ. Find the score, verify directly that it has mean zero, and compute I(λ) twice — once as the variance of the score and once as the expected curvature — checking that the two agree.
    2. (b)State the Cramér–Rao bound for unbiased estimators of λ from n observations, and show that Xˉ attains it.
    3. (c)Bernoulli: f(x;p)=px(1−p)1−x for x∈{0,1}. Show that I(p)=p(1−p)1​ and that p^​=Xˉ is efficient.
    4. (d)In the Poisson model, T=21​(X1​+Xˉ) is unbiased for λ. Find its efficiency as a function of n, check that the value at n=1 is what it must be, and describe what happens as n→∞.

    Solution

    (a) Poisson. logf(x;λ)=−λ+xlogλ−logx!, so the score is

    ∂λ∂​logf=λx​−1.

    Its mean is E(X)/λ−1=λ/λ−1=0, as the lemma The score has mean zero promises. As a variance: I(λ)=Var(X/λ−1)=Var(X)/λ2=λ/λ2=1/λ. As curvature: ∂λ2​logf=−x/λ2, so −E[∂λ2​logf]=E(X)/λ2=1/λ. The two agree ✓. Note the information decreases as λ grows: a Poisson with large mean is also a Poisson with large spread, and each count pins λ down less tightly.

    (b) The bound and Xˉ. By the theorem Cramér–Rao lower bound, every unbiased estimator of λ has Var(λ^)≥nI(λ)1​=nλ​. The sample mean is unbiased, E(Xˉ)=λ, with Var(Xˉ)=Var(X)/n=λ/n by the theorem Mean and variance of the sample mean. It sits exactly on the bound, so it is efficient: no unbiased estimator of a Poisson mean can do better.

    (c) Bernoulli. logf(x;p)=xlogp+(1−x)log(1−p), so

    ∂p​logf=px​−1−p1−x​,∂p2​logf=−p2x​−(1−p)21−x​.

    Using E(X)=p and E(1−X)=1−p,

    I(p)=−E[∂p2​logf]=p2p​+(1−p)21−p​=p1​+1−p1​=p(1−p)1​.

    The bound is nI(p)1​=np(1−p)​, and p^​=Xˉ is unbiased with variance Var(X)/n=p(1−p)/n. Efficient. (Information is smallest at p=21​, where a coin is least predictable, and blows up near 0 and 1.)

    (d) A deliberately lopsided estimator. Unbiasedness: E(T)=21​(λ+λ)=λ. For the variance, X1​ and Xˉ are not independent, since X1​ is one of the terms in Xˉ:

    Cov(X1​,Xˉ)=n1​j=1∑n​Cov(X1​,Xj​)=n1​Var(X1​)=nλ​,

    the other covariances vanishing by independence. Hence

    Var(T)=41​[Var(X1​)+Var(Xˉ)+2Cov(X1​,Xˉ)]=41​[λ+nλ​+n2λ​]=4nλ(n+3)​.

    The efficiency is the bound over the actual variance:

    eff(T)=λ(n+3)/(4n)λ/n​=n+34​.

    At n=1 this is 1, as it must be: then Xˉ=X1​, T=X1​, and T is the efficient estimator itself. At n=5 the efficiency is 21​, and as n→∞ it tends to 0 — T keeps half its weight on a single observation forever, so its variance never falls below λ/4 while the bound falls like 1/n. An estimator can be unbiased for every n and still waste almost all of a large sample.

  7. 7.Proof

    Let X1​,…,Xn​ be i.i.d. N(μ,σ2) and write v=σ2 for the parameter of interest. You may quote three facts: for Z∼N(0,1), E(Z4)=3; a χk2​ variable has mean k and variance 2k; and (n−1)S2/σ2∼χn−12​.

    1. (a)With μ known, prove that I(v)=2v21​, and state the Cramér–Rao bound for unbiased estimators of σ2.
    2. (b)Prove that v^0​=n1​∑i=1n​(Xi​−μ)2 is unbiased and attains the bound.
    3. (c)Now let μ be unknown. Compute Var(S2) and the efficiency of S2 relative to the bound in (a). What has estimating μ cost?
    4. (d)Prove that the maximum likelihood estimator σ^2=n1​∑i=1n​(Xi​−Xˉ)2=nn−1​S2 has strictly smaller mean squared error than S2 for every n≥2, despite being biased.

    Solution

    (a) Information about a variance. For one observation, logf(x;v)=−21​log(2π)−21​logv−2v(x−μ)2​. Differentiating in v,

    ∂v​logf=−2v1​+2v2(x−μ)2​,∂v2​logf=2v21​−v3(x−μ)2​.

    Since E[(X−μ)2]=v, the score has mean −2v1​+2v2v​=0 (as the lemma requires), and by the curvature form of the lemma The score has mean zero, and information as curvature,

    I(v)=−E[∂v2​logf]=−2v21​+v3v​=2v21​. ■

    The theorem Cramér–Rao lower bound then says every unbiased estimator of σ2 satisfies Var≥nI(v)1​=n2v2​=n2σ4​.

    (b) The known-mean estimator is efficient. Unbiasedness is linearity: E(v^0​)=n1​∑E[(Xi​−μ)2]=v. For the variance, write (Xi​−μ)2=vZi2​ with Zi​=(Xi​−μ)/σ∼N(0,1). Then Var(Zi2​)=E(Zi4​)−(EZi2​)2=3−1=2, so Var((Xi​−μ)2)=2v2, and by independence

    Var(v^0​)=n21​⋅n⋅2v2=n2v2​,

    exactly the bound. v^0​ is efficient. ■

    (c) The price of not knowing μ. Write S2=n−1σ2​V with V∼χn−12​. Then E(S2)=σ2 (unbiased, as known) and

    Var(S2)=(n−1)2σ4​⋅2(n−1)=n−12σ4​.

    Its efficiency relative to the bound of (a) is

    2σ4/(n−1)2σ4/n​=nn−1​<1.

    S2 behaves as if it had one observation fewer: the variance it achieves with n data points is what v^0​ achieves with n−1. Estimating μ has cost exactly one degree of freedom — the same one that appears in the divisor n−1 and in the tn−1​ distribution. The loss vanishes as n→∞.

    (d) The biased MLE wins on MSE. σ^2=nn−1​S2 has E(σ^2)=nn−1​σ2, so its bias is −σ2/n, and

    Var(σ^2)=(nn−1​)2n−12σ4​=n22(n−1)σ4​.

    By the theorem Bias–variance decomposition,

    MSE(σ^2)=n22(n−1)σ4​+n2σ4​=n2(2n−1)σ4​,MSE(S2)=Var(S2)=n−12σ4​.

    Now n22n−1​<n−12​ iff (2n−1)(n−1)<2n2 (both denominators positive) iff 2n2−3n+1<2n2 iff 1<3n, which holds for every n≥1. So the inequality is strict for all n≥2. ■

    At n=2 the biased estimator's MSE is 43​σ4 against 2σ4; at n=10 it is 0.19σ4 against 92​σ4≈0.22σ4. Neither divisor is actually MSE-optimal: minimising MSE(c∑(Xi​−Xˉ)2)=σ4[2c2(n−1)+(c(n−1)−1)2] over c gives c=1/(n+1), so the best estimator in this family divides by n+1 and is more biased still. Unbiasedness is a constraint, and constraints cost.

  8. 8.Critique

    A machine's fill volumes are normal with known σ=8 ml. A sample of n=16 bottles has xˉ=50 ml. Use z0.025​=1.96 and z0.05​=1.645. A student submits the following.

    Step 1. The standard error is σ/n​=8/4=2.

    Step 2. The 95% interval is 50±1.96×2=(46.08, 53.92).

    Step 3. Therefore the probability that μ lies in (46.08, 53.92) is 0.95.

    Step 4. Since the interval captures 95% of the distribution, about 95% of individual bottles contain between 46.08 and 53.92 ml.

    Step 5. The 90% interval is 50±1.645×2=(46.71, 53.29). It is narrower, so it is a more precise estimate of μ and should be preferred.

    Step 6. If a second sample of 16 bottles were taken, its mean would fall inside (46.08, 53.92) with probability 0.95.

    1. (a)Steps 1 and 2 are correct. For each of Steps 3–6, say whether it is correct; where it is not, name precisely what is wrong and write the statement that is correct.
    2. (b)Suppose μ were in fact 50. What interval contains the middle 95% of individual fill volumes, and by what factor is it wider than the confidence interval? Explain why the confidence interval shrinks to a point as n grows while this one does not.
    3. (c)For Step 6, write the correct probability as a statement about a standard normal variable, and show without tables that it is less than 0.95.

    Solution

    (a) Four claims, four verdicts.

    Step 3 is wrong: it assigns a probability to a constant. In the pivotal argument P(Xˉ−1.96σ/n​≤μ≤Xˉ+1.96σ/n​)=0.95, the random quantities are the endpoints; μ is a fixed number. Once the sample is in, (46.08,53.92) is a fixed interval too, and it either contains μ or it does not — there is no randomness left and so no probability to assign. Correct statement: "the interval was produced by a procedure which, over repeated samples, captures μ 95% of the time." The 95% describes the procedure, not this interval.

    Step 4 is wrong: it confuses the precision of an estimate of μ with the spread of the population. The interval's half-width is 1.96σ/n​, which measures how well Xˉ locates μ; individual bottles scatter with standard deviation σ, four times larger here. Correct statement: the interval says nothing about individual bottles; see (b).

    Step 5 is wrong: narrowing by lowering the level is not precision, it is a lower success rate. At fixed n and σ the only thing a 90% interval buys with its shorter length is that the procedure misses μ twice as often — 10% of the time rather than 5%. Correct statement: the 90% interval is (46.71,53.29), and it is not a better estimate but a riskier one. Genuine precision at a fixed level comes only from a larger n or a smaller σ.

    Step 6 is wrong: the interval is about μ, not about future data. A second sample mean Xˉ′ is itself random with standard deviation σ/n​=2, and the interval's centre Xˉ is random as well; the gap Xˉ′−Xˉ has two sources of variability. The correct probability is computed in (c) and is well below 0.95.

    (b) Population band versus confidence interval. If μ=50, an individual volume X∼N(50,64) lies in μ±1.96σ=50±15.68=(34.32, 65.68) with probability 0.95. Its width is 31.36 ml against the confidence interval's 7.84 ml: a factor of n​=4, because the interval's half-width is 1.96σ/n​ while the band's is 1.96σ.

    As n grows, σ/n​→0 and the confidence interval collapses onto μ — more data locates the mean ever more precisely. The population band is μ±1.96σ whatever n is: no amount of sampling makes individual bottles less variable. The two intervals answer different questions, and only the first is what a confidence interval is for.

    (c) The chance a second mean lands in the interval. Let Xˉ′ be the second sample mean, independent of Xˉ, with Xˉ,Xˉ′∼N(μ,4). Then Xˉ′−Xˉ∼N(0,4+4)=N(0,8), with standard deviation 22​. The event in Step 6 is ∣Xˉ′−Xˉ∣≤3.92, so

    P(∣Xˉ′−Xˉ∣≤3.92)=P(∣Z∣≤22​3.92​)=P(∣Z∣≤2​1.96​).

    Since 1.96/2​<1.96 and c↦P(∣Z∣≤c) is increasing, this is strictly less than P(∣Z∣≤1.96)=0.95. (From a table it is about 0.83.) To capture the next sample mean with probability 0.95 one would need the wider margin 1.96⋅22​, a prediction interval — a different object from a confidence interval.

  9. 9.Computation

    A normal population has unknown mean μ and unknown variance. A sample of n=5 gives the values 7, 9, 10, 11, 13. Use t0.025,4​=2.776, t0.005,4​=4.604 and z0.025​=1.96.

    1. (a)Compute xˉ, s2 and the estimated standard error s/n​ exactly.
    2. (b)State the pivot, name its distribution and the two facts about normal samples that the distribution rests on, and construct the 95% confidence interval for μ.
    3. (c)Construct the 99% interval, and explain why it must be wider.
    4. (d)A classmate uses z in place of t and reports 10±1.96=(8.04, 11.96). Write this interval's true coverage as a probability about a t4​ variable, and explain in terms of the pivot why it is below 95%.

    Solution

    (a) Summary statistics. The sum is 50, so xˉ=10. The deviations are −3,−1,0,1,3, with squares 9,1,0,1,9 summing to 20, so

    s2=n−120​=420​=5,s=5​,n​s​=5​5​​=1.

    (b) The t pivot. Because σ is unknown, the pivot is the studentised mean

    T=S/n​Xˉ−μ​∼tn−1​=t4​,

    by the theorem The studentised mean is pivotal. That distribution rests on two facts about a normal sample: (n−1)S2/σ2∼χn−12​, and Xˉ and S2 are independent — which is what lets T be written as Z/V/(n−1)​ with Z and V independent, the definition of Student's t. Both hypotheses need the population to be normal, which is given.

    By the pivotal method, P(−2.776≤T≤2.776)=0.95; multiplying through by S/n​ and rearranging around μ gives μ∈Xˉ±2.776S/n​. With xˉ=10 and s/n​=1,

    (10−2.776, 10+2.776)=(7.224, 12.776).

    (c) The 99% interval replaces t0.025,4​ by t0.005,4​:

    10±4.604=(5.396, 14.604).

    It must be wider because t0.005,4​>t0.025,4​: to trap the pivot with probability 0.99 instead of 0.95 the central region must extend further into the tails, and with only 4 degrees of freedom those tails are heavy, so the cost is large — the interval is 1.66 times as long. Confidence is bought with length at a fixed n.

    (d) What the z-interval really covers. The interval Xˉ±1.96S/n​ contains μ exactly when ∣T∣≤1.96, where T is the same pivot as in (b). Its true coverage is therefore

    P(∣T∣≤1.96),T∼t4​,

    and since 1.96<2.776 and c↦P(∣T∣≤c) is increasing, this is strictly less than P(∣T∣≤2.776)=0.95. (It is about 0.88.) The classmate's error is to treat s as if it were the known σ: with n=5 the estimate S varies a great deal from sample to sample, the pivot has the heavy tails of t4​ rather than the normal's, and a margin sized for the normal traps μ too rarely. The interval is not "more precise" — it is under-covering.

  10. 10.Proof

    Independent samples of sizes n1​ and n2​ are drawn from N(μ1​,σ12​) and N(μ2​,σ22​), where both variances are known and need not be equal. Write δ=μ1​−μ2​ and z=zα/2​.

    1. (a)Derive, by the pivotal method, a 100(1−α)% confidence interval for δ: state the distribution of Xˉ1​−Xˉ2​ with justification, exhibit the pivot, and carry out the rearrangement.
    2. (b)Suppose the total budget N=n1​+n2​ is fixed. Prove that the interval's half-width is minimised when n1​:n2​=σ1​:σ2​, and show that the minimal half-width is z(σ1​+σ2​)/N​.
    3. (c)Prove that equal allocation n1​=n2​=N/2 inflates Var(Xˉ1​−Xˉ2​) by the factor (σ1​+σ2​)22(σ12​+σ22​)​≥1, with equality if and only if σ1​=σ2​. Evaluate the factor when σ1​=3σ2​ and translate it into extra observations.

    Solution

    (a) The pivot. By the proposition A normal population gives an exactly normal mean, Xˉ1​∼N(μ1​,σ12​/n1​) and Xˉ2​∼N(μ2​,σ22​/n2​), and they are independent because the samples are. A difference of independent normals is normal, and by the lemma Linearity of expectation and variance of an independent sum,

    Xˉ1​−Xˉ2​∼N(δ, τ2),τ2=n1​σ12​​+n2​σ22​​,

    where τ is a known constant. Standardising,

    Q=τ(Xˉ1​−Xˉ2​)−δ​∼N(0,1),

    a distribution involving no unknown at all — a pivot. By definition of z, P(−z≤Q≤z)=1−α. Multiply the chain by τ>0, subtract Xˉ1​−Xˉ2​, and multiply by −1, which reverses both inequalities and swaps the ends:

    (Xˉ1​−Xˉ2​)−zτ ≤ δ ≤ (Xˉ1​−Xˉ2​)+zτ.

    The event is unchanged, so its probability is still 1−α: the interval is (Xˉ1​−Xˉ2​)±zσ12​/n1​+σ22​/n2​​. ■

    (b) Optimal allocation. The half-width is zg(n1​)​ with

    g(n1​)=n1​σ12​​+N−n1​σ22​​,0<n1​<N,

    treating n1​ as continuous; since the square root is increasing, minimise g. Then

    g′(n1​)=−n12​σ12​​+(N−n1​)2σ22​​,

    which vanishes iff σ22​n12​=σ12​(N−n1​)2, i.e. (all quantities positive) σ2​n1​=σ1​(N−n1​), i.e. n1​/n2​=σ1​/σ2​. This is the global minimum because g′′(n1​)=2σ12​/n13​+2σ22​/(N−n1​)3>0 makes g convex on (0,N), and g→∞ at both ends of the interval. Explicitly n1∗​=σ1​+σ2​Nσ1​​, n2∗​=σ1​+σ2​Nσ2​​, and

    g(n1∗​)=Nσ1​σ12​(σ1​+σ2​)​+Nσ2​σ22​(σ1​+σ2​)​=N(σ1​+σ2​)2​,

    so the minimal half-width is z(σ1​+σ2​)/N​. ■ (An alternative route is the Cauchy–Schwarz inequality, (n1​σ12​​+n2​σ22​​)(n1​+n2​)≥(σ1​+σ2​)2, with equality exactly when σi​∝ni​. In practice n1∗​ is rounded to an integer.) The rule says: spend the budget in proportion to the standard deviations, not the variances — the noisier population gets more observations, but only linearly more.

    (c) The cost of splitting evenly. With n1​=n2​=N/2, g=N2σ12​​+N2σ22​​=N2(σ12​+σ22​)​, and dividing by the optimum (σ1​+σ2​)2/N gives the stated factor. It is at least 1 because

    2(σ12​+σ22​)−(σ1​+σ2​)2=σ12​−2σ1​σ2​+σ22​=(σ1​−σ2​)2≥0,

    with equality iff σ1​=σ2​. ■

    With σ1​=3σ2​ the factor is 16σ22​2(9+1)σ22​​=1620​=45​. Since the variance scales as 1/N, an even split needs 45​N observations — 25% more — to match the width the optimal split achieves with N, which puts three quarters of the budget on the noisier population. When the variances are equal the optimum is the even split, which is why the pooled t interval, whose hypotheses assume a common variance, is at its best with n1​=n2​.

  11. 11.Computation

    Throughout this question take zα/2​=2 — the value 1.96 rounded, so that every number comes out exactly; the level is then approximately 95%. A sample of n=16 independent trials is observed.

    1. (a)With k=4 successes, compute the Wald interval and the Wilson score interval for p exactly.
    2. (b)The Wilson interval is by definition the set of p satisfying ∣p^​−p∣≤zp(1−p)/n​. Verify by direct substitution that both Wilson endpoints from (a) satisfy this with equality. Then show that the lower Wald endpoint fails the inequality while the upper one satisfies it strictly, and say what that means about the Wald interval.
    3. (c)With k=0 successes, compute both intervals, verify the upper Wilson endpoint with equality, and say which interval is an honest report of what 16 trials established.
    4. (d)Prove that with z=2 the Wilson centre is exactly n+4k+2​ for every k and n, and interpret the formula.

    Solution

    (a) Two intervals at p^​=1/4. Here p^​=4/16=41​ and p^​(1−p^​)/n=41​⋅43​⋅161​=2563​.

    Wald. 3/256​=3​/16, so the interval is 41​±2⋅3​/16=41​±3​/8. Since 3​≈1.73, this is about (0.033, 0.467).

    Wilson. With z2=4: z2/n=41​, z2/(2n)=81​, z2/(4n2)=4/1024=2561​. The centre is

    p~​=1+41​41​+81​​=5/43/8​=103​,

    and the half-width is

    w=5/42​2563​+2561​​=58​2564​​=58​⋅162​=58​⋅81​=51​.

    The Wilson interval is (103​−51​, 103​+51​)=(101​, 21​). It is shifted toward 21​ relative to Wald and slightly longer.

    (b) Checking the defining inequality. At p=21​: left side ∣41​−21​∣=41​; right side 221​⋅21​/16​=21/64​=82​=41​. Equality ✓. At p=101​: left side ∣41​−101​∣=205​−202​=203​; right side 2101​⋅109​/16​=29/1600​=2⋅403​=203​. Equality ✓. (At p=p^​=41​ the left side is 0, so p^​ is inside, as it must be.)

    The Wald endpoints solve a different equation, ∣p^​−p∣=zp^​(1−p^​)/n​, whose right side is a constant 3​/8 rather than a function of p. Consider the lower one, pL​=41​−83​​. Since 0<pL​<41​<21​ and p(1−p) is increasing on [0,21​], we have pL​(1−pL​)<41​⋅43​, so the honest right side 2pL​(1−pL​)/16​ is smaller than 23/256​=3​/8=∣p^​−pL​∣: the inequality fails at pL​, which lies outside the honest set. For the upper one, pU​=41​+83​​, we have 41​<pU​<21​ (as 3​/8<41​), so pU​(1−pU​)>163​ and the honest right side exceeds ∣p^​−pU​∣: the inequality holds strictly, and pU​ is an interior point of the honest set. So Wald reaches too far down and stops too short going up — it is the honest interval (101​,21​) shifted the wrong way, because it pretends the standard error is the same at every p.

    (c) No successes. p^​=0. Wald: p^​(1−p^​)/n​=0, so the interval is 0±0={0}. Wilson: p~​=5/40+81​​=101​ and w=58​0+2561​​=58​⋅161​=101​, giving (0, 51​).

    Check p=51​: left side ∣0−51​∣=51​; right side 251​⋅54​/16​=24/400​=2⋅202​=51​. Equality ✓. (At p=0 both sides are 0, so the lower endpoint is exactly 0, as it should be when nothing was observed.)

    The honest report is Wilson's. Zero events in 16 trials is entirely consistent with a rate of 51​: the chance of seeing none is then (4/5)16≈0.03, exactly the sort of borderline value an endpoint of a 95% interval should have. Wald's {0} asserts, with 95% confidence, that the rate is exactly zero on the strength of 16 trials — a zero-width interval from a finite sample, which is not a confidence statement at all. (The rule of three gives 3/16≈0.19 as the upper bound, close to Wilson's 0.2.)

    (d) Add two successes and two failures. With p^​=k/n and z2=4,

    p~​=1+n4​nk​+2n4​​=(n+4)/n(k+2)/n​=n+4k+2​. ■

    Check against (a) and (c): (4+2)/(16+4)=6/20=103​ ✓ and 2/20=101​ ✓. The Wilson centre is the sample proportion after two phantom successes and two phantom failures are appended: a shrinkage of p^​ toward 21​ whose weight 4 is fixed while the data's weight n grows, so it matters at n=16 and vanishes as n→∞, where Wilson collapses back onto Wald. It is precisely this pull away from the endpoints that keeps the interval inside [0,1] and gives it positive width at p^​=0.

  12. 12.Critique

    A polling firm's planning memo reads as follows. Take z0.025​=2 and z0.005​=2.6 (both rounded) throughout, and measure margins as proportions, so that “5 points” means E=0.05.

    Baseline. Our last poll used n=400. At the worst case p=21​ the 95% margin is 241​⋅4001​​=201​, i.e. 5 points, which is what we reported.

    Claim A. To halve the margin to 2.5 points, double the sample: n=800.

    Claim B. The next poll is in a town of 50,000 rather than a country of 5 million. The population is 100 times smaller, so n=4 gives the same 5-point margin.

    Claim C. The client wants 99% confidence at the same 5-point margin. As 99/95≈1.04, about 4% more respondents will do: n≈416.

    Claim D. Our pilot puts support near 10%. Using p=0.1, n=0.05222×0.1×0.9​=144 respondents guarantee a 5-point margin.

    1. (a)The baseline is correct. For each of Claims A–D, decide whether it is right; where it is wrong, name the error precisely and compute the correct sample size.
    2. (b)Prove that if it is known that p≤p0​ for some p0​<21​, then n≥z2p0​(1−p0​)/E2 guarantees a margin of at most E, and that this requirement never exceeds the worst-case one. Then find the true p at which Claim D's n=144 delivers a margin of exactly 151​ (about 6.7 points), and comment.
    3. (c)The firm settles on n=1600 at 95% and reports a 2.5-point margin. Its respondents were recruited from the firm's own website. Does the margin account for this? Say what a confidence interval does and does not measure.

    Solution

    (a) Four claims.

    Claim A is wrong: the margin scales as 1/n​, not 1/n. The margin is zp(1−p)/n​, so halving it needs n multiplied by 4: the correct figure is n=1600. Check: 241​⋅16001​​=2⋅21​⋅401​=401​, i.e. 2.5 points ✓. Doubling to 800 would give 241​⋅8001​​=800​1​=202​1​, about 3.5 points — the quadratic cost of precision, by the proposition Sample size for a target margin of error.

    Claim B is wrong: the population size does not appear anywhere. The formula n≥z2/(4E2) contains z and E and nothing else, because the model is n independent draws from a population large enough that each draw is a fresh Bernoulli(p) trial; that holds for a town of 50,000 as well as a country. The correct figure is n=400 again. Taken at its word, n=4 gives a margin of 241​⋅41​​=21​ — fifty points, which is no poll at all.

    Claim C is wrong: n scales with the square of the critical value, not with the confidence level. By the proposition Worst-case sample size for a proportion,

    n≥4E2z0.0052​​=4×0.00256.76​=0.016.76​=676.

    The factor over the 95% figure is (2.6/2)2=1.69, so 69% more respondents, not 4%. (With the unrounded 2.576/1.96 it is about 1.73.)

    Claim D is half right. The arithmetic is correct: 4×0.09/0.0025=0.36/0.0025=144. The word "guarantee" is not. With n=144 the margin is 2p(1−p)/144​=p(1−p)​/6, which is at most 0.05 only if p(1−p)≤0.09, i.e. only if p≤0.1 or p≥0.9. A pilot figure is an estimate, not a bound; if support is really 15% or 20% the promise is broken. Correct planning takes the worst case over the range of p that is genuinely plausible — for instance if p≤0.2 can be relied on, n≥4×0.16/0.0025=256 — or falls back to 400 if nothing can.

    (b) Planning with a bound on p. Let g(p)=p(1−p). Then g′(p)=1−2p>0 on [0,21​), so g is increasing there, and p≤p0​<21​ implies p(1−p)≤p0​(1−p0​). Hence the margin obeys

    znp(1−p)​​≤znp0​(1−p0​)​​≤Eas soon asn≥E2z2p0​(1−p0​)​.

    Since p0​(1−p0​)≤41​ (the maximum of g on [0,1] is at 21​), this is never more than the worst-case z2/(4E2). ■ Knowledge that p is far from 21​ is worth real money, but only knowledge of a bound, not a point guess.

    For Claim D's n=144, the margin equals 151​ when p(1−p)​/6=151​, i.e. p(1−p)​=156​=52​, i.e. p(1−p)=254​. Clearing denominators, 25p2−25p+4=0, which factors as (5p−1)(5p−4)=0, so p=51​ or p=54​. If true support is 20% rather than the pilot's 10%, the advertised 5-point margin is really 6.7 points — and a small pilot being ten points off is not unusual.

    (c) What the margin measures. No. The margin of error quantifies sampling variability only: how much p^​ would move across repeated random samples of 1600 from the population the model describes. Visitors to the firm's website are self-selected, so the sample is drawn from a different population than the electorate, and the interval is a precise statement about that wrong population. Raising n from 400 to 1600 narrows the interval without moving it toward the truth; the bias is invisible to the formula and is fixed only by the sampling design. The interval does measure the uncertainty from having 1600 observations rather than all of them; it does not measure, and cannot measure, non-response, self-selection, or a leading question.

← Back to the question sheet

CalcPath·Free university mathematics

SubjectsProblem setsProgressFeedbackAbout