 2018-04-04, 22:07   #5
wblipp

"William"
May 2003
New Haven

3×787 Posts Quote:
 Originally Posted by Nick How many ways are there of throwing $$k-N$$ times without getting $$N$$ heads in a row? What is the probability of each of those possibilities followed by $$N$$ consecutive heads?
Not quite right, either. The $$k-N$$ might have ended with one or more heads. I usually grab the density using the transition matrix for the Markov Chain of #heads in a row with an absorbing state at $$N$$, but this question asks for the mean.

I'd try an inductive approach on the number of heads. To get one head in a row, the first toss is a head with probability p or a tail with probability (1-p). If heads, you are done. If tails, you need the to start over. So

X1 = p*1 + (1-p)*(X1+1)
X1 = 1/p

For k in a row, you need k-1 in a row, then one more toss either finishes it or starts it over.

Xk = p*(X(k-1)+1) + (1-p)(Xk+X(k-1)+1)
Xk = X(k-1)/p + 1/p

The logic of the last equation is conditioned on the results of the flip after first achieving k-1 heads.

Check that arithmetic - I fixed several errors before posting and might still have some left - but the logic is solid.  