The **distribution** of number of tosses until getting $k$ consecutive heads

combinatoricsprobabilityprobability theory

Assume a fair coin. The expectation of the number of tosses $X$ until getting $k$ consecutive heads is well known.

What is the PMF of $X$? ($k$ might not be $2$) I searched high and low but there is no satisfactory answer.

Best Answer

Suppose $n>k$. To get $P(X=n)$ recursively we note that your string must begin with $H^iT$ for $i\in \{0, \cdots, k-1\}$. Then, after that initial block of length $i+1$ you are back where you started. Thus $$P(X=n)=\sum_{i=0}^{k-1} \frac 1{2^{i+1}}P(X=n-i-1)$$

This provides a handy way to compute $P(X=n)$, though it falls well short of a convenient analytic expression. I'm not sure there's any reason to expect such an expression to exist.