# Homework Help: Joint probability density function

1. Apr 12, 2013

### drawar

I'm practicing the past year papers to prepare for my coming finals. Please make necessary corrections if you feel something wrong with it, thanks!
Also, I'm supposed to do this in less than half an hour, so any suggestions on how to shorten this answer is really much appreciated!

1. The problem statement, all variables and given/known data
The joint density function of X and Y is given by
$f(x,y) = \frac{K}{y}{e^{ - \frac{{{y^2}}}{2} - \frac{x}{y}}}$ for $0 < y < x < \infty$
and 0 elsewhere, where K is the normalizing constant.
(i) Determine the value of K.
(ii) Find the marginal probability density function of Y .
(iii) Evaluate E[Y] and Var(Y).
(iv) Find the conditional density function ${f_{X|Y}}(x|y)$ for 0 < y < x, and then evaluate E[X|Y].
(v) Evaluate E[X].
(vi) Evaluate Cov(X; Y ).

2. Relevant equations

3. The attempt at a solution

(i)
$\int\limits_0^\infty {\int\limits_0^x {\frac{K}{y}{e^{ - \frac{{{y^2}}}{2} - \frac{x}{y}}}dydx = } } K\int\limits_0^\infty {\int\limits_y^\infty {\frac{1}{y}{e^{ - \frac{{{y^2}}}{2} - \frac{x}{y}}}dxdy = } } K\int\limits_0^\infty {\frac{1}{y}{e^{ - \frac{{{y^2}}}{2}}}} \int\limits_y^\infty {{e^{ - \frac{x}{y}}}} dxdy = K\int\limits_0^\infty {\frac{1}{y}{e^{ - \frac{{{y^2}}}{2}}}y{e^{ - 1}}} dy = K{e^{ - 1}}\sqrt {2\pi } \frac{1}{{\sqrt {2\pi } }}\int\limits_0^\infty {{e^{ - \frac{{{y^2}}}{2}}}} dy = K{e^{ - 1}}\sqrt {2\pi } \frac{1}{2}$ because here I think y can be seen to follow a standard normal distribution whose graph is symmetrical about 0, so the area of the right half of the curve, which is equal to $\frac{1}{{\sqrt {2\pi } }}\int\limits_0^\infty {{e^{ - \frac{{{y^2}}}{2}}}} dy$ is 1/2.
The above integral must equal 1, hence we solve $K = e\sqrt {\frac{2}{\pi }}$

(ii) It follows directly from (i) that ${f_Y}(y) = K\int\limits_y^\infty {\frac{1}{y}{e^{ - \frac{{{y^2}}}{2} - \frac{x}{y}}}dx = K} {e^{ - \frac{{{y^2}}}{2}}}{e^{ - 1}} = {e^{ - \frac{{{y^2}}}{2}}}\sqrt {\frac{2}{\pi }}$

(iii)$E[Y] = \int\limits_0^\infty y {e^{ - \frac{{{y^2}}}{2}}}\sqrt {\frac{2}{\pi }} dy = \sqrt {\frac{2}{\pi }}$

Let Z ~ N(0,1) => E[Z^2]=Var(Z)=1. Thus $E[{Z^2}] = \frac{1}{{\sqrt {2\pi } }}\int\limits_{ - \infty }^\infty {{z^2}{e^{ - \frac{{{z^2}}}{2}}}dz = 1} \Rightarrow \frac{1}{{\sqrt {2\pi } }}\int\limits_0^\infty {{z^2}{e^{ - \frac{{{z^2}}}{2}}}dz = \frac{1}{2}}$, and then

$E[{Y^2}] = \sqrt {\frac{2}{\pi }} \int\limits_0^\infty {{y^2}} {e^{ - \frac{{{y^2}}}{2}}}dy = \sqrt {\frac{2}{\pi }} \int\limits_0^\infty {{z^2}{e^{ - \frac{{{z^2}}}{2}}}dz = } \sqrt {\frac{2}{\pi }} \times \frac{1}{2} \times \sqrt {2\pi } = 1$

$Var(Y) = E[{Y^2}] - E{[Y]^2} = 1 - \frac{2}{\pi } = \frac{{\pi - 2}}{\pi }$

(iv)
${f_{X|Y}}(x|y) = \frac{{f(x,y)}}{{{f_Y}(y)}} = \frac{1}{y}{e^{1 - \frac{x}{y}}}$

$E[X|Y = y] = \frac{e}{y}\int\limits_0^\infty {x{e^{ - \frac{x}{y}}}} dx = \frac{e}{y}\left( {\frac{{{y^2} + y}}{e}} \right) = y + 1$

(v)
$E[X] = E[E[X|Y]] = E[Y + 1] = 1 + E[Y] = 1 + \sqrt {\frac{2}{\pi }}$

(vi)
$E[XY] = E[E[XY|Y]] = E[YE[X|Y]] = E[Y(Y + 1)] = E[{Y^2}] + E[Y] = 1 + \sqrt {\frac{2}{\pi }}$

$Cov(X,Y) = E[XY] - E[X]E[Y] = 1 + \sqrt {\frac{2}{\pi }} - \left( {1 + \sqrt {\frac{2}{\pi }} } \right)\sqrt {\frac{2}{\pi }} = 1 - \frac{2}{\pi }$

2. Apr 13, 2013

### haruspex

I get something a bit different for that last step (and yes, I realise the range is actually from y, not from 0). Everything up to there looks right.

3. Apr 13, 2013

### drawar

Oh, my bad, shouldn't be that careless. Thanks for pointing that out!

$\begin{array}{l} {\rm E}[X|Y = y] = \frac{e}{y}\int\limits_y^\infty {x{e^{ - \frac{x}{y}}}} dx = \frac{e}{y}\left( {\frac{{2{y^2}}}{e}} \right) = 2y \\ {\rm E}[X] = {\rm E}[{\rm E}[X|Y]] = {\rm E}[2Y] = 2{\rm E}[Y] = 2\sqrt {\frac{2}{\pi }} \\ {\rm E}[XY] = {\rm E}[{\rm E}[XY|Y]] = {\rm E}[Y{\rm E}[X|Y]] = {\rm E}[2{Y^2}] = 2{\rm E}[{Y^2}] = 2 \\ Cov(X,Y) = {\rm E}[XY] - {\rm E}[X]{\rm E}[Y] = 2 - \left( {2\sqrt {\frac{2}{\pi }} } \right)\sqrt {\frac{2}{\pi }} = 2 - \frac{4}{\pi } \\ \end{array}$

I hope it's fine now.

Last edited: Apr 13, 2013
4. Apr 13, 2013

### haruspex

Yes, that all looks good.

5. Apr 13, 2013

### drawar

Thank you so much! :)