Problem 1

Say \(X\sim U\{-3,...,3\}\).

  1. Find the kurtosis of X.

\[ \begin{aligned} &\mu=E[X] =\sum_{n=-3}^3 n\frac17=0 \\ &\kappa_2=E[(X-\mu)^2] = E[X^2] =\sum_{n=-3}^3 n^2\frac17= \\ &\frac172\sum_{n=1}^3 n^2=\frac27\left(1+4+9\right) =4\\ &\kappa_3=E[(X-\mu)^3] = E[X^3] =\sum_{n=-3}^3 n^3\frac17=0 \\ &\kappa_4=E[(X-\mu)^4] = E[X^4] =\sum_{n=-3}^3 n^4\frac17= \\ &\frac27\sum_{n=1}^3 n^4=\frac27\left(1+16+81\right) =28\\ \end{aligned} \]

\[\gamma_2=\frac{\kappa_4}{\kappa_2^2}-3 =\frac{28}{4^2}-3=-\frac{5}{4}=-1.25\]

n=1e4
x=sample(-3:3,size=n,replace = TRUE)
c(mean(x),mean(x^2),mean(x^3),mean(x^4),mean(x^4)/mean(x^2)^2-3)
## [1]  0.007900  3.989300  0.049300 27.776900 -1.254618
  1. Find \(var(|X|)\)

\[ \begin{aligned} &P(|X|=0) =P(X=0)=\frac17 \\ &P(|X|=k) =P(X=k\text{ or }X=-k)=\frac27 \\ &E[|X|] =0\frac17+1\times \frac27+2\times \frac27+3\times \frac27= \\ &\left(2+4+6\right)/7=12/7\\ &E[|X|^2] =E[X^2]=4\\ &var(|X|) = E[|X|^2]-E[|X|]^2=4-(\frac{12}7)^2=\frac{52}{49}=1.061 \end{aligned} \]

var(abs(x))
## [1] 1.042345

Problem 2

Say \(X\sim Pois(\lambda)\). Find the density, mean and variance of \(Y=X|X>0\).

Let \(k\ge 1\), then \[ \begin{aligned} &P(Y=k) = P(X=k|X>0) = \\ &\frac{P(X=k,X>0)}{P(X>0)} = \\ &\frac{P(X=k)}{1-P(X=0)} = \\ &\frac{\frac{\lambda^k}{k!}e^{-\lambda}}{1-\frac{\lambda^0}{0!}e^{-\lambda}} = \\ &\frac{\lambda^k}{k!}\frac{1}{e^\lambda-1} \end{aligned} \]

\[ \begin{aligned} &E[Y^n] =\sum_{k=1}^\infty k^n \frac{\lambda^k}{k!}\frac{1}{e^\lambda-1} =\\ &\frac{e^\lambda}{e^\lambda-1} \sum_{k=0}^\infty k^n\frac{\lambda^k}{k!}e^{-\lambda} = \\ &\frac{e^\lambda}{e^\lambda-1} \mu_n \end{aligned} \] where \(\mu_n\) is the nth moment of a Poisson random \(Z\) variable with rate \(\lambda\). So

\[ \begin{aligned} &E[Y] = \frac{\lambda e^\lambda}{e^\lambda-1}\\ &\mu_2 = E[Z^2]=var(Z)+E[Z]^2=\lambda+\lambda^2\\ &E[Y^2] = \frac{(\lambda+\lambda^2) e^\lambda}{e^\lambda-1}\\ &var(Y)= \frac{(\lambda+\lambda^2) e^\lambda}{e^\lambda-1}-\left(\frac{\lambda e^\lambda}{e^\lambda-1}\right)^2=\\ &\left(\lambda e^{2\lambda}-\lambda e^\lambda-\lambda^2e^\lambda\right)/(e^\lambda-1)^2 \end{aligned} \]

Problem 3

Say \(X\sim Beta(n+1,1)\). Find a transformation g such that \(Y=g(X)\sim Exp(1)\).

\[F_X(x)=\int_0^x (n+1)t^n dt = t^{n+1}|_0^x = x^{n+1}\] so by the probability integral transform (theorem 1..1.8) \(X^{n+1}\sim U[0,1]\). By example 1.11.1 if \(U\sim U[0,1]\), \(-\log(U)\sim Exp(1)\). Therefore

\[-\log(X^{n+1})=-(n+1)\log X\sim Exp(1)\] so we have \(g(x)=-(n+1)\log(x)\).

n=1e4
x=rbeta(n, 5, 1) 
hist(-5*log(x), 100, freq=FALSE, main="")
curve(exp(-x), 0, 5, add=TRUE,lwd=2, col="blue")

Note: this is not the only possible solution

Problem 4

Say \(X\sim Geom(p)\) and \(Y|X=k\sim U[-k,k]\).

  1. Find the mean and variance of Y.

  2. Find the correlation of X and Y.

\[ \begin{aligned} &E[X] =\frac1p \\ &var(X) =\frac{q}{p^2} \end{aligned} \] next

\[ \begin{aligned} &E[Y] = E\{E[Y|X]\} = E\{0\} = 0\\ &var(Y) = var\{E[Y|X]\} + E\{var[Y|X]\} = \\ &E\{\frac{(2X)^2}{12}\} = \frac13 E[X^2] = \\ &\frac13\left(var(X)+E[X]^2\right)=\frac13\left(\frac{q}{p^2}+(\frac1{p})^2\right)=\frac{2-p}{3p^2} \end{aligned} \]

and

\[ \begin{aligned} &E[XY] = E\{E[XY|X]\}=E\{XE[Y|X]\} = 0\\ &cov(X,Y) = E[XY]-E[X]E[Y]=0\\ &cor(X,Y)=0 \end{aligned} \]

n=1e4
p=0.25
x=rgeom(n, p)+1
y=runif(n, -x, x)
c(mean(y), var(y), (2-p)/3/p^2, cor(x,y))
## [1]  0.01039907  9.16166783  9.33333333 -0.01538456
(4-2*p)/p^2
## [1] 56

Problem 5

In some game a player draws three cards at random from a full deck of 52 cards, and collects as many dollars as the number of aces among the three. Assume he can play the game as often as he wants, and let \(S_n\) be his combined winnings after \(n\) rounds. Compute the moment generating function of \(S_n\) and use it to find the smallest n such \(E[S_n]>1\).

Let \(X_i\) be his winnings in round i, then \(S_n=X_1+...+X_{n}\) and

\[\psi_{S_n}(t) = [\psi_{X_1}(t)]^{n}\] Now

\[ \begin{aligned} &P(X_1=0) =\frac{ {{4}\choose{0}} {{48}\choose{3}} }{{52}\choose{3}} = 0.78262\\ &P(X_1=1) =\frac{ {{4}\choose{1}} {{48}\choose{2}} }{{52}\choose{3}} = 0.20416 \\ &P(X_1=2) =\frac{ {{4}\choose{2}} {{48}\choose{1}} }{{52}\choose{3}} = 0.01303\\ &P(X_1=3) =\frac{ {{4}\choose{3}} {{48}\choose{0}} }{{52}\choose{3}} = 0.00018\\ &\psi_{X_1}(t)=e^{0t}0.78262+e^{1t}0.20416+e^{2t}0.01303+e^{3t}0.00018\\ &\psi_{S_n}(t)=\left[0.78262+e^{t}0.20416+e^{2t}0.01303+e^{3t}0.00018\right]^{n}\\ \end{aligned} \] \[ \begin{aligned} &\frac{d \psi_{S_n}(t)}{dt}|_{t=0} = \\ &n\left[0.78262+e^{t}0.20416+e^{2t}0.01303+e^{3t}0.00018\right]^{n-1}\times\\ &\left[e^{t}0.20416+2e^{2t}0.01303+3e^{3t}0.00018\right]|_{t=0} = \\ &n\left[0.78262+0.20416+0.01303+0.00018\right]^{n-1}\times\\ &\left[0.20416+2*0.01303+3*0.00018\right] = \\ &n*0.23076>1\\ &n>1/0.23076=4.33 \end{aligned} \]

so he needs n=5