Covariance of two discrete variables

17 Views Asked by At

Cards with numbers $1, 2, 3, 4, 5, 6$ are put into a bag (6 cards). The monkey randomly pulls out a card. If the monkey gets an even number, she gets $0$ peanuts, if she gets an odd number, she gets $1$ peanut. Let $X$ be the number she picks (from $1$ to $6$), and $Y$ - the number of peanuts she gets ($0$ or $1$). I need to find the covariance of $X$ and $Y$.

My solution:

For $X$ and $Y$ their joint PMF looks like this:

enter image description here

Then I try to apply the definition of covariance: $$cov\left(X,Y\right)=\mathbf{E}\left(\left(X-\mathbf{E}X\right)\left(Y-\mathbf{E}Y\right)\right)=\mathbf{E}\left(XY\right)-\mathbf{E}X\mathbf{E}Y$$

I know how to find $\mathbf{E}X$ and $\mathbf{E}Y$, but I'm having trouble finding $\mathbf{E}(XY)$

The way I see it: $1*1*1/6 + 3*1*1/6+5*1*1/6=9/6$

But the answer $9/6-3.5*0.5$, which is $\mathbf{E}\left(XY\right)-\mathbf{E}X\mathbf{E}Y$ seems wrong.

Where is my mistake?

1

There are 1 best solutions below

0
On BEST ANSWER

$$\mathbb{E}(X)=3.5$$

$$\mathbb{E}(Y)=\frac{3}{6}$$

$$\mathbb{E}(XY)=\frac{1}{6}+3\cdot\frac{1}{6}+5\cdot\frac{1}{6}=\frac{9}{6}$$

Thus

$$\mathbb{Cov}(X,Y)=\frac{9}{6}-3.5\cdot\frac{3}{6}$$