MLB (Braves @ Mets): Will there be an EXTRA-BASE HIT in the 1st Inning?
7:08PM ESPN
Yes: 1+ XBH in 1st Inning
No: 0 XBH in 1st Inning
Inputs Needed to Solve
XBHs per Game by team (Braves and Mets)
##### User Estimates #####
ATL_XBHperGame = float(146+18+131)/84
NYM_XBHperGame = float(143+9+120)/84
total_XBHs = NYY_XBHperGame + BOS_XBHperGame
print("The total expected XBHs for the Braves is %s" % round(NYY_XBHperGame,3))
print("The total expected XBHs for the Mets is %s" % round(BOS_XBHperGame,3))
print('')
print("The total expected XBHs for the game is %s" % round(total_XBHs,3))
The total expected XBHs for the Braves is 3.309
The total expected XBHs for the Mets is 3.679
The total expected XBHs for the game is 6.988
## Inputs Defined in the Problem
period_of_innings = 1
XBHs= 0
Method to Solve
- Estimate lambda (expected XBHs per Inning)
- Use the Poisson Distribution to compute the probability of zero XBHs being hit in the 1st Inning.
lambda_ = total_XBHs * period_of_innings / 9
print("lambda = the total expected XBHs by both teams over %s innings" % period_of_innings)
print("lambda = %s * %s / %s" % (round(total_XBHs,2),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,2)))
lambda = the total expected XBHs by both teams over 1 innings
lambda = 6.99 * 1 / 9
lambda ~ 0.78
import math
p = math.exp(-lambda_)*(lambda_**XBHs)/(math.factorial(XBHs))
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('')
print("p = e^(-%s) * (%s^%s)/%s!" % (round(lambda_,2),round(lambda_,2),XBHs,XBHs))
The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)
where k = 0 and lambda = 0.78
p = e^(-0.78) * (0.78^0)/0!
print("The probability of zero XBHs being hit in the 1st Inning is %s" % (round(p,3)))
The probability of zero XBHs being hit in the 1st Inning is 0.46
Posted on 6/30/2019