What is the expected number of k-length streaks in n rolls?

2.6k Views Asked by At

Given $n$ flips of a coin with success probability $p$, what is the expected number of $k$-length win streaks in $n$?

(I've looked for this question online, but the answers always restrict $n$ to be a power of $2$ or $k$ to be written in terms of $\log$ base $2$. Refrain from that here, if possible.)

1

There are 1 best solutions below

2
On BEST ANSWER

Suppose that $n\ge k+2$. We assume that "winning streak of length $k$" means a sequence of wins that has length exactly $k$. It either (i) begins with the first toss, and is ended by a loss on the $(k+1)$-th toss or (ii) ends with a win on the last toss, or (iii) is bracketed by losses.

Let $W$ be the number of winning streaks of length $k$ that are bracketed by losses. We find $E(W)$. Define random variable $X_i$ by $X_i=1$ if we have a loss at time $i$, followed by $k$ wins, followed by a loss. Let $X_i=0$ otherwise.

Note that for $1\le i\le n-k-1$, we have $\Pr(X_i=1)=(1-p)^2p^k$. For larger $i$, we have $\Pr(X_i=1)=0$. We have $W=\sum X_i$, and therefore by the linearity of expectation $$E(W)=(n-k-1)(1-p)^2p^k.$$ Add to this the expected number of $k$-streaks that begin with the first toss, or continue until the last toss.