Lottery Special: What will be the HIGHEST NUMBERED BALL drawn in MEGA MILLIONS?
Inputs Needed to Solve
##### User Estimates #####
## Inputs Defined in the Problem
# total number of balls to start
total = 70
# number of balls below or equal to 60 to start
balls_below_60 = 60
# number of balls drawn
n = 5
Method to Solve
- [1] determine the probability that drawing n (p_n) is 60 or less after the previous n-1 drawings were also 60 or less.
- [2] calculate the probability that all n balls are 60 or less. P_60
## [1] & [2]
P_60 = 1
for i in range(n):
p_n = (balls_below_60 - i) / (total - i)
print("The prob that drawing %s is 60 or less after the previous %s drawings were also 60 or less is %s" % (i+1,i,round(p_n,2)))
P_60 *= p_n
The prob that drawing 1 is 60 or less after the previous 0 drawings were also 60 or less is 0.86
The prob that drawing 2 is 60 or less after the previous 1 drawings were also 60 or less is 0.86
The prob that drawing 3 is 60 or less after the previous 2 drawings were also 60 or less is 0.85
The prob that drawing 4 is 60 or less after the previous 3 drawings were also 60 or less is 0.85
The prob that drawing 5 is 60 or less after the previous 4 drawings were also 60 or less is 0.85
Solution
print("The probability that the HIGHEST NUMBERED BALL DRAWN is 60 or less is %s" % round(P_60,2))
The probability that the HIGHEST NUMBERED BALL DRAWN is 60 or less is 0.45
Info
download md file
email: krellabsinc@gmail.com
twitter: @KRELLabs
import sys
print(sys.version)
3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
Posted on 5/5/2020