What is the expected number of strings of exactly k consecutive heads if a fair coin is tossed n times?
My current answer is $$ {n-1\choose k} (\frac{1}{2})^{(k-1)} $$
Is this correct?
A possible string : HTHHHTHH. This has 3 strings for 2 consecutive heads. The string for 3 Hs, is also 2 strings for 2 consecutive Hs.
The probability of tossing $k$ consecutive heads in $k$ tosses is simply $(1/2)^k$. There are $n-k+1$ possible starting positions (if we start counting after the $n-k+1$th toss, we do not have enough tosses for $k$ consecutive heads). Thus, the expected number is simply $\frac{n-k+1}{2^k}$.
Edit: To make this clearer, for $i = 1, \dots, n-k+1$, let $X_i$ be an indicator function such that $X_i = 1$ if there are $k$ consecutive heads starting at position $i$ and $0$ otherwise. Then $P(X_i = 1) = 1/2^k$. The total number $T$ of $k$ consecutive heads is $$T = X_1 + \dots + X_{n-k+1}.$$ Thus, $E[T] = (n-k+1)E[X_1] = \frac{n-k+1}{2^k}.$