How to calculate variance of W? Find the probability distribution of W?

1.5k Views Asked by At

$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$
2

There are 2 best solutions below

3
On 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.

6
On

Now you calculate $\mathbb E(W^2)$

$\mathbb E(W^2)=\sum_{i=1}^2 \sum_{j=1}^3 (w_{ij})^2 \cdot p(w_{ij})$

$\mathbb E(W^2)=\sum_{i=1}^2 \sum_{j=1}^3 (x_i-y_j)^2 \cdot p(x_i,y_j)$

$=0^2\cdot 0.1+(0-1)^2\cdot 0.1+(0-2)^2\cdot 0.2+(1-0)^2\cdot 0.3+(1-1)^2\cdot 0.2+(1-2)^2\cdot 0.1=1.3$

And finally

$Var(X-Y)=Var(W)=\mathbb E(W^2)-[\mathbb E(W)]^2=1.3-(0.6-0.9)^2=1.21$

with $\mathbb E(W)=\mathbb E(X)-\mathbb E(Y)$

Remark

You can use the formula $V(X+Y)=V(X)+V(Y)+2Cov(X,Y)$ as well.

$Cov(aX,bY)=abCov(X,Y)$

In your case $a=1$ and $b=-1$. Thus $Cov(X,-Y)=-Cov(X,Y)$

And $Cov(X,Y)=\sum_{y=0}^2 \sum_{x=0}^1 p(x,y)\cdot (x-E(x))\cdot (y-E(y))$

$=0.1\cdot (-0.6)\cdot (-0.9)+(-0.1\cdot 0.6\cdot 0.1)+0.2\cdot (-0.6)\cdot 1.1+0.3\cdot 0.4\cdot (-0.9)+0.2\cdot 0.4\cdot 0.1+0.1\cdot 0.4\cdot 1.1=-0.14$

Thus $Cov(X,-Y)=0.14$

And $Var(X)=\mathbb E(X^2)-[\mathbb E(X)]^2=0.6-0.6^2=0.24$

$Var(Y)=\mathbb E(Y^2)-[\mathbb E(Y)]^2=1.5-0.9^2=0.69$

Therefore $Var(X-Y)=0.24+0.69+2\cdot 0.14=1.21$