Probability of only getting k consecutive successes

probability

The question I'm trying to solve is the following.

Independent trials, each resulting in success with probability p, are performed until $k$ consecutive successful trials have occurred. Let $X$ be the total number of successes in these trials, and let $P_n = P(X = n)$. Find $P_k$.

The way I understand the question is that I need to find the probability that, if we perform $m$ trials, there will be $k$ successes, and they will be consecutive.

So I did the following:

$$
P_k = \sum_{i=0}^{\infty}P(X=k|F=i)P(F=i)
$$

F is the number of failures at the beginning.
$$
P_k = \sum_{i=0}^{\infty}P(X=k)P(F=i)
$$

$$
P_k = \sum_{i=0}^{\infty}p^k(1-p)^i
$$

$$
P_k = p^k\sum_{i=0}^{\infty}(1-p)^i
$$

$$
P_k = \frac{p^k}{1-p}
$$

However, the answer is $p^{k-1}$ and I'm struggling to understand why.

Best Answer

The only way $X$ could be $k$ is if the string of outcomes had the form $F^mS^k$ where $F$ denotes Fail, $S$ denotes Success, and $m$ could be any non-negative number.

Now $P(F^mS^k)=(1-p)^mp^k$ so $$P(X=k)=p^k\sum_{m=0}^{\infty} (1-p)^m=p^k\times \frac 1{1-(1-p)}=p^{k-1}$$as desired.