This question might seem quite easy for many of you, however, I think I need a little help in the right direction.
I'm currently reading about probability theory and have come across covariance. I know the definition of covariance and I'm trying to solve some exercises.
For instance, I have been given a discrete random variable X with probability function px(x) = 1/2 if x = -1, 1/4 if x = 0, 1/4 if x = 1, 0 otherwise.
Additionally, I have been given a discrete random variable Y, which is independent of X, and has probability function py(y) = 3/4 if y = 0, 1/4 if y = 1, 0 otherwise.
I then have to calculate Cov(Y, 2Y - X). The answer is given and should be 3/8.
What confuses me a bit when I'm reading about covariance is that some of the formulas I have come across uses pairs consisting of X values and Y values, but for example in this exercise there are three X values and only two Y values.
Furthermore, when two discrete random variables X and Y are independent, which this exercise says (it says Y is independent of X), then Cov(X, Y) should be equal to 0. But when I use the rule E(X * Y) = E(X) * E(Y) for independent variables, I, however, end up with a formula indicating that the result should be 0 and not 3/8.
For example when I try to deduce from the definition Cov(X, Y) = E[(X - E[X])(Y - E[Y])] I get the following:
Cov(Y, 2Y-X) = E[(Y - E[Y])((2Y - X) - E[2Y - X])]
This can be rewritten using Cov(X, Y) = E[X * Y] - E[X] * E[Y] which I think is more manageable:
Cov(Y, 2Y-X) = E[Y * (2Y - X)] - E[Y] * E[2Y - X]
Since X and Y are independent, I should be able to use the rule E(X * Y) = E(X) * E(Y) so that I get:
Cov(Y, 2Y-X) = E[Y] * E[2Y - X] - E[Y] * E[2Y - X]
which indicate the result is 0, which is wrong according to the result given.
So if we say I'll just try to proceed with this one:
Cov(Y, 2Y-X) = E[Y * (2Y - X)] - E[Y] * E[2Y - X]
How do I continue from here? I know how to calculate the expected value of Y for example, but how do I calculate the expected value of 2Y - X? The formula I found for this suggested using pairs of X values and Y values, but I don't know how to do that when there aren't the same amount of X values and Y values.