Solution
= Solution
Conditioned on exactly $k$ heads, every $k$-element set of head positions is equally likely. There are $\binom nk$ such sets. A run containing all $k$ heads can begin at any of the positions
$$
1,2,\ldots,n-k+1,
$$
and each beginning determines one admissible set. Thus, for $k\geq1$,
$$
\boxed{
\mathbb P(\text{the }k\text{ heads are consecutive}\mid
\text{exactly }k\text{ heads})
=\frac{n-k+1}{\binom nk}}.
$$