2

Here is the question:

enter image description here

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.

koifish
  • 2,779
  • You correctly formulated the two cases as described, but I think their description of case 2 is wrong, or at least it does not match their definition of $P_n$. I reckon that cases where there are two or more strings of $k$ consecutive heads should also be included, so it does not matter whether the first $n-k-1$ flips contain such a string or not. Also, their definition of $P_n$ does not say it should be exactly $k$ long (a longer string of heads also contains strings of $k$ heads after all) so I'm not convinced that you need to force flip $n-k$ to be a tail. – Jaap Scherphuis Jan 28 '20 at 08:59
  • Actually, I retract my previous comment - it would lead to double counting. For case 2 you really need to ensure that no previous k-string of heads occurs so that you only count the sequences where the first such k-string is at the end (all the others are already included in case 1). I think your answer is correct, and it inevitably leads to the use of $P_{n-k-1}$ in the recursive formula. – Jaap Scherphuis Jan 29 '20 at 12:03

0 Answers0