# Bernoulli Trials with two random variables - Run of successes and faliures

Consider a sequence of Bernoulli trials with probability of success $p$. Suppose you started the game with a run of succsses followed by the run of faliures (note that you can learn an unlucky run is over if and only if it is followed by a success). Let the random variable $X$ be the number of successful trials any $Y$ be the number of unsuccessful ones (where a run is a sequence of one or more identcal outcome).

Find:
i) Joint probability $P(X=n, Y=m)$?

ii) $E(X)$ & $E(Y)$?

iii) Correlation function of $E(XY)$?

iv) Covariance $Cov(XY)$?

Now after doing some research i believe i have got myself in the right direction for solving these. Here is what i think so far.

i) I thik this would be..... $p^n$$^+$$^1$ $q^m$$^+$$^1$?? usinf the fact it will take one extra trial to realise the end to a run

ii) not sure

iii) have to use this formula prehaps, but not quite sure.... Σ $f(n,m) p (X=n, Y=m)$

iv) I take it this can only be solved if i know the earlier using...$Cov(xy) = E(xy) -E(x) E(y)$

i think these are the right formulas etc i have to use but am struggeling to get past forming problem s which i can then solve.

-