# Expected number of trails to get $n$ heads in a row with an increasing biased coin.

Assume that we have a biased coin with probability $p_1$ of getting H and $1−p_1$ of getting T on the first trial, $p_2$ of getting H and $1−p_2$ of getting T on the second trial and so on such that $2/3<p_1<p_2<p_3...<p_n<1$. The probability $p_i$ of getting H increases as long as we get head in a row. If a tail appears, then we reset to probability $p_1$ of getting H in the next trail and so on.

What is the expected number of trials to get $n$ H in a row?

• You are using $n$ twice in the question, once to determine the 'end' of the sequence of $p_i$ and, again when you are setting the desired number of consequtive $H$ to complete the experiment. Is this intentional? Since $p_i$ are bounded by 1, it's natural that the sequence must be larger than the number of heads to complete experiment – jameselmore May 3 '15 at 20:22
• Yes, because if we get T we restart the trials with $p_1$, the experiment ends when we get $n$ in a row. – Ahmed Younes May 3 '15 at 20:30
• Ah, and you ignore previous trials if a $T$ is thrown? – jameselmore May 3 '15 at 20:33
• I am not sure but should be done about that, suggestions are appreciated. – Ahmed Younes May 3 '15 at 20:37

I'll use $S_i$ to denote the state where we have $i$ heads in a row, $N_i$ the expected number of trials to get to this state for the first time.

To get to the $S_{i+1}$, you first need to get to $S_i$ then you toss the coin. If you get $H$, then the number of trials is $N_i+1$. If you get $T$, you get back to $S_0$ and the number of trials is $N_i+1+N_{i+1}.$

So we have:

$$N_0=0$$ $$N_{i+1}=(N_i + 1)p_{i+1} + (N_i+N_{i+1}+1)(1-p_{i+1})$$

This gives us:

\begin{align} N_{i+1}&=\frac{N_i+1}{p_{i+1}} \\ \end{align}

Therefore:

\begin{align} N_0&=0 \\ N_1&=\frac{1}{p_1} \\ N_2&=\frac{\frac{1}{p_1}+1}{p_2}=\frac{1}{p_1}+\frac{1}{p_1p_2} \\ &\ \ \vdots\\ N_n&=\frac{1}{p_1}+\dots +\frac{1}{p_1\dots p_n} \end{align}