Probability Theory & Statistics
Level: 3 — Production (from-scratch derivations, code-from-memory, explain-out-loud) Time limit: 45 minutes Total marks: 60
Instructions: Derive results from first principles where asked. Show all working. Code may be written in pseudocode or Python; correctness of logic is what is marked.
Question 1 — MGF and moments from scratch (10 marks)
(a) State the definition of the moment generating function of a random variable , and prove that and , stating the regularity assumption you use. (4)
(b) For , derive from the definition. (3)
(c) Use your MGF to obtain and . (3)
Question 2 — Transformation of variables (10 marks)
Let . Define with .
(a) Using the change-of-variable (CDF) technique, derive the pdf of and name the distribution. (5)
(b) Explain out loud (in 2–3 sentences) how this result gives an algorithm to simulate exponential random variables from a uniform generator. (2)
(c) Write pseudocode/Python (from memory) for a Monte Carlo estimate of using such samples, and state which theorem guarantees convergence. (3)
Question 3 — Estimation: MLE vs method of moments (12 marks)
Let be i.i.d. from an exponential distribution with rate , pdf , .
(a) Derive the maximum likelihood estimator . (4)
(b) Derive the method-of-moments estimator . (2)
(c) Show whether is unbiased for (state the relevant expectation; you may quote ). (3)
(d) Explain out loud what consistency means and argue is consistent. (3)
Question 4 — Central Limit Theorem (10 marks)
(a) State the classical CLT precisely (i.i.d., finite mean and variance ). (3)
(b) Give the MGF-based proof sketch: show that the standardized sum's MGF converges to , justifying each step. (5)
(c) A fair die is rolled times. Using the CLT, approximate where , . (2)
Question 5 — Confidence interval & hypothesis test (10 marks)
A sample of light bulbs has mean lifetime hours and known population hours.
(a) Derive the confidence interval for the mean from the CLT/pivot, and compute it. (4)
(b) Test vs at using a z-test. Compute the test statistic, state the decision, and approximate the two-sided p-value. (4)
(c) Explain the difference between a Type I and Type II error in this context. (2)
Question 6 — Covariance & conditional expectation (8 marks)
Let have joint pdf for , and otherwise.
(a) Find the marginal . (2)
(b) Find and . (3)
(c) Compute and comment on whether are independent. (3)
Answer keyMark scheme & solutions
Question 1 (10)
(a) Definition: (for in a neighbourhood of 0 where the expectation is finite). (1) Assuming we may interchange differentiation and expectation (valid because exists on an open interval about 0): . (1.5) . (1.5)
(b) . (3)
(c) , so . (1) , . (1) . (1)
Question 2 (10)
(a) For : (since uniform). (3) Differentiate: , — Exponential(). (2)
(b) Since (or as ), applying the inverse CDF to a uniform draw yields an exponential draw — the inverse-transform / inverse-CDF sampling method. (2)
(c)
import numpy as np
def mc_mean(n, lam):
U = np.random.rand(n)
X = -np.log(U)/lam
return X.mean()Convergence to guaranteed by the (Strong) Law of Large Numbers. (3)
Question 3 (12)
(a) Likelihood ; log-likelihood . (2) . Second derivative ⇒ max. (2)
(b) ; set . Same as MLE. (2)
(c) . So it is biased (overestimates), bias . (3)
(d) Consistency: as . By LLN , and by continuous mapping . Also bias and variance . (3)
Question 4 (10)
(a) If i.i.d. with mean , variance , then (3)
(b) Let , mean 0, var 1, MGF with . Then and (2) Taylor: . (1.5) So , the MGF of ; convergence of MGF ⇒ convergence in distribution. (1.5)
(c) SE of . . . (2)
Question 5 (10)
(a) Pivot . CI: . ; margin . CI . (4)
(b) . ⇒ fail to reject . Two-sided p-value . (4)
(c) Type I: rejecting (concluding mean ≠ 1200) when in fact . Type II: failing to reject when the true mean differs from 1200. (2)
Question 6 (8)
(a) , . (2)
(b) . (1.5) . (1.5)
(c) By symmetry . . Nonzero ⇒ not independent (also ). (3)
[
{"claim":"Poisson MGF gives mean and variance lambda","code":"t,lam=symbols('t lambda',positive=True); M=exp(lam*(exp(t)-1)); mean=diff(M,t).subs(t,0); m2=diff(M,t,2).subs(t,0); var=simplify(m2-mean**2); result=(simplify(mean-lam)==0 and simplify(var-lam)==0)"},
{"claim":"X=-ln(U)/lam has exponential pdf; E[X]=1/lam","code":"lam,x=symbols('lambda x',positive=True); f=lam*exp(-lam*x); EX=integrate(x*f,(x,0,oo)); result=simplify(EX-1/lam)==0"},
{"claim":"MLE E[1/Xbar]=n/(n-1)*lam so biased","code":"n,lam=symbols('n lambda',positive=True); bias=n/(n-1)*lam-lam; result=simplify(bias-lam/(n-1))==0"},
{"claim":"Cov(X,Y)=-1/144 for f=x+y","code":"x,y=symbols('x y'); f=x+y; EX=integrate(integrate(x*f,(y,0,1)),(x,0,1)); EY=integrate(integrate(y*f,(y,0,1)),(x,0,1)); EXY=integrate(integrate(x*y*f,(y,0,1)),(x,0,1)); cov=simplify(EXY-EX*EY); result=cov==Rational(-1,144)"},
{"claim":"Die CI/z-test: z for Q5b approx -1.4055","code":"z=(1180-1200)/(90/sqrt(40)); result=abs(float(z)+1.40554)<0.01"}
]