Consider repeated independent trials of two outcomes S (success) or F (failure) with probabilities $p$ and $q$, respectively. Determine the distribution of the number of trials required for the first occurrence of the event 50 S containing at least one SSSSS, i.e., totally 50 successes and the 5 successive successes should happen at least one time.
My efforts:
Let $M_n$ be the number of trials required for the first occurrence of totally $n$ S. We have calculated that $P(M_n=k)={k-1\choose n-1}p^{n}q^{k-n}$. Let $N_n$ be the number of trials required for the first occurrence of totally $n$ S containing at least one SSSSS. Then $P(N_n=k)=0$ if $n<5$. We want to determine the distribution of $N_{50}$.
Condition on the following possible initial events:
- A1: The first five results were Fxxxx (with probability $q$ ), x = S or F,
- A2: The first five results were SFxxx (with probability $pq$ ),
- A3: The first five results were SSFxx (with probability $p^2q$),
- A4: The first five results were SSSFx (with probability $p^3q$),
- A5: The first five results were SSSSF (with probability $p^4q$),
- A6: The first five results were SSSSS (with probability $p^5$).
Note that $P(A_1)+P(A_2)+P(A_3)+P(A_4) +P(A_5)+P(A_6)=1$.
Let $k>5$.
In case 1, $P(N_n=k∣\text{first result was F})=P(N_n=k−1)$ because we have just not made any progress towards $n$ S containing SSSSS with the first result, and there are now $k−1$ trials remaining to get $n$ S containing SSSSS.
In case 2, $P(N_n=k∣\text{first two results were SF})=P(N_{n-1}=k−2)$. Although we have just not made any progress towards SSSSS with the first two results, but we do have a S and there is $(n-1)$ S remaining. There are now $k−2$ trials remaining to get $(n-1)$ S containing SSSSS.
In case 3, $P(N_n=k∣\text{first three results were SSF})=P(N_{n-2} =k−3)$. Although we have just not made any progress towards SSSSS with the first three results, but we do have two S and there is $(n-2)$ S remaining. There are now $k−3$ trials remaining to get $(n-2)$ S containing SSSSS.
In case 4, $P(N_n=k∣\text{first four results were SSSF})=P(N_{n-3} =k−4)$. Although we have just not made any progress towards SSSSS with the first four results, but we do have three S and there is $(n-3)$ S remaining. There are now $k−4$ trials remaining to get $(n-3)$ S containing SSSSS.
In case 5, $P(N_n=k∣\text{first five results were SSSSF})=P(N_{n-4} =k−5)$. Although we have just not made any progress towards SSSSS with the first five results, but we do have four S and there is $(n-4)$ S remaining. There are now $k−5$ trials remaining to get $(n-4)$ S containing SSSSS.
In case 6, $P(N_n=k\mid\text{first five results were SSSSS})=P(M_{n-5}=k−5)$. We already have SSSSS. We no longer need to worry about SSSSS. We just need to get $(n-5)$ S and we are done. There are now $k−5$ trials remaining to get $(n-5)$ S.
If you put that all together using the Law of Total Probability $$P(N_n =k)=P(N_n =k\mid A_1)P(A_1)+P(N_n =k\mid A_2)P(A_2)+ +\cdots+P(N_n =k\mid A_6)P(A_6),$$ where $A_1, A_2, A_3, \ldots, A_6$ are the 6 possible initial events, then you get the recursive formula for $k> 5$,
$$P(N_n =k)=qP(N_n =k−1)+pqP(N_{n-1} =k−2)+p^2qP(N_{n-2} =k−3) +\cdots+ p^4qP(N_{n-4} =k−5)+p^5P(M_{n-5}=k−5)$$
Am I on the correct track? Some strange things happen when I tried to calculate the base case $P(N_5=k)$. Please tell me what is $P(N_5=k)$ and help me verify the recursive relation for $P(N_6=k)$.

