The chance that there are not 4 or more consecutive white balls

combinationscombinatoricsprobability

There are 7 white balls in a row and a fair die (a cube with numbers 1, 2,…, 6 in its six faces). We roll the die 7 times and paint the ith balls into black if we get either 5 or 6 in the ith roll.

(a) What is the expected number of black balls?

(b) What is the chance that there exist 6 or more consecutive black balls?

(c) What is the chance that there are not 4 or more consecutive white balls?

Our study group has answered (a) and (b) and are confident we got those correct. We are just having trouble with the last one (c).

(a) We reasoned that the over all experiment can be modeled by a Binomial(7,$\frac{1}{3}$) where $\frac{1}{3}$ is the probability of painting a ball black (probability of rolling a 5 or 6). Therefore the expected value is just $7 \times \frac{1}{3} \approx 2.3$.

(b) There are only 2 ways to get exactly 6 consecutive black balls so $2 \times (\frac{1}{3})^6$ and one way to get 7 consecutive black balls $(\frac{1}{3})^7$. Therefore P(6 or more consecutive black balls) $= 2 \times (\frac{2}{3})(\frac{1}{3})^6 + (\frac{1}{3})^7$.

(c) So we decided to attempt to calculate it as 1 – P(4 or more consecutive white balls). We believe that we could possibly brute force this by literally finding the probability of every combination of 4 or more consecutive white balls. The problem is that we are studying this question to help us prep for a qualification exam and believe that there should be a non-brute force way to solve it for it to be a valid exam question.

Best Answer

Here is a recursive method:

Let $P(n)$ denote the answer for a string of length $n$ . We remark that $$n≤3\implies P(n)=1 \quad \&\quad P(4)=1-\left(\frac 23\right)^4$$

For $n>4$ we remark that if a sequence is good then it must begin with exactly one of $B,WB,W^2B,W^3B$ and of course it must then be followed by a good sequence of shorter length. It follows that $$P(n)=\frac 13\times P(n-1)+\frac 23\times \frac 13\times P(n-2)+\left( \frac 23\right)^2\times \frac 13\times P(n-3)+\left( \frac 23\right)^3\times \frac 13\times P(n-4)$$

This is very easy to implement mechanically, maybe a bit slow to do with pencil and paper.

We get $$P(5)=0.736625514,\quad P(6)=0.670781893,\quad\boxed {P(7)=0.604938272}$$

Sanity Check: Let's get $P(5)$ by hand. The only "bad" sequences of length $5$ are $W^4B, BW^4, W^5$. Easy to compute the probabilities of each and we get $$P(5)=1-2\times \left(\frac 23\right)^4\times \frac 13-\left( \frac 23 \right)^5=0.736625514$$ which matches the result obtained by the recursion.