We can treat this as a Markov chain. We have $6$ states. For $k=0,1,2,3,4$ state $k$ means that we currently have a string of $k$ losses. State $5$ means that at some time, a string of $5$ losses has occurred, so state $5$ is absorbing. If the probability of a loss is $p$ then the transition matrix is
$$\begin{bmatrix}
1-p&p&0&0&0&0\\
1-p&0&p&0&0&0\\
1-p&0&0&p&0&0\\
1-p&0&0&0&p&0\\
1-p&0&0&0&0&p\\
0&0&0&0&0&1
\end{bmatrix}$$ and the initial distribution is $$X=\begin{bmatrix}1&0&0&0&0&0\end{bmatrix}$$
We simply have to compute $XP^{45}$ and read off the answers.
I wrote a python script to do this:
import numpy as np
p = (1+.0145)/2
P = np.zeros((6,6))
for i in range(5):
P[i,0] = 1-p
P[i,i+1] = p
P[5,5] = 1
X = np.array([1,0,0,0,0,0])
Y = [email protected]_power(P, 45)
print(Y)
This produced the output
[0.2337404 0.12075448 0.06238393 0.03222866 0.0166499 0.53424264]
so the probability of $5$ losses in a row is $$.53424264$$
https://math.stackexchange.com/questions/602123/what-are-the-odds-of-getting-heads-7-times-in-a-row-in-40-tries-of-flipping-a-co
– Mike Kelly Mar 02 '21 at 04:23$
signs and use_
for subscripts.$x_1$
comes out as $x_1$. – saulspatz Mar 02 '21 at 04:40