MLB (Angels @ Cardinals): Will a RUN be SCORED in the 3rd Inning?
Yes: At least 1 run in the 3rd Inning
No: No runs in the 3rd Inning
Inputs Needed to Solve
Expected Runs per Game (Angels and Cardinals)
##### User Estimates #####
Angl_RperGame = 5.06
Card_RperGame = 4.62
total_runs = Angl_RperGame + Card_RperGame
print("Angels RUNS per Game is %s" % round(Angl_RperGame,2))
print("Cardinals RUNS per Game is %s" % round(Card_RperGame,2))
print("The total expected Runs for the game is %s" % total_runs)
Angels RUNS per Game is 5.06
Cardinals RUNS per Game is 4.62
The total expected Runs for the game is 9.68
## Inputs Defined in the Problem
period_of_innings = 1
Runs= 0
Method to Solve
- Estimate lambda (expected Runs per Inning) and use the Poisson Distribution to compute the probabilty of zero Runs being scored in the 3rd Inning
lambda_ = total_runs * period_of_innings / 9
print("lambda = the total expected Runs scored by both teams over %s innings" % period_of_innings)
print("lambda = %s * %s / %s" % (round(total_runs,2),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,2)))
lambda = the total expected Runs scored by both teams over 1 innings
lambda = 9.68 * 1 / 9
lambda ~ 1.08
import math
p = math.exp(-lambda_)*(lambda_**Runs)/(math.factorial(Runs))
print("The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)")
print('where k = 0 and lambda = %s' % round(lambda_,2))
print("p = e^(-%s)*(%s^%s)/%s!" % (round(lambda_,2),round(lambda_,2),Runs,Runs))
The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)
where k = 0 and lambda = 1.08
p = e^(-1.08)*(1.08^0)/0!
print("The probability of %s Runs being scored the 3rd Inning is %s" % (Runs,round(p,3)))
The probability of 0 Runs being scored the 3rd Inning is 0.341
Posted on 6/23/2019