W2 quiz Calculating a mean value in a joint probability table

Hello everyone! While doing the Week 2 quiz I got a bit stuck with the calculation of a mean value in a joint distribution table, where we have two variables, x and y, so I used “the gut feeling” to solve that particular question, but I really want to understand… Here is the table:
image

And the mean of x is:
μx=(0×0.2+1×0.1)+(0×0.1+1×0.6)=0.7

Which means that it depends on values of y and this is something I cannot get. I failed to find an explanation in the week videos also :frowning: Could please someone explain, how to calculate the mean in these multi-variable distributions and why the mean of x depends on y also.

I believe there was an error in that quiz, which has now been fixed.

If you still see the problem, please post back.

Since I am on the older version of the course (otherwise my progress will be lost) I don’t know, but hopefully it is fixed :slight_smile:

It is unlikely the old version of the course is still getting maintenance.
I’ll ask the course staff. It could take a few days to get an answer.

@ossovskiy,

I changed the presentation of data and it helped me visualize it better:

X0011
Y0101
P0.20.10.10.6
Now, the problem is the same as the one in the "Covariance of a Probability Distribution" video, around minute 6. For each of means of X and Y, you need to take a marginal distribution of the data, i.e., ignore the other variable. You found μX correctly. If we do the same thing for μY, we'll have:

μY = 0.2(0) + 0.1(1) + 0.1(0) + 0.6(1) = 0.7

In other words, E[ X ] = E[ Y ] = 0.7. Next, you need to calculate E[ XY ]:

E[ XY ] = 0.2(0 * 0) + 0.1(0 * 1) + 0.1(1 * 0) + 0.6(1 * 1) = 0.6

Finally, you can put it all together:

Cov(X,Y) = E[ XY ] - E[ X ]E[ Y ] = 0.6 - (0.7 * 0.7) = 0.11

Note that you can solve the problem with the other method too:

Cov(X,Y) = Σ(p(xi, yi) (xi - μX)(yi - μY) =
0.2(0 - 0.7)(0 - 0.7) + 0.1(0 - 0.7)(1 - 0.7) + 0.1(1 - 0.7)(0 - 0.7) + 0.6(1 - 0.7)(1 - 0.7) = 0.11

1 Like

Thank you my friend!