MLB (Red Sox @ Yankees): How many RUNS will be SCORED in the 3rd Inning?
8:55PM
1 or 2 Runs
Any Other Number
Inputs To Solve
Runs per Game by Team (Red Sox and Yankees)
##### User Estimates #####
BOS_RperG = 5.72
NYY_RperG = 5.81
expected_total_Rs = BOS_RperG + NYY_RperG
print("Use %s + %s = %s as total expected RUNS to be SCORED in the game." % (BOS_RperG,NYY_RperG,expected_total_Rs))
Use 5.72 + 5.81 = 11.53 as total expected RUNS to be SCORED in the game.
## Inputs Defined in the Problem
period_of_innings = 1
RUNS = [1,2]
Method to Solve
- Estimate lambda (expected arrival rate of RUNS) for 1 Inning
- Use the Poisson Distribution to compute the probability of 1 or 2 RUNS being SCORED in the 3rd Inning
lambda_ = expected_total_Rs * period_of_innings / 9
print("lambda = the total expected RUNS SCORED over %s inning" % period_of_innings)
print("lambda = %s * %s / %s" % (round(expected_total_Rs,3),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,3)))
lambda = the total expected RUNS SCORED over 1 inning
lambda = 11.53 * 1 / 9
lambda ~ 1.281
import math
str_ = ""
print("The probability of k events occurring in a Poisson interval = e^(-lambda) * (lambda^k)/k!")
print("where k = [1,2]")
print(' ')
p_1or2 = 0
for i in RUNS:
p_1or2 += math.exp(-lambda_)*(lambda_**(i))/(math.factorial(i))
if(i==1):
str_ += str(round(math.exp(-lambda_)*(lambda_**(i))/(math.factorial(i)),3)) + " + "
print("e^(-%s) * (%s^%s)/%s! + " % (round(lambda_,2),round(lambda_,2),(i),(i)))
else:
str_ += str(round(math.exp(-lambda_)*(lambda_**(i))/(math.factorial(i)),3))
print("e^(-%s) * (%s^%s)/%s!" % (round(lambda_,2),round(lambda_,2),(i),(i)))
print('')
print('p_1or2 = ' + str_)
The probability of k events occurring in a Poisson interval = e^(-lambda) * (lambda^k)/k!
where k = [1,2]
e^(-1.28) * (1.28^1)/1! + e^(-1.28) * (1.28^2)/2!
p_1or2 = 0.356 + 0.228
Solution
print("The probability that 1 or 2 RUNS are SCORED in the 3rd Inning is ~%s" % round(p,3))
The probability that 1 or 2 RUNS are SCORED in the 3rd Inning is ~0.584
Posted on 8/5/2019