1

The continuous random variables $X$ and $Y$ have joint density function $f_{xy} = 1$ for $0 < x < 1$ and $2x < y < 2$, and zero otherwise.

I am stuck on the above question, with parts a and b below:

a) Find the $cov(x,y)$.

Work:

$cov(x,y) = E(XY) - E(X)E(Y)$

$= \int_0^1\int_{2x}^2 xydydx - \int_0^1\int_{2x}^2 xdydx\int_0^1\int_{2x}^2 ydydx$ = $\frac{-1}{18}$

However I am given the answer $\frac{1}{18}$. Did I make a mistake in my computation or is the answer incorrect?

b) Find $E(X|Y = y)$.

Work:

$E(X|Y=y) = \int_{-\infty}^{\infty}xf_{x|y}(x|y)dx$

This is where I am puzzled. I know that $f_{x|y}(x|y) = \frac{f_{xy}(xy)}{f_yy}$, and $f_yy= \int_{-\infty}^{\infty}f_{x,y}(x,y)dx$. That means $f_yy = 1$ and therefore $f_{x|y}(x|y) = 1$. However I am given the answer $E(X|Y=y) = \frac{y}4$. Again, did I make a computational mistake or am I not getting something?

Thanks.

StubbornAtom
  • 17,052
peco
  • 309

1 Answers1

0

The densities are usually denoted with subscripts in capital letters for the random variables.

For part (a), it is an algebraic error on your part. For part (b), you are not paying attention to the supports of the random variables in your calculations. Hence the absurd answers.

Define the indicator $$1_A(x)=\begin{cases}1&,\text{ if }x\in A\\0&,\text{ otherwise }\end{cases}$$

Then joint density of $(X,Y)$ is $$f_{X,Y}(x,y)=1_{(0,1)}(x)1_{(2x,2)}(y)$$

So density of $Y$ is

\begin{align} f_{Y}(y)&=\int f_{X,Y}(x,y)\,dx\,1_{(0,2)}(y) \\&=\int_0^{y/2}\,dx\,1_{(0,2)}(y) \\&=\frac{y}{2}\,1_{(0,2)}(y) \end{align}

Thus giving the density of $X$ conditioned on $Y=y$ for each $y\in(0,2)$:

$$f_{X\mid Y=y}(x)=\frac{2}{y}\,1_{(0,y/2)}(x)$$

Hence $$\mathbb E\left[X\mid Y=y\right]=\int x f_{X\mid Y=y}(x)\,dx=\frac{y}4$$

StubbornAtom
  • 17,052
  • sorry, but can you explain why the bounds of $f_{Y}(y)$ = 0 and $\frac{y}{2}$? – peco Dec 02 '18 at 21:09
  • @peco Look at the support of $(X,Y)$. There is dependency between $x$ and $y$, so you have to account for that when you integrate over $x$. $$0<x<1, 2x<y<2\implies 0<x<y/2,0<y<2$$ – StubbornAtom Dec 02 '18 at 21:53
  • ok, so that means since $2x<y , x<\frac{y}{2}$. thanks! – peco Dec 02 '18 at 21:58