0

Is there any formula to find the probability of not getting heads $3$ times in a row in $20$ tosses? I know that the probability of getting heads $3$ times in a row is $(1/2)^3 = 1/8$. An explanation would greatly appreciated.

Thank You

N. F. Taussig
  • 76,571
  • You will need to calculate the binary words of length $20$ that avoid $111$ ... a similar problem is considered here http://math.stackexchange.com/questions/2181734/how-many-barcodes-are-there/2181767#2181767... There is a variety of approaches & I will write you an answer, for your specific problem, on request. – Donald Splutterwit Mar 18 '17 at 10:54
  • @DonaldSplutterwit : I read your explanation in that link but can't relate that with my problem. Can you write me an answer and explain it to me? thank You – kdebugging Mar 18 '17 at 10:58
  • The answers to this question show how to count binary sequences without $111$. – lulu Mar 18 '17 at 11:10
  • @lulu Should we call this a duplicate of a duplicate ? ... it is the tribonacci numbers ... I will give my answer anyway – Donald Splutterwit Mar 18 '17 at 11:30
  • @DonaldSplutterwit I debated marking it as a duplicate, but decided against it as it is phrased in terms of probability. – lulu Mar 18 '17 at 11:32

1 Answers1

0

We shall use $0$ to denote a tail & $1$ to denote a head. We want to generate binary words of length $20$ that avoid $111$.

Let $a_n$ denote the number of binary words that end with 0 and avoid $111$. Let $\phi_{0}(x)$ denote the generating function for $_n$. Let $b_n$ denote the number of binary words that end with 01 and avoid $111$. Let $\phi_{01}(x)$ denote the generating function for $b_n$. Let $c_n$ denote the number of binary words that end with 11 and avoid $111$. Let $\phi_{11}(x)$ denote the generating function for $c_n$. These functions satisfy the following recursive formulea \begin{eqnarray*} \phi_{11}(x)=x \phi_{01} \\ \phi_{01}(x)=x \phi_{0} \\ \phi_{0}(x)=x+x(\phi_{0}+\phi_{01}+\phi_{11}) \end{eqnarray*} Now solve these and find the coefficients $x^{20}$ in $\phi_{11}$,$\phi_{01}$ and $\phi_{0}$. Add these together to get an answer.

Donald Splutterwit
  • 36,613
  • 2
  • 26
  • 73
  • Thank you @Donald. but I still can't figure it out. Can you give me some more light? – kdebugging Mar 20 '17 at 14:20
  • Solve the system of equations ... we have $\phi(x) =\frac{x}{1-x-x^2-x^3}$ ... The denominator can be translated to give the recurrence relation $a_n=a_{n-1}+a_{n-2}+a_{n-2}$ so very similar to the Fibonacci numbers, but now we need to add the previous three terms in the sequence, hence the name the Tribonacci numbers. The first few are $1,2,4,7,13, \cdots, \color{red}{223317}, \cdots $ ... look them up https://oeis.org/search?q=1%2C2%2C4%2C7%2C13%2C&language=english&go=Search – Donald Splutterwit Mar 20 '17 at 20:43
  • thank you @Donald. I finally understand – kdebugging Mar 27 '17 at 08:16