Level 4 — ApplicationProbability Theory & Statistics

Probability Theory & Statistics

printable — key stays hidden on paper

Level 4 (Application: novel problems, no hints) Time: 60 minutes | Total: 50 marks

Answer all questions. Justify each step. Standard normal values: z0.975=1.96z_{0.975}=1.96, z0.95=1.645z_{0.95}=1.645, Φ(1)=0.8413\Phi(1)=0.8413, Φ(2)=0.9772\Phi(2)=0.9772.


Question 1 (10 marks) — Transformations & MGF

Let XX be a continuous random variable with PDF fX(x)=2xf_X(x) = 2x for 0x10 \le x \le 1 and 00 otherwise.

(a) Find the PDF of Y=lnXY = -\ln X, stating its support. (4)

(b) Identify the distribution of YY (name and parameter). (2)

(c) Using the MGF of YY, compute E[Y]E[Y] and Var(Y)\operatorname{Var}(Y). (4)


Question 2 (10 marks) — Joint distributions & conditional expectation

Suppose (X,Y)(X,Y) has joint PDF f(x,y)=c(x+y),0x1, 0y1.f(x,y) = c\,(x+y), \quad 0 \le x \le 1,\ 0 \le y \le 1.

(a) Find cc. (2)

(b) Find the marginal density fX(x)f_X(x) and determine whether XX and YY are independent. (3)

(c) Find E[YX=x]E[Y \mid X = x]. (3)

(d) Compute Cov(X,Y)\operatorname{Cov}(X,Y). (2)


Question 3 (10 marks) — Estimation & properties

A machine produces items whose lifetime (hours) is modelled as Exponential(λ)\text{Exponential}(\lambda) with density λeλt\lambda e^{-\lambda t}, t0t\ge 0. A sample of nn lifetimes t1,,tnt_1,\dots,t_n is observed with sample mean tˉ\bar t.

(a) Derive the maximum likelihood estimator λ^\hat\lambda. (4)

(b) Show that λ^\hat\lambda is not unbiased for λ\lambda (recall E[Tˉ]=1/λE[\bar T]=1/\lambda and E[1/Tˉ]=nn1λE[1/\bar T] = \frac{n}{n-1}\lambda for n2n\ge 2). Construct an unbiased estimator. (3)

(c) State whether λ^\hat\lambda is consistent and justify briefly using LLN. (3)


Question 4 (10 marks) — Hypothesis testing & CLT

A coin is tossed n=400n = 400 times, giving 220 heads. Let pp be the probability of heads.

(a) Test H0:p=0.5H_0: p = 0.5 against H1:p0.5H_1: p \ne 0.5 at the 5% level using a normal-approximation (zz) test. State your conclusion. (5)

(b) Construct a 95% confidence interval for pp and confirm consistency with part (a). (3)

(c) Explain what a Type II error would mean in this context, and state one way to reduce its probability. (2)


Question 5 (10 marks) — Bayesian inference & simulation

A rare event has unknown probability θ\theta. Prior belief: θBeta(2,2)\theta \sim \text{Beta}(2,2). In n=10n=10 independent trials, the event occurs 33 times.

(a) Write the likelihood and derive the posterior distribution of θ\theta. (4)

(b) Give the posterior mean and compare it with the MLE θ^=3/10\hat\theta = 3/10. (3)

(c) A Monte Carlo estimate of P(θ>0.5)P(\theta > 0.5) draws NN samples from the posterior. Explain (via the Law of Large Numbers) why the estimate converges, and give the order of the standard error of the estimate as a function of NN. (3)

Answer keyMark scheme & solutions

Question 1

(a) Y=lnXY=-\ln X, so X=eYX = e^{-Y}, x(0,1)y(0,)x\in(0,1)\Rightarrow y\in(0,\infty). dxdy=ey\left|\frac{dx}{dy}\right| = e^{-y}. (1 for inverse, 1 for Jacobian) fY(y)=fX(ey)ey=2eyey=2e2y,y>0.f_Y(y) = f_X(e^{-y})\,e^{-y} = 2e^{-y}\cdot e^{-y} = 2e^{-2y}, \quad y>0. (2 for correct density + support)

(b) This is Exponential(λ=2)\text{Exponential}(\lambda=2). (2)

(c) MGF of Exp(2): MY(t)=22tM_Y(t) = \frac{2}{2-t}, t<2t<2. (1) MY(t)=2(2t)2M_Y'(t) = \frac{2}{(2-t)^2}, so E[Y]=MY(0)=12E[Y]=M_Y'(0)=\frac12. (1) MY(t)=4(2t)3M_Y''(t) = \frac{4}{(2-t)^3}, so E[Y2]=48=12E[Y^2] = \frac{4}{8}=\frac12. (1) Var(Y)=1214=14\operatorname{Var}(Y) = \frac12 - \frac14 = \frac14. (1) (Consistent with Exp(2): mean 1/21/2, var 1/41/4.)


Question 2

(a) 0101c(x+y)dxdy=c01(12+y)dy=c(12+12)=c=1\int_0^1\int_0^1 c(x+y)\,dx\,dy = c\int_0^1 (\tfrac12 + y)\,dy = c(\tfrac12+\tfrac12)=c=1. So c=1c=1. (2)

(b) fX(x)=01(x+y)dy=x+12f_X(x)=\int_0^1 (x+y)\,dy = x + \tfrac12, for 0x10\le x\le1. By symmetry fY(y)=y+12f_Y(y)=y+\tfrac12. (2) fX(x)fY(y)=(x+12)(y+12)x+yf_X(x)f_Y(y) = (x+\tfrac12)(y+\tfrac12) \ne x+y in general, so not independent. (1)

(c) fYX(yx)=x+yx+12f_{Y|X}(y|x) = \dfrac{x+y}{x+\tfrac12}, 0y10\le y\le1. (1) E[YX=x]=01yx+yx+12dy=1x+12(x2+13)=3x+26x+3.E[Y|X=x] = \int_0^1 y\,\frac{x+y}{x+\tfrac12}\,dy = \frac{1}{x+\tfrac12}\left(\frac{x}{2}+\frac13\right) = \frac{3x+2}{6x+3}. (2)

(d) E[X]=01x(x+12)dx=13+14=712=E[Y]E[X]=\int_0^1 x(x+\tfrac12)dx = \tfrac13+\tfrac14=\tfrac{7}{12}=E[Y]. E[XY]=0101xy(x+y)dxdy=0101(x2y+xy2)dxdy=1312+1213=13E[XY]=\int_0^1\int_0^1 xy(x+y)\,dx\,dy = \int_0^1\int_0^1 (x^2y+xy^2)dxdy = \tfrac13\cdot\tfrac12+\tfrac12\cdot\tfrac13=\tfrac13. Cov(X,Y)=13(712)2=1349144=4849144=1144\operatorname{Cov}(X,Y)=\tfrac13-(\tfrac{7}{12})^2 = \tfrac13-\tfrac{49}{144} = \frac{48-49}{144}=-\frac{1}{144}. (2)


Question 3

(a) Likelihood L(λ)=λeλti=λneλtiL(\lambda)=\prod \lambda e^{-\lambda t_i}=\lambda^n e^{-\lambda\sum t_i}. (1) (λ)=nlnλλti\ell(\lambda)=n\ln\lambda - \lambda\sum t_i. (1) (λ)=nλti=0λ^=nti=1tˉ\ell'(\lambda)=\frac{n}{\lambda}-\sum t_i = 0 \Rightarrow \hat\lambda = \frac{n}{\sum t_i} = \frac{1}{\bar t}. (1) Second derivative n/λ2<0-n/\lambda^2<0 confirms maximum. (1)

(b) E[λ^]=E[1/Tˉ]=nn1λλE[\hat\lambda]=E[1/\bar T] = \frac{n}{n-1}\lambda \ne \lambda, so biased (overestimates). (1.5) Unbiased estimator: λ~=n1nλ^=n1ti\tilde\lambda = \frac{n-1}{n}\hat\lambda = \frac{n-1}{\sum t_i}, since E[λ~]=n1nnn1λ=λE[\tilde\lambda] = \frac{n-1}{n}\cdot\frac{n}{n-1}\lambda = \lambda. (1.5)

(c) TˉP1/λ\bar T \xrightarrow{P} 1/\lambda by the Weak LLN; g(x)=1/xg(x)=1/x continuous at 1/λ1/\lambda, so by continuous mapping λ^=1/TˉPλ\hat\lambda = 1/\bar T \xrightarrow{P}\lambda. Hence consistent. (3)


Question 4

(a) p^=220/400=0.55\hat p = 220/400 = 0.55. Under H0H_0, SE =0.50.5400=0.000625=0.025=\sqrt{\frac{0.5\cdot0.5}{400}} = \sqrt{0.000625}=0.025. (2) z=0.550.50.025=2.0.z = \frac{0.55-0.5}{0.025} = 2.0. (1) z=2.0>1.96|z|=2.0 > 1.96, so reject H0H_0 at 5%. (1) (p-value =2(1Φ(2))=2(0.0228)=0.0456<0.05=2(1-\Phi(2))=2(0.0228)=0.0456<0.05.) (1)

(b) CI uses p^\hat p: SE =0.550.45400=0.00061875=0.02487=\sqrt{\frac{0.55\cdot0.45}{400}}=\sqrt{0.00061875}=0.02487. 0.55±1.96(0.02487)=0.55±0.0488=(0.5012,0.5988)0.55 \pm 1.96(0.02487) = 0.55\pm0.0488 = (0.5012,\,0.5988). (2) Interval excludes 0.50.5 (just), consistent with rejecting H0H_0. (1)

(c) Type II error: failing to reject H0H_0 (concluding the coin is fair) when it is actually biased. (1) Reduce by increasing sample size nn (or accepting larger effect / raising α\alpha). (1)


Question 5

(a) Likelihood θ3(1θ)7\propto \theta^3(1-\theta)^7. Prior θ1(1θ)1\propto \theta^{1}(1-\theta)^{1} (Beta(2,2)). (2) Posterior θ3+1(1θ)7+1=θ4(1θ)8\propto \theta^{3+1}(1-\theta)^{7+1} = \theta^{4}(1-\theta)^{8}, i.e. θdataBeta(2+3,2+7)=Beta(5,9).\theta \mid \text{data} \sim \text{Beta}(2+3,\,2+7) = \text{Beta}(5,9). (2)

(b) Posterior mean =55+9=5140.357= \frac{5}{5+9}=\frac{5}{14}\approx 0.357. (2) MLE =0.3=0.3. Posterior mean is pulled toward the prior mean 0.50.5, hence larger than the MLE. (1)

(c) Estimate p^=1N1(θi>0.5)\hat p = \frac1N\sum \mathbf 1(\theta_i>0.5) is a sample mean of i.i.d. Bernoulli indicators; by LLN it P(θ>0.5)\to P(\theta>0.5) almost surely as NN\to\infty. (2) Standard error =p(1p)/N=O(N1/2)=\sqrt{p(1-p)/N} = O(N^{-1/2}). (1)


[
  {"claim":"Q1 Var(Y) for Exp(2) equals 1/4 and E[Y]=1/2 via MGF",
   "code":"t=symbols('t'); M=2/(2-t); E=diff(M,t).subs(t,0); E2=diff(M,t,2).subs(t,0); var=E2-E**2; result=(E==Rational(1,2)) and (var==Rational(1,4))"},
  {"claim":"Q2 Cov(X,Y) = -1/144",
   "code":"x,y=symbols('x y'); f=x+y; EX=integrate(integrate(x*f,(x,0,1)),(y,0,1)); EY=integrate(integrate(y*f,(x,0,1)),(y,0,1)); EXY=integrate(integrate(x*y*f,(x,0,1)),(y,0,1)); cov=EXY-EX*EY; result=(cov==Rational(-1,144))"},
  {"claim":"Q4 z-statistic under H0 equals 2.0",
   "code":"phat=Rational(220,400); se=sqrt(Rational(1,2)*Rational(1,2)/400); z=(phat-Rational(1,2))/se; result=(simplify(z)==2)"},
  {"claim":"Q5 posterior is Beta(5,9) with mean 5/14",
   "code":"a=2+3; b=2+7; mean=Rational(a,a+b); result=(a==5) and (b==9) and (mean==Rational(5,14))"}
]