[Math] Probability that an event will occur X times in a row at any point in Y trials

probabilitystatistics

Event AA has a $60\text{%}$ failure rate. Given $256$ trials, what is the probability that at some point event AA will fail $9$ times in a row?

Is there a formula that is fairly plug-and-play?

I realize that the probability for AA to fail $9$ trials in a row is equal to $(6/10)^9$, but accounting for the $256$ trials throws me off.

I have a basic understanding of statistics and probability, so I would appreciate the clarification of variables in an equation.

Best Answer

After $N$ trials, you can either have 9 failures in a row or not, and the sequence of trials can end in anywhere between $0$ and $8$ failures in a row if 9 failures have not occurred in a row so far. Write down recurrence relations that give you the probabilities for these cases for $N+1$ trials in terms of the probabilities for these cases for $N$ trials. Then a computer program will very very quickly give you the answer if you build up the cases in terms of increasing $N$ and remember the previous values for smaller $N$. Or, you can solve the system analytically but that will likely involve finding the roots of a 9th degree polynomial and then computing with powers of those roots.