Lesson goal: Dice streaks probability

Previous: Tournament odds and binomial series | Home | Next: Three dice small straight

In the 1974 MAA Annual High School Mathematics Examination (Problem #24), contestants computed this probability:

"A fair die is rolled six times. The probability of rolling at least a five at least five times is: (A) 13/729 (B) 12/729 (C) 2/729 (D) 3/729 (E) none of these."

Let's analyze the binomial probability: On any single roll of a fair 6-sided die, the outcomes are $1, 2, 3, 4, 5, 6$. The roll is "at least a five" if it lands on 5 or 6 (2 winning faces out of 6): $$p = \frac{2}{6} = \frac{1}{3}, \qquad q = 1 - p = \frac{2}{3}$$ We roll the die $n = 6$ times, and want the probability of getting $k \ge 5$ successes:
  • Exactly 5 times ($k = 5$): $$P(5) = \binom{6}{5} \left(\frac{1}{3}\right)^5 \left(\frac{2}{3}\right)^1 = 6 \cdot \frac{1}{243} \cdot \frac{2}{3} = \frac{12}{729}$$
  • All 6 times ($k = 6$): $$P(6) = \binom{6}{6} \left(\frac{1}{3}\right)^6 \left(\frac{2}{3}\right)^0 = 1 \cdot \frac{1}{729} \cdot 1 = \frac{1}{729}$$
Adding these two mutually exclusive possibilities together: $$P(\ge 5) = P(5) + P(6) = \frac{12}{729} + \frac{1}{729} = \frac{13}{729} \approx \mathbf{0.01783}$$

In this lesson, we write a nested counting loop in Lua that iterates through all $6^6 = 46,656$ outcomes, counts the winning streaks, and verifies the binomial formula!

Now you try. Replace ???? with 5 and run the code to confirm that 832 out of 46,656 rolls succeed (exactly 13/729).

Type your code here:


See your results here: