Calculating the variance using the Probability Mass Function (PMF)

3.5k Views Asked by At

My Problem:
The random variables X and Y have the simultaneous probability function pX,Y(x, y).

pX,Y(x, y) X = 0 X = 1 X = 2
Y = 0 0.1 (Z = 0) 0.2 (Z = 1) 0.2 (Z = 2)
Y = 1 0.1 (Z = 1) 0.1 (Z = 2) 0.3 (Z = 3)

What is Variance(X+Y) ?

Answer:
The answer to this problem should be Var(X+Y) = 0.96

My attempt of solving it:
It is known that if X and Y are independent, then
Var(X+Y) = Var(X) + Var(Y)
However, we don't know if they X and Y are independent, thus I will use the following rule:
Var(X+Y) = Var(X) + Var(Y) + 2 CoVar(X,Y)
I think this is tricky, and this is were I get stuck.

My Question:
How should I go about to solve this problem.
I am very thankful for any help and/or guidance.

2

There are 2 best solutions below

2
On BEST ANSWER

The marginal probabilities are given by

$$p_X(x)=\begin{cases}0.2&\text{if }x=0\\0.3&\text{if }x=1\\0.5&\text{if }x=2\\0&\text{otherwise}\end{cases}\qquad p_Y(y)=\begin{cases}0.5&\text{if }y=0\text{ or }y=1\\0&\text{otherwise}\end{cases}$$

From this it's clear that $X$ and $Y$ are not independent, since e.g. $p_{X,Y}(1,0)=0.2$ while $p_X(1)\times p_Y(0)=0.15$. So you have

$$\operatorname{Var}[X+Y]=\operatorname{Var}[X]+\operatorname{Var}[Y]+2\operatorname{Cov}[X,Y]$$

and by definition of variance and covariance,

$$\begin{align} \operatorname{Var}[X]&=E\left[(X-E[X])^2\right]\\&=E\left[X^2\right]-E[X]^2\\[1ex] \operatorname{Cov}[X,Y]&=E\left[(X-E[X])(Y-E[Y])\right]\\&=E[XY]-E[X]E[Y]\end{align}$$

So you need to compute the expectations of $X$, $Y$, and $XY$, along with the second moments of $X$ and $Y$, each of which are trivial. All of them boil down to computing the sum

$$E[f(X,Y)]=\sum_{x,y} f(x,y) p_{X,Y}(x,y)$$

For instance,

$$\begin{align} E[XY]&=\sum_{\substack{x\in\{0,1,2\}\\y\in\{0,1\}}}xy p_{X,Y}(x,y)\\[1ex] &=p_{X,Y}(1,1)+2p_{X,Y}(2,1)\\ &=0.1+2\times0.2\\ &=0.5 \end{align}$$

0
On

Don't over complicate it. You have a small table. You can evaluate the probability for all four values of $X+Y$.

pX,Y(x, y) X = 0 X = 1 X = 2
Y = 0 0.1 (X+Y=0) 0.2 (X+Y=1) 0.2 (X+Y=2)
Y = 1 0.1 (X+Y=1) 0.1 (X+Y=2) 0.3 (X+Y=3)

$\qquad\mathsf p_{X+Y}(z)=\begin{cases} 0.1 &:& z=0\\ 0.3 & : & z\in\{1,2,3\}\\0&:& z\textsf{ is otherwise}\end{cases}$

So...

$\qquad\begin{align}\mathsf {Var}(X+Y) &= \mathsf E((X+Y)^2)-\mathsf E^2(X+Y)\\ &=0.3(1^2+2^2+3^2) -(0.3(1+2+3))^2\\&~~\vdots\\&=0.96\end{align}$