1

In roulette, there are $38$ slots the ball can fall into. $18$ are red, $18$ are black, and $2$ are green.

If a roulette wheel receives $100$ spins per evening, what is the chance that $5$ consecutive reds will occur sometime during the evening?'

Attempted Solution:

I used the formula provided by Byron here: Probability for the length of the longest run in $n$ Bernoulli trials. I found that the probability is $.7295$. Intuitively, it sounds like this makes sense. However, I calculated this in excel, and excel stopped being able to compute the combinatorial portion of the formula due to extremely small values. For this reason I neglected those particular values.

In order to make sure I answered this correctly, I was hoping someone knew another way to solve this, whether it be a programming language you know or if you know how to run a Monte Carlo simulation in excel. Neither of which I know how to do.

Any help would be much appreciated.

Remy
  • 8,128

2 Answers2

5

(This implements ShawnD's answer to the question you link to).

We can write down a recurrence for

  • $a_n$: The probability that after $n$ spins we have not seen 5 consecutive reds, and the last spin was not red.
  • $b_n$: The probability that after $n$ spins we have not seen 5 consecutive reds, and the sequence so far ends with one red.
  • $c_n$: The probability that after $n$ spins we have not seen 5 consecutive reds, and the sequence so far ends with two reds.
  • $d_n$: The probability that after $n$ spins we have not seen 5 consecutive reds, and the sequence so far ends with three reds.
  • $e_n$: The probability that after $n$ spins we have not seen 5 consecutive reds, and the sequence so far ends with four reds.

Namely, $$ \begin{bmatrix} a_{n+1} \\ b_{n+1} \\ c_{n+1} \\ d_{n+1} \\ e_{n+1} \end{bmatrix} = \frac{1}{38}\begin{bmatrix} 20 & 20 & 20 & 20 & 20 \\ 18 & 0 & 0 & 0 & 0 \\ 0 & 18 & 0 & 0 & 0 \\ 0 & 0 & 18 & 0 & 0 \\ 0 & 0 & 0 & 18 & 0 \end{bmatrix} \begin{bmatrix} a_n \\ b_n \\ c_n \\ d_n \\ e_n \end{bmatrix} $$ with the initial conditions $a_0 = 1$, $b_0=c_0=d_0=e_0=0$.

The probability we're looking for is to compute one minus the sum of the first column of $$ \begin{bmatrix} 20/38 & 20/38 & 20/38 & 20/38 & 20/38 \\ 18/38 & 0 & 0 & 0 & 0 \\ 0 & 18/38 & 0 & 0 & 0 \\ 0 & 0 & 18/38 & 0 & 0 \\ 0 & 0 & 0 & 18/38 & 0 \end{bmatrix} ^{100}$$

With a linear-algebra library, raising a 5×5 matrix to the 100th power is quite quick and painless (using exponentiation by squaring it takes only 8 matrix multiplications). Or Wolfram Alpha can do it for us, giving $$ \begin{bmatrix} 0.144322 & 0.14023 & 0.131708 & 0.113959 & 0.0769927 \\ 0.0692934 & 0.0673289 & 0.0632374 & 0.0547155 & 0.0369667 \\ 0.03327 & 0.0323268 & 0.0303623 & 0.0262707 & 0.0177489 \\ 0.015974 & 0.0155211 & 0.0145779 & 0.0126134 & 0.00852181 \\ 0.00766962 & 0.00745219 & 0.00699932 & 0.0060561 & 0.00409159 \end{bmatrix}$$ So we have $$ 1-0.14432-0.06929-0.03327-0.01597-0.00767 = 0.72948 $$ which is consistent with your result.

  • Interesting. I was not aware you could use linear algebra to approach this problem. – Remy Apr 25 '17 at 20:06
2

You can implement Henning Makholm's approach in Excel. Make a column for each of $a$ through $e$ and a row for each number of spins. As $a_{n+1}=\frac {20}{38}(a_n+b_n+c_n+d_n+e_n)$ and typical of the others $c_{n+1}=\frac {18}{38}b_n$. The rows can be $n$ and you can write these equations in. Copy down is your friend.

Ross Millikan
  • 374,822
  • Indeed. In general doing matrix exponentiation by squaring should be more numerically robust than running the recurrence one step at a time, but I don't think that makes any significant difference in this case. – hmakholm left over Monica Apr 26 '17 at 12:11
  • @HenningMakholm: wouldn't it be even better to diagonalize the matrix and take the power of the diagonal? At these parameters there is no numeric issue but you are right one could arise. – Ross Millikan Apr 26 '17 at 14:02
  • x @Ross: Possibly, at least if the exponent is large enough. I must admit I'm not up to speed on the possible numeric pitfalls of matrix diagonalization. – hmakholm left over Monica Apr 26 '17 at 14:11