MLB (Astros @ White Sox): How many STRIKEOUTS will be recorded during Innings 1-2?
4:40PM
3 or Fewer
4 or More
Inputs To Solve
Starting Pitcher STRIKEOUT per OUT Rate
Greinke HOU
Cease CWS
##### User Estimates #####
Gre_2019_KRate = 137/(152*3)
# Total Ks / Number of Outs Recorded
Cea_2019_KRate = 33/(33*3)
# Total Ks / Number of Outs Recorded
print("Zach Greinke's 2019 K per Out rate is ~%s" % round(Gre_2019_KRate,3))
print("Dylan Cease's 2019 K per Out rate is ~%s" % round(Cea_2019_KRate,3))
Zach Greinke’s 2019 K per Out rate is ~0.3
Dylan Cease’s 2019 K per Out rate is ~0.333
## Inputs Defined in the Problem
Innings = 2
Ks = 3
Method to Solve
- [1] Enumerate all the possible combinations of STRIKEOUTS vs NON STRIKEOUT OUTS recorded in Innings 1-2
- [2] Sum the probabilities for all the combination’s outcomes where the total number of STRIKEOUTS is less than or equal to 2.
## [1]
import numpy as np
import pandas as pd
# Zach Greinke K / no K probability
p_K_Gre = Gre_2019_KRate
p_no_K_Gre = 1 - p_K_Gre
prob_Gre = (p_K_Gre,p_no_K_Gre)
K_grid = (1,0)
# Dylan Cease K / no K probability
p_K_Cea = Cea_2019_KRate
p_no_K_Cea = 1 - p_K_Cea
prob_Cea = (p_K_Cea,p_no_K_Cea)
K_grid = (1,0)
# Enumerate all possible combinations of K / no K for both pitchers over 2 Innings
# max 12 Total Ks - if all outs are STRIKEOUTS
y = np.array([(a,b,c,d,e,f,t,u,v,w,x,z) for t in K_grid for u in K_grid for v in K_grid for w in K_grid for x in K_grid for z in K_grid
for a in K_grid for b in K_grid for c in K_grid for d in K_grid for e in K_grid for f in K_grid])
K = pd.DataFrame(y)
K['total_Ks'] = K.sum(axis=1)
K.head()
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | total_Ks | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 12 |
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 11 |
2 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 11 |
3 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 10 |
4 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 11 |
# Compute the probability of all possible combinations of K / no K for both pitchers over 2 Innings
x = np.array([(a,b,c,d,e,f,t,u,v,w,y,z) for t in prob_Cea for u in prob_Cea for v in prob_Cea for w in prob_Cea for y in prob_Cea for z in prob_Cea
for a in prob_Gre for b in prob_Gre for c in prob_Gre for d in prob_Gre for e in prob_Gre for f in prob_Gre])
probability = pd.DataFrame(x)
probability['p'] = probability.product(axis=1)
probability.head()
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | p | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.000001 |
1 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.699561 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.000002 |
2 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.699561 | 0.300439 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.000002 |
3 | 0.300439 | 0.300439 | 0.300439 | 0.300439 | 0.699561 | 0.699561 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.000005 |
4 | 0.300439 | 0.300439 | 0.300439 | 0.699561 | 0.300439 | 0.300439 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.333333 | 0.000002 |
a = {}
for i in set(K.total_Ks):
a[i] = round(probability['p'][K['total_Ks']==i].sum(),2)
print("The possible outcomes of STRIKEOUTS in Innings 1-2 and their respective probabilities are: %s" % a)
The possible outcomes of STRIKEOUTS in Innings 1-2 and their respective probabilities are: {0: 0.01, 1: 0.06, 2: 0.15, 3: 0.23, 4: 0.24, 5: 0.18, 6: 0.1, 7: 0.04, 8: 0.01, 9: 0.0, 10: 0.0, 11: 0.0, 12: 0.0}
## [2]
p = round(probability['p'][K['total_Ks']<=Ks].sum(),3)
Solution
print("The probability that 3 or FEWER STRIKEOUTS are recorded in Innings 1-2 is ~%s" % p)
The probability that 3 or FEWER STRIKEOUTS are recorded in Innings 1-2 is ~0.441
Posted on 8/13/2019