Home Archives Search Feed Football Squares How To Use


MLB (Dodgers @ Phillies): How many STRIKEOUTS will Clayton Kershaw (LAD) record during Innings 1-3?


7:20PM
3 or Fewer
4 or More


Inputs To Solve

Kershaw STRIKEOUTS per OUT Rate

##### User Estimates #####

Kershaw_2019_KRate = 91/(99*3)
# Total Ks / Number of Outs Recorded

print("Clayton Kershaw's 2019 K per Out rate is ~%s" % round(Kershaw_2019_KRate,3))

    Clayton Kershaw’s 2019 K per Out rate is ~0.306    

## Inputs Defined in the Problem
Ks = 3

Method to Solve

import numpy as np
import pandas as pd

p_K = Kershaw_2019_KRate
p_no_K = 1 - p_K
prob = (p_K,p_no_K)
K_grid = (1,0)
a = {}

y = np.array([(q,r,s,t,u,v,w,x,z) for q in K_grid for r in K_grid for s in K_grid 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])
K = pd.DataFrame(y)
K['total_Ks'] = K.sum(axis=1)

x = np.array([(q,r,s,t,u,v,w,y,z) for q in prob for r in prob for s in prob for t in prob for u in prob for v in prob for w in prob for y in prob for z in prob])
probability = pd.DataFrame(x)
probability['p'] = probability.product(axis=1)

for i in set(K.total_Ks):
    a[i] = round(probability['p'][K['total_Ks']==i].sum(),2)
K.head()
0 1 2 3 4 5 6 7 8 total_Ks
0 1 1 1 1 1 1 1 1 1 9
1 1 1 1 1 1 1 1 1 0 8
2 1 1 1 1 1 1 1 0 1 8
3 1 1 1 1 1 1 1 0 0 7
4 1 1 1 1 1 1 0 1 1 8
probability.head()
0 1 2 3 4 5 6 7 8 p
0 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.000024
1 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.693603 0.000054
2 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.693603 0.306397 0.000054
3 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.693603 0.693603 0.000122
4 0.306397 0.306397 0.306397 0.306397 0.306397 0.306397 0.693603 0.306397 0.306397 0.000054
print("The number of possible STRIKEOUTS in Innings 1-3 and their respective probabilities are: %s" % a)

    The number of possible STRIKEOUTS in Innings 1-3 and their respective probabilities are: {0: 0.04, 1: 0.15, 2: 0.26, 3: 0.27, 4: 0.18, 5: 0.08, 6: 0.02, 7: 0.0, 8: 0.0, 9: 0.0}    

p = round(probability['p'][K['total_Ks']<=Ks].sum(),3)

Solution

print("The probability that 3 or FEWER STRIKOUTS are recorded in Innings 1-3 is ~%s" % p)

    The probability that 3 or FEWER STRIKOUTS are recorded in Innings 1-3 is ~0.715

Posted on 7/15/2019






← Next post    ·    Previous post →