Finding the variance of x,y by discrete distribution

3.7k Views Asked by At

I am writing my P exam for actuaries. I have the solution manual but I ran into this question, which confused me. I understood the solution but it did differently in how I wouldve tackled the problem.

This is about finding the $var(y-x)$.

I have a discrete probability chart. I dont know how to draw here but I will try my best to detail it.

So $x = 0, 1, 2$ and $y = 0, 1, 2$ where P(x,y) are $p(0, 0) = 0, p(1, 0) = 0.4, p(2, 0) = 0.2$ this is the first row. then the second row is $p(0,1)=0.2, p(1,1)=0.2, p(2,1) = 0$

ok the total prob of both of them is 1. which we can calculate from the chart.

So how I approached this is I know

$var(x-y) = var(x) + var(y) - 2cov(x, y)$

Then I got confused how would I calculate var(x) or cov(x,y). Like I know their formula. but how would I compute $E(x), E(x^2), E(y), E(y^2),$ and most importantly $E(xy)$

In the solution manual they did change of variables which seemed fine but just finding it like that how would I do it.

Please any help or feedback would be highly appreciated.

Thank you very much

2

There are 2 best solutions below

3
On BEST ANSWER

So what you have is:

            x
       0    1    2

   0   0   2/5  1/5

y  1  1/5  1/5   0

   2   0    0    0

To get the expectations, you multiply the probability by each value of the variable. But note now that the table gives you the joint distribution of $X$ and $Y$ and you want the marginal distributions for this. So for $X$, you sum the columns and for $Y$ you sum the rows, giving:

       0    1    2
p(x)  1/5  3/5  1/5
p(y)  3/5  2/5   0

Recall the definition of the expectation:

$$ E(X)=\sum_{k=0}^\infty k Pr(X=k) $$ which in this case is simply

$$ E(X)=0*\frac{1}{5}+1*\frac{3}{5}+2*\frac{1}{5}=1 $$ and $$ E(Y)=0*\frac{3}{5}+1*\frac{2}{5}+2*0=\frac{2}{5} $$

Similarly, for $E(X^2)$ and $E(Y^2)$ you simply square the values (not the probabilities!):

$$ \begin{align} E(X^2)&=0^2*\frac{1}{5}+1^2*\frac{3}{5}+2^2*\frac{1}{5}=\frac{7}{5}\\ E(Y^2)&=0^2*\frac{3}{5}+1^2*\frac{2}{5}+2^2*0=\frac{2}{5} \end{align} $$

So then you get the variances from $V(X)=E(X^2)-E(X)^2$:

$$ \begin{align} V(X)&=\frac{7}{5}-1^2=\frac{2}{5}\\ V(Y)&=\frac{2}{5}-\frac{4}{25}=\frac{6}{25} \end{align} $$

Now, what remains for the covariance is $E(XY)$. The definition of it is similar to the expectation:

$$ E(XY)=\sum_{k=0}^\infty\sum_{l=0}^\infty kl Pr(X=k, Y=l) $$

Given how I calculated the things above, I hope you can take it from here!

EDIT: Okay, so here's how you do it. First, note that the sums both go from 0 to 2 so we have

$$ E(XY)=\sum_{k=0}^2\sum_{l=0}^2klPr(X=k, Y=l) $$

But, what happens when either $k=0$ or $l=0$? Then you multiply by 0! So in fact, the sums start at 1, giving us:

$$ E(XY)=\sum_{k=1}^2\sum_{l=1}^2klPr(X=k, Y=l) $$

But, if you look at the table, the probability that $Y$ is 2 is equal to 0. This means that there is only one value of $Y$ that goes into the calculation -- $Y=1$. So then we get the answer:

$$ E(XY)=\sum_{k=1}^2kPr(X=k, Y=1)=Pr(X=1, Y=1)+2Pr(X=2, Y=1)=Pr(X=1, Y=1)=\frac{1}{5}. $$

Then we simply use the definition of the covariance:

$$ Cov(X, Y)=E(XY)-E(X)E(Y)=\frac{1}{5}-1*\frac{2}{5}=-\frac{1}{5} $$

Hence, the covariance is equal to $-\frac{1}{5}$.

0
On

We work directly with the table.

You were particularly concerned with $E(XY)$. This turns out to be the most pleasant to calculate. For $XY$ to be non-zero, $X$ and $Y$ must be non-zero. Note that $Y=2$ is not even in the game. And we don't care about the cases $X=0$ and/or $Y=0$, these make no contribution to $E(XY)$.

The only contribution comes from $X=1$, $Y=1$, which happens with probability $0.2$. So $E(XY)=(1)(1)(0.2)$.

Now let us find say $E(X^2)$. Looking at the table, we see that $X=1$ with probability $0.2+0.4$, and $X=2$ with probability $0.2$. We don't care about $\Pr(X=0)$. So $E(X^2)=(1^2)(0.6)+(2^2)(0.2)=1.4$.

While we are at it, we might as well read off $E(X)$, which is $(1)(0.6)+(2)(0.2)=1$.

And $E(Y^2)$ and $E(Y)$ involve less work, since $Y$ cannot be $2$. So $Y^2=Y$. Each has expectation $0.2$.

Now put the pieces together as per your strategy, using $\text{Cov}(X,Y)=E(XY)-E(X)E(Y)$ and $\text{Var}(W)=E(W^2)-(E(W))^2$.

Remark: It is probably easier to find the distribution of $X-Y$, and then calculate the variance as usual. When $Y=0$, we have $X-Y= 1$ with probability $0.4$ and $2$ with probability $0.2$. When $Y=1$, we have $X-Y=-1$ with probability $0.2$ and $0$ with probability $0.2$. So if $W=X-Y$, then $W$ takes on the values $-1,0,1, 2$ with probabilities $0.2,0.2, 0.4,0.2$. Now that we have the distribution, mean and variance of $W$ can be calculated.