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:
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:
Share your code
Show a friend, family member, or teacher what you've done!
Here is a share link to your code:
Need a hint?
💡 What now?
The code has ???? for the minimum number of qualifying rolls. The problem asks for rolling at least a five at least five times. Replace ???? with 5 and click Run Code to calculate the exact probability!