# 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.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 12, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8936731815338135, "perplexity_flag": "middle"}