MLB (Mets @ Yankees): Will the Yankees HIT a HOME RUN during Innings 4-6?
Yes: Yankees hit 1+ HR during INN 4-6
No: Yankees don’t hit HR during INN 4-6
Inputs To Solve
HRs per Game by Team (Yankees)
##### User Estimates #####
NYY_HRperG = 1.59
print("Use %s as total expected HRs for the Yankees for the game."
% NYY_HRperG)
Use 1.59 as total expected HRs for the Yankees for the game.
## Inputs Defined in the Problem
period_of_innings = 3
HRs = 0
Method to Solve
Estimate lambda (rate of HRs hit per 3 innings) and use the Poisson Distribution to compute the probabilty of zero HRs being hit by the Yankees any 3 innings:
lambda_ = NYY_HRperG * period_of_innings / 9
print("lambda = the total expected HRs scored by the Yankees over %s innings" % period_of_innings)
print("lambda = %s * %s / %s" % (round(NYY_HRperG,2),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,2)))
lambda = the total expected HRs scored by the Yankees over 3 innings
lambda = 1.59 * 3 / 9
lambda ~ 0.53
import math
p = math.exp(-lambda_)*(lambda_**HRs)/(math.factorial(HRs))
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),HRs,HRs))
The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)
where k = 0 and lambda = 0.53
p = e^(-0.53) * ((0.53^0)/0!)
Solution
print("The probabilty that the Yankees Yankees hit 1+ HR during INN 4-6 is ~%s" % round(1-p,3))
print("The probabilty that the Yankees don't hit HR during INN 4-6 is ~%s" % round(p,3))
The probabilty that the Yankees Yankees hit 1+ HR during INN 4-6 is ~0.411
The probabilty that the Yankees don’t hit a HR during INN 4-6 is ~0.589