How do I calculate the above when I know that $X \sim Poisson(2)$ and $Y \sim Geometric(1/3)$ and X and Y are independent.
I have said that
$$ E[X+Y] = E[X] + E[Y] = 2 + \frac{1}{1/3} = 2 + 3 = 5 $$ Is this correct? $$ E[(X+Y)^2] = E[X^2 + Y^2 + 2XY] = E[X^2] + E[Y^2] + 2E[X] + 2E[Y] = Var(X) + EX^2 + Var(Y) + EY^2 + 2E[X] + 2E[Y] = 2 + 2^2 + 6 + 9 + 4 + 6 = 31 $$ Is this correct?
Thanks.
By linearity, we have
$$\mathbb{E}[X + Y] = \mathbb{E}[X] + \mathbb{E}[Y] = 2 + \frac{1}{1/3} = 5,$$
which agrees with what you found. Also,
$$\mathbb{E}[(X + Y)^{2}] = \mathbb{E}[X^{2}] + \mathbb{E}[Y^{2}] + 2\cdot \mathbb{E}[XY].$$
Now since we have $\mathbb{E}[Z^{2}] = \text{Var}(Z) + (\mathbb{E}[Z])^{2}$ for any random variable $Z$, we obtain
$$\mathbb{E}[X^{2}] = \text{Var}(X) + (\mathbb{E}[X])^{2} = 2 + 4 = 6. $$ Also,
$$\mathbb{E}[Y^{2}] = \text{Var}(Y) + (\mathbb{E}[Y])^{2} = 6 + 9 = 15.$$
Due to independence, we have $\mathbb{E}[XY] = \mathbb{E}[X] \cdot \mathbb{E}[Y] = 6$. Therefore,
$$\mathbb{E}[(X + Y)^2] = 6 + 15 + 2 \cdot 6 = 33.$$