Solution
= Solution
For the process to stop on toss $n$, the last toss must be the $k$th head, while the first $n-1$ tosses must contain exactly $k-1$ heads. Hence the <negative binomial distribution> gives
$$
\boxed{
\mathbb P(T=n)
=\binom{n-1}{k-1}p^k(1-p)^{n-k}},
\qquad n\geq k.
$$