Expected number of coin tosses before $k$ heads If the probability of getting a head is $p$, how do you compute the expected number of coin tosses to get $k$ heads?  
I thought this might be the mean of the negative binomial distribution but this gives me $pk/(1-p)$ which is $k$ for $p=1/2$ which can't be right.
 A: Let $X_1$ be the number of coin tosses until the first head, $X_2$ be the number of coin tosses after that until the second head, and so on. We want $E[X]$ where $X = X_1 + X_2 + \dots + X_k$. By linearity of expectation, we have $E[X] = E[X_1] + E[X_2] + \dots + E[X_k]$.
For any $i$, the number $E[X_i]$, the expected number of coin tosses until a head appears, is $\dfrac{1}{p}$. You can see this by calculating the mean of the geometric distribution, or by noticing that $E[X_i] = 1 + (1-p)E[X_i]$, etc.
All this gives $E[X] = \dfrac1p + \dfrac1p + \dots + \dfrac1p = \dfrac{k}p$.
A: The question has been answered well but for the record, I'm adding an alternate solution using conditional probability. Let $E[N_k]$ be the expectation of the number of tosses for having $k$ heads. Let random variable $X_1$ denote the result of the first toss. 
$$E[N_k] = E[N_k|X_1=H].P(X_1=H) + E[N_k|X_1=T].P(X_1=T)$$
When we know that first toss gave $T$, we still need $k$ more heads and the expected value rises by one, i.e. $$E[N_k|X_1=T] = 1 + E[N_k]$$ 
And when first toss gives $H$, we need $k-1$ more heads and therefore $$E[N_k|X_1=H] = 1 +  E[N_{k-1}]$$
Using above, we get 
$$E[N_k] = (1+E[N_{k-1}]).p + (1+E[N_k]).(1-p)$$
$$E[N_k] = E[N_{k-1}] + \frac{1}{p}$$
As $E[N_0] = 0$, 
$$E[N_k] = \frac{k}{p}$$ 
A: you can compute the probability that the k-th head was tossed in n-th move - of course $n \geq k$, then you know n-th toss has to be a head so that's probability 1/2 which you have to multiply by the probability that in the preceeding n-1 tosses you got exactly k-1 heads - you pick k-1 'places' where you got a head, on the rest you need a non-head so it's numer of ways you can pick k-1 places from n-1 places times $2^{-(n-1)}$ - the probability that you got the results you wanted. For the places computing use the Newton binomial factor. Then what you're left with is just computing a sum of a series - I guess you can fill the details, and if you have problems with the sum post your results here and someone will help
