# Fill a joint table distribution, find covariance and check if two variable are independent.

Choose numbers from {2, 3} by tossing a fair coin; the coin is tossed twice. Choose 2 if the coin turns up Heads and 3 if the coin is Tails. So the possible outcomes are {(2, 2),(2, 3),(3, 2),(3, 3)}. Let X be the first number chosen (so X ∈ {2, 3}) and let Y be the product of the two chosen numbers. Write down the joint distribution of X and Y as a table and then compute the covariance Cov(X, Y ). Are X and Y independent?

So I've done the following table: $$\begin{array}{c|ccc|l} _{\large X}\backslash^{\large Y} & 4 & 6 & 9 \\ \hline 2 & 0.25 & 0.25 & 0 \\ 3 & 0 & 0.25 & 0.25 \\ \end{array}$$

Not sure how to find the covariance from this table. As for the Independence, I know that if X and Y are independent, then their covariance Will be equal to 0, but not the other way around. Not sure if the reasoning has something to do with this or if its something completely different.

## 1 Answer

Covariance is defined by expectations. $$\mathsf{Cov}(X,Y)~{=\mathsf E((X-\mathsf E(X))(Y-\mathsf E(Y)))\\=\mathsf E(XY)-\mathsf E(X)\mathsf E(Y)}$$

You can calculate this from the table. $$\mathsf E(X) = 2\times(0.25+0.25+0)+3\times(0+0.25+0.25)$$ and so forth.

If the covarriance does not equal zero, they are not independent.   If it does equal zero, you will have to examine the probability distribution closer (since, as you know, zero covariance does not imply independence).