[Math] How to calculate variance of W? Find the probability distribution of W

covarianceprobabilityprobability distributionsvariance

$W=Y-X$

I have figured out that $E(W)=0.3$ by using this formula $E(X+Y)=E(X)+E(Y)$.

I tried using the same formula with $E(X^2)$ and $E(Y^2)$ to find $E(W^2)$.

I also tried using $V(X+Y)=V(X)+V(Y)+2Cov(X,Y)$, but changing all the positive signs to negative, to find the Variance of W.

Here is the joint distribution of $X$ and $Y$:

$$
\begin{array}{c||c|c|c}
& Y=0 & Y=1 & Y=2 \\\hline
X=0 & 0.1 & 0.1 & 0.2 \\
X=1& 0.3 & 0.2 & 0.1
\end{array}
$$

What I think I got right.

  • $E(X) = 0.6$
  • $E(Y) = 0.9$
  • $E(X^2) = 0.6$
  • $E(Y^2) = 1.5$
  • $X$ and $Y$ are not independent

I am also definitely mixing when I can use what formula and when I can't.

Answers:

  • $E(W^2) = 1.3$
  • $Var(W)=1.21$

Best Answer

The easiest thing to do is to first compute the probability distribution of $W$ from the joint distribution of $X$ and $Y$; then use this to compute $\operatorname{Var}[W]$ directly.

to this end, simply create a table for $W$ using the table for $X$ and $Y$:

$$\begin{array}{|c|c|c|c|} \hline x & y & w & \Pr[(X,Y) = (x,y)] \\ \hline 1 & 0 & -1 & 0.3 \\ \hline 1 & 1 & 0 & 0.2 \\ \hline 1 & 2 & 1 & 0.1 \\ \hline 0 & 0 & 0 & 0.1 \\ \hline 0 & 1 & 1 & 0.1 \\ \hline 0 & 2 & 2 & 0.2 \\ \hline \end{array}$$

Then collapse this table for distinct values of $w$, that is to say, add the rightmost column values for each row with the same value of $w$:

$$\begin{array}{|c|c|} \hline w & \Pr[W = w] \\ \hline -1 & 0.3 \\ \hline 0 & 0.2 + 0.1 = 0.3 \\ \hline 1 & 0.1 + 0.1 = 0.2 \\ \hline 2 & 0.2 \\ \hline \end{array}$$

This gives the desired probability distribution of $W$

Now the expectation and variance are trivially computed from this table: $$\operatorname{E}[W] = -1(0.3) + 0(0.3) + 1(0.2) + 2(0.2) = 0.3 \\ \operatorname{E}[W^2] = (-1)^2 (0.3) + 0^2 (0.3) + 1^2 (0.2) + 2^2 (0.2) = 1.3 \\ \operatorname{Var}[W] = \operatorname{E}[W^2] - \operatorname{E}[W]^2 = 1.21.$$

If you calculated the variance from the joint distribution of $X$ and $Y$ directly, then you'd need to go back to get the probability distribution of $W$ for the second part of your question, anyway.

Related Question