Jun 4 2019
MLB 7:07 PM
MLB (Yankees @ Blue Jays): How many EXTRA-BASE HITS will OCCUR in the FIRST 2 INNINGS?
0 or 1
2 or More ***
Inputs To Solve
XBHs per Game by Team (Yankees and Blue Jays)
##### User Estimates #####
Yankees_XBHperGame = (80+5+93)/58
BlueJays_XBHperGame = (90+5+69)/59
expected_total_XBHs = Yankees_XBHperGame + BlueJays_XBHperGame
print("Use %s + %s = %s as total expected XBHs to be hit for the game."
% (round(Yankees_XBHperGame,2),round(BlueJays_XBHperGame,2),round(expected_total_XBHs,2)))
## Inputs Defined in the Problem
period_of_innings = 2
XBHs = 2
Use 3.07 + 2.78 = 5.85 as total expected XBHs to be hit for the game.
Method to Solve
Estimate lambda and use the Poisson Distribution to compute the probabilty of zero or one XBH being hit in any 2 innings:
lambda_ = expected_total_XBHs * period_of_innings / 9
print("lambda = the total expected XBHs hit by both teams over %s innings" % period_of_innings)
print("lambda = %s * %s / %s" % (round(expected_total_XBHs,2),period_of_innings,9))
print("lambda ~ %s" % (round(lambda_,2)))
lambda = the total expected XBHs hit by both teams over 2 innings lambda = 5.85 * 2 / 9 lambda ~ 1.3
import math
str_ = ""
print("The probability of k events occuring in a Poisson interval = e^(-lambda)*(lambda^k)/k!")
print(' ')
p = 0
for i in range(XBHs):
p += 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(str_)
print(round(p,2))
The probability of k events occuring in a Poisson interval = e^(-lambda)*(lambda^k)/k! e(-1.3)(1.3^0)/0! + e^(-1.3)(1.31)/1! 0.273 + 0.354 0.63
Solution
print("The probabilty of zero or 1 XBHs being hit in a %s inning interval is ~ %s" % (period_of_innings,round(p,2)))
print("The probabilty of two or more XBHs being hitting in a %s inning interval is 1 - the probabilty of zero or 1 XBHs being hit, or ~ %s" % (period_of_innings,round(1-p,2)))
The probabilty of zero or 1 XBHs being hit in a 2 inning interval is ~ 0.63 The probabilty of two or more XBHs being hitting in a 2 inning interval is 1 - the probabilty of zero or 1 XBHs being hit, or ~ 0.37
Posted on 6/5/2019