Suppose I have a biased coin that comes up heads with probability $p$ and tails with probability $1-p$ with some $p$ such that $0 < p < 1$.
I flip the coin $n \geq 1$ times. I choose some $m$ so that $1 \leq m \leq n$.
I am trying to find the probability, in terms of $p$, $n$, and $m$, of the following being true:
During the $n$ tosses, at some point there is a streak of (at least) $m$ consecutive heads.
Let $f(n,m,p)$ be the probability that such a streak exists.
I am trying to find a general formula for $f$ in terms of $n$, $m$, and $p$, but I don't know how to solve this.
I can figure out some of the easier cases, where I fix one of $n$, $m$ or $p$ and write $f$ in terms of the other two variables:
- $$f(1, m, p) = p$$ (in this case $n=1$ forces $m=1$ and this is just the probability of heads on one flip)
- $$f(n,1,p) = (1-p)^n$$ (in this case we can find $1$ minus the probability of no heads)
I don't know how to find a general formula (or a good approximation) for $f(n,m,p)$. I am guessing that the problem is very difficult.
Any help is appreciated, thank you!!