# Probability of at least one streak of 5 heads in 100 tosses of a fair coin

What is the probability of at least one streak of 5 heads in 100 tosses of a fair coin? ($n=100,p=0.5,k=5$.)

Additional question: what is the general formula for any $n, p, k$ (and proof)?

• math.stackexchange.com/questions/234062/… – JohnColtraneisJC Aug 2 '17 at 5:23
• @BenjaminMoss: Yes I saw that and this, plus a couple more formulas on the web, all of which look different. Moreover, they all seem like casual discussions and do not exactly inspire confidence. I am hoping for a more definite answer with a rigorous proof. – user20311 Aug 2 '17 at 5:25
• does a streak of 6 heads count or you need exactly 5 heads? – kludg Aug 2 '17 at 5:28
• you did not understand. Does a streak of 6 heads counts as a streak of 5 heads? – kludg Aug 2 '17 at 5:29
• @kludg: You did not express yourself clearly. Answer: Yes. – user20311 Aug 2 '17 at 5:30

One can model this as a Markov chain. This will have states labelled $0$, $1$, $2$, $3$, $4$ and $5$. State $0$ is initial; you start there, and state $5$ is absorbing; if you reach it you remain there. At state $k$ ($0\le k\le 4$), tossing a head takes you to state $k+1$ and tossing a tail to state $0$. So the state basically keeps track of the current run of heads. So the question is, what is the probability you reach state $5$ after $100$ tosses. This can be solved by standard Markov chain methods, for instance using the transition matrix.