Let $X$ and $Y$ be independent random variables such that $X\sim\mathrm{Poisson}(\lambda_1 = 5)$ and $Y\sim\mathrm{Poisson}(\lambda_2 = 15)$. Let $Z = X + Y$ . Compute $\mathrm{Corr}(X, Z)$.
Answer:
$\mathrm{Var}(X) = \lambda_1 = 5$
$\mathrm{Var}(Y) = \lambda_2 = 15$
$\mathrm{Cov}(Z) = \mathrm{Cov}(X, X+Y) = \mathrm{Cov}(X, X) = V(X) = 5$
$\mathrm{Var}(Z) = \mathrm{Var}(X + Y) = V(X) + V(Y) = 5 + 15 = 20$
$\mathrm{Corr}(X, Z) = \dfrac{\mathrm{Cov}(X, Z)}{\sqrt{\mathrm{Var}(X)} \sqrt{\mathrm{Var}(Z)}} = \dfrac{5}{\sqrt{5 \cdot 20}} = 0.5$
I get most of the solution but I'm confused on how they got $\mathrm{Cov}(Z)$
$\mathrm{Cov}(Z) = \mathrm{Cov}(X, X + Y) = \mathrm{Cov}(X + Y, X) = \mathrm{Cov}(X, X) + \mathrm{Cov}(X, Y) \neq \mathrm{Cov}(X, X)$
Could someone explain how they got $\mathrm{Cov}(Z)$?
It does not concern $\mathsf{Cov}(Z)$ (which is even not properly defined) but $\mathsf{Cov}(X,Z)$.
It is found by using that covariance is bilinear:$$\mathsf{Cov}(X,Z)=\mathsf{Cov}(X,X+Y)=\mathsf{Cov}(X,X)+\mathsf{Cov}(X,Y)=\mathsf{Var}X+0=\mathsf{Var}X=5$$
The second equality is on base of linearity. The third on base of definition and on base of independence of $X$ and $Y$.