Kim G. answered 09/09/22
Yale student pursuing MA in statistics and PhD in public health
Hi Phil! Here's how I'd approach it:
We read E[(X+2Y)^2 |X,Z] as "the expected value of (X+2Y)^2 given X and Z". So, in other words, what is the expected value of (X+2Y)^2 assuming we already know what X and Z are (e.g. X=2, Z=3)?
First, let's quickly FOIL out the expression on the left:
E[(X+2Y)^2 |X,Z] = E[X^2 + 4XY + Y^2 | X, Z]
Again, this is a conditional expectation - meaning it asks us to assume that we have information about what X and Z are. Since Z = X/Y, we can solve for Y: Y=X/Z. So let's plug that in:
E[(X+2Y)^2 |X,Z] = E[X^2 + 4XY + 4Y^2 | X, Z] = E[X^2+4X(X/Z) + 4(X/Z)^2 | X, Z]
= E(X^2 + 4X^2/Z + 4X^2/Z^2 | X, Z)
So now we've got everything written in terms of quantities we already know (X and Z). That means we treat X and Z like constants (rather than random variables), so the expectation can go away for our final answer:
X^2*(1 + 4/Z+4/Z^2)