A fair cube with sides numbered 1-6 is rolled again and again. Let X be the number of the roll where the outcome number changes for the first time, and Y for the second time. For example, for the sequence 4,4,1,4,2 X=3 and Y=5.
Calculate: cov(X,Y) , Answer by book: $\frac{6}{25}$
Unless I am mistaken, I managed to calculate myself that E(X)=$\frac{11}{5}$. Im not sure what to do with Y. when I calculate P(Y=y) and assume X=x,the answer is independent of x (it cancels out),but X and Y are clearly not independent since the covariance is not 0.
thanks in advance
In the sequence $AABAC$, is $Y=5$ (the OP's interpretation) or $Y=4$ (the interpretation of @RossMillikan)?
Surprisingly, it doesn't matter!
HINT:
Let $Z = Y-X$ be the number of additional rolls you need until the "second change" (either interpretation).
Key idea: Convince yourself that $X$ and $Z$ are independent (in both interpretations).
Use linearity of covariance: $Cov(X,Y) = Cov(X,X+Z) = \dots???$
You should now be left with a single term whose value you can look up in wikipedia.
Is this helpful? Do you need more hints?