2
$\begingroup$

This relates to Q5, part (d) here and given below. The solutions are here.

enter image description here

It boils down to the calculation of $E[Y^2]$ in the solution where I wanted to do this by using $f_Y(y)$ and in the answer it is calculated from $f_{X,Y}(x,y)$.

I used identity: $$ E[g(Y)] = \int_{-\infty}^{\infty} g(y) f_Y(y) \, dy$$ where here $g(Y) = Y^2$.

And:

$f_Y(y) = y$ for $0 \leq y \leq 1$ and for $1 < y \leq 2$ we have $f_Y(y) = 2 - y $.

So $f_Y(y)$ is a triangle looking like:

enter image description here

I split up the piecewise function and tried calculating (this is where I think I'm perhaps wrong): $$E[Y^2] = \int_{0}^{1} g(y) f_Y(y) \, dy + \int_{1}^{2} g(y) f_Y(y) dy$$

To give:

$$E[Y^2] = \int_{0}^{1} y^3 dy + \int_{1}^{2} y^2(2-y) \, dy$$

but this doesn't give the correct answer - so I'm assuming I've set something up wrong.

For what it's worth, I see why the solution essentially did:

$$ E[Y^2] = \int_{0}^{1} \int_{x}^{x+1} g(y) \, f_{X,Y}(x,y) \, dy \, dx $$

with $f_{X,Y}(x,y) = 1$ as it avoids the piecewise trouble.

My question relates to how to calculate $E[Y^2]$ from $f_Y(y)$. After that I'd happily take advice on when to use $f_Y(y)$ or $f_{X,Y}(x,y)$ in future.

Any help greatly appreciated, including directing me to further reading.

$\endgroup$
2
  • $\begingroup$ I haven´t understood yet why you wanted to calculate $E(Y^2)$. $\endgroup$ Aug 2, 2018 at 14:15
  • $\begingroup$ To get the variance of $X + Y$ given by: $$\mathrm{Var} \, (X + Y) = E[(X + Y)^2] - E[X + Y]^2 = E[X^2] + 2E[XY] + E[Y^2] − (E[X + Y])^2$$ $\endgroup$ Aug 2, 2018 at 14:18

1 Answer 1

3
$\begingroup$

I think that you can use both methods. Your method is correct, but I don't understand why you didn't get the right answer, since when I did the calculation you did to find $\mathbb E[Y^2]$ from $f_Y(y)$, I got $7/6$, which is the correct answer.

You can use both methods, but which one you pick depends on the information available. In this question, $f_{XY}(x,y)=1$, so that is easier to work with.

$\endgroup$
1
  • $\begingroup$ Hmmmmmmmm, so it does! Not sure what I was doing before...I would up-vote but don't have the rep. Thanks. $\endgroup$ Aug 2, 2018 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .