37363 - Lab/Tutorial 4 Solutions

Scott Alexander

Q1

(Subscript[Y, n]) = (∑_(k=1)^n)(Subscript[X, k]^2)

(a)

𝔼[(e^(u (Subscript[X, k]^2)))] = (∫_(-∞)^∞)(e^(u (x^2)))(Subscript[f, X])(x)dx
where    (Subscript[f, X])    is PDF of N(0,1).

Plug in PDF and manipulate integrand into another PDF.

PDF[NormalDistribution[0,1],x]

(∫_(-∞)^∞)(E^(u (x^2)))((E^(-((x^2)/2)))/(Sqrt[2 π]))\[DifferentialD]x

(b)

𝔼[(e^(u (Subscript[Y, n])))] = 𝔼[(e^(u (∑_(k=1)^n)(Subscript[X, k]^2)))] = ...

Use independence property.

(c)

Re-write
(Subscript[Z, n]) = (((Subscript[Y, n])-n)/(8(Sqrt[3n]))) = (((∑_(k=1)^n)(Subscript[X, k]^2)-n)/(8(Sqrt[3n]))) = (((1/n)((∑_(k=1)^n)(Subscript[X, k]^2)-n))/((1/n)8(Sqrt[3n])))
in form consistent with pg 14 Ch 3.

(d)

Solve
(Subscript[Z, n]) = (((Subscript[Y, n])-n)/(8(Sqrt[3n])))
for (Subscript[Y, n]).

Then (Subscript[Z, n]) is approximately (by CLT) Gaussian.

pTrue[n_]:=CDF[ChiSquareDistribution[n],(((n^2)+1)/n)];

Q2

(a)

Let X~U(1,8) which has density
(Subscript[f, X])(x) = (1/7)I(1≤x≤8) = ({{{, ({{1/7,, 1≤x≤8}, {0,, otherwise}})}}).

G = (∫_1^8)3x (e^(-x/2))dx = (∫_(-∞)^∞)7*3x (e^(-x/2))(1/7)I(1≤x≤8)dx
  =(∫_(-∞)^∞)21x (e^(-x/2))(1/7)I(1≤x≤8)dx
  =(∫_(-∞)^∞)g(x)(Subscript[f, X])(x)dx
where
g(x) = 21x (e^(-x/2)).

(b)

(c)

(d)

n=(10^6);
rv=RandomReal[UniformDistribution[{1,8}],n];
g[x_]:=21x (E^(-x/2));
rv=g[rv];
rv=Map[g,rv];
mean=Mean[rv];
stderr=StandardDeviation[rv]/(Sqrt[n]);
{mean,stderr}

(∫_1^8)3x (E^(-x/2))\[DifferentialD]x//N

(e)

(f)

(g)