Here is the question:
I've seen another similar question, and I have devired another similar recursive formula, however, it expresses $P_n$ in terms of $P_{n-1}$ and $P_{n-k-1}$.
So if I loss the coin for $n$ heads, I could either have the $k$ consecutive heads already in my $n-1$ throws, or I could have no consecutive in my $n-k-1$ throws, throw $n-k$ a tail and have the rest heads. Thus the recusive formula I've obtained is:
$$P_n=P_{n-1}+(1-P_{n-k-1})(1-p)p^k $$ However, it seems like the question wants a recusive formula in terms of $P_{n-1}$. Is there a way to do that?
Hints appreciated.