I am working on a statistics problem that involves finding the variance of two dependent variables being added together.
The question is:
Suppose that on your morning commute you must pass through two traffic lights: the time $X$ you spend stopped at the first light has a mean of $20$ seconds and a standard deviation of $5$ seconds, while the time $Y$ you spend stopped at the second light has a mean of $30$ seconds and a standard deviation of $10$ seconds. Also, suppose that the correlation between $X$ and $Y$ is $p = .3$. What is the variance of the total time $X + Y$ stopped at the traffic lights?
My incorrect attempt at solving it:
I found the covariance as $15$. Then, because the variables are not independent, I thought that I should use the $E(X^2) - (E(X))^2$ formula. This yields $E(X^2) + 2E(XY) + E(Y^2) - (50^2)$. Then, this becomes 400 + $2(615) + 900 - 2500 = 30$.
However, the solution sheet says that the answer is $V(X) + 2\text{Cov}(X,Y) + V(Y) = 5^2 + 2(15) + 10^2 = 155$.
Why is my solution incorrect?
We have $\mathbb E[X+Y]=\mathbb E[X]+\mathbb E[Y]=20+30$. Hence, we get \begin{aligned} \mathrm{Var}(X+Y)&=\mathbb E[(X+Y-20-30)^2]\\ &=\mathbb E[(X-20)^2]+\mathbb E[(Y-30)^2]+2\mathbb E[(X-20)(Y-30)]\\ &=5^2+10^2+2\cdot 0.3\cdot 5\cdot 10, \end{aligned} using the definition of the variance and of Pearson's product-moment coefficient.