Probability of consecutive events This question refers to the formula by @leonbloy {Occurrence of 5 consecutive tails before occurrence of 2 consecutive heads}

Why is the formula asymmetric, i.e. the order of head/tail as arguments matters (e.g. 5 head + 2 tails vs. 5 tails + 2 heads), while $p_h$ (probability of head) is equal to $p_t$ (probability of tail) given the implicit assumption of a fair coin ?

Also what would it be if $p_t ≠ p_h$ ?

Your thoughts appreciated.
It might be better to say:


  The probability of getting $a$ runs of one particular side of the coin before getting $b$ runs of the other side of the coin is $$P(E) = \frac{2^b-1}{2^a + 2^b - 2}$$


The situation is symmetric in the sense that it doesn't matter what sides of the coin you're talking about --- heads or tails. But it does matter that the runs of $a$ come before the runs of $b$. 

Intuitively, $a$ and $b$ are not symmetric because if you increase $a$ (the number of runs you have to get first), you expect the likelihood of success to go down. If you increase $b$ (the number of runs you have to avoid getting before succeeding at $a$), you expect the likelihood of success to go up:

It is rather likely to get a run of 2 before your first run of 1000. It is rather unlikely to get a run of 1000 before your first run of 2. This is true regardless of whether you're talking about heads/tails or tails/heads.


Let's generalize to weighted coins. Suppose you want to know the probability of getting $a$ runs of one side of the coin before getting $b$ runs of the other. Suppose the one side of the coin comes up with probability $\alpha$, and the other side of the coin comes up with probability $\beta = 1-\alpha$.

Then, following that post:

$$\begin{align*}
P(E) &amp;= P(E|T)P(T) + P(E|T^C)P(T^C)\\
&amp; = \frac{p_1}{1-q_1q_2}\alpha + \frac{p_1q_2}{1-q_1q_2}(1-\alpha)\\
&amp; = [q_2 + (1-q_2)\alpha] \frac{p_1}{1-q_1q_2} 
\end{align*}$$

and here $p_1$ and $q_1$ are the probability of succesfully/unsuccessfully getting a run of $a$, and similarly for $p_2, q_2$.

We have $p_1 = \alpha^{a-1}$, $p_2 = (1-\alpha)^{b-1}$, $q_1 = 1-p_1$, $q_2 = 1-p_2$.

$$\begin{align*}
P(E) &amp; = [q_2 + (1-q_2)\alpha] \frac{p_1}{1-q_1q_2} \\
&amp;= [1-(1-\alpha)^{b-1} + (1-\alpha)^{b-1}\alpha] \frac{p_1}{1-q_1q_2}\\
&amp;= [1 + (\alpha-1)(1-\alpha)^{b-1}] \frac{p_1}{1-q_1q_2}\\
&amp;= [1 - (1-\alpha)^{b}]\frac{\alpha^{a-1}}{1-(1-\alpha^{a-1})(1-(1-\alpha)^{b-1})}
\end{align*}$$
It might be better to say:


  The probability of getting $a$ runs of one particular side of the coin before getting $b$ runs of the other side of the coin is $$P(E) = \frac{2^b-1}{2^a + 2^b - 2}$$


The situation is symmetric in the sense that it doesn't matter what sides of the coin you're talking about --- heads or tails. But it does matter that the runs of $a$ come before the runs of $b$. 

Intuitively, $a$ and $b$ are not symmetric because if you increase $a$ (the number of runs you have to get first), you expect the likelihood of success to go down. If you increase $b$ (the number of runs you have to avoid getting before succeeding at $a$), you expect the likelihood of success to go up:

It is rather likely to get a run of 2 before your first run of 1000. It is rather unlikely to get a run of 1000 before your first run of 2. This is true regardless of whether you're talking about heads/tails or tails/heads.


Let's generalize to weighted coins. Suppose you want to know the probability of getting $a$ runs of one side of the coin before getting $b$ runs of the other. Suppose the one side of the coin comes up with probability $\alpha$, and the other side of the coin comes up with probability $\beta = 1-\alpha$.

Then, following that post:

$$\begin{align*}
P(E) &amp;= P(E|T)P(T) + P(E|T^C)P(T^C)\\
&amp; = \frac{p_1}{1-q_1q_2}\alpha + \frac{p_1q_2}{1-q_1q_2}(1-\alpha)\\
&amp; = [q_2 + (1-q_2)\alpha] \frac{p_1}{1-q_1q_2} 
\end{align*}$$

and here $p_1$ and $q_1$ are the probability of succesfully/unsuccessfully getting a run of $a$, and similarly for $p_2, q_2$.

We have $p_1 = \alpha^{a-1}$, $p_2 = (1-\alpha)^{b-1}$, $q_1 = 1-p_1$, $q_2 = 1-p_2$.

$$\begin{align*}
P(E) &amp; = [q_2 + (1-q_2)\alpha] \frac{p_1}{1-q_1q_2} \\
&amp;= [1-(1-\alpha)^{b-1} + (1-\alpha)^{b-1}\alpha] \frac{p_1}{1-q_1q_2}\\
&amp;= [1 + (\alpha-1)(1-\alpha)^{b-1}] \frac{p_1}{1-q_1q_2}\\
&amp;= [1 - (1-\alpha)^{b}]\frac{\alpha^{a-1}}{1-(1-\alpha^{a-1})(1-(1-\alpha)^{b-1})}
\end{align*}$$