Home Archives Search Feed Football Squares How To Use


PGA Rocket Mortgage Classic - 2nd Rd: What will be Tyrrell Hatton’s SCORE on Holes 16-18?


4:30PM
12 Stokes or Fewer
13 Strokes or More


Inputs to Solve

2019 Course Stats

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

hole_16 = {'3':5,
          '4':186,
          '5':222,
          '6':38,
          '7':1}

hole_17 = {'3':312,
          '4':210,
          '5':202,
          '6':28,
          '7':1}

hole_18 = {'3':14,
          '4':212,
          '5':208,
          '6':18}
## Inputs Defined in the Problem

strokes = 12
golfers = ['Hatton16','Hatton17','Hatton18']

Method to Solve

import numpy as np
import pandas as pd

t=sum(hole_16.values())
for i in hole_16:
    hole_16[i] = hole_16[i]/t

t=sum(hole_17.values())
for i in hole_17:
    hole_17[i] = hole_17[i]/t
    
t=sum(hole_18.values())
for i in hole_18:
    hole_18[i] = hole_18[i]/t
 
y = np.array([(w,x,z) for w in hole_16.keys() for x in hole_17.keys() for z in hole_18.keys()])
scores = pd.DataFrame(y)
scores.columns = golfers
scores = scores.apply(pd.to_numeric)
scores['total_strokes'] = scores.sum(axis=1)

z = np.array([(w,x,y) for w in hole_16.values() for x in hole_17.values() for y in hole_18.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)

scores
Hatton16 Hatton17 Hatton18 total_strokes
0 3 3 3 9
1 3 3 4 10
2 3 3 5 11
3 3 3 6 12
4 3 4 3 10
95 7 6 6 19
96 7 7 3 17
97 7 7 4 18
98 7 7 5 19
99 7 7 6 20

100 rows × 4 columns

probability
Hatton16 Hatton17 Hatton18 p
0 0.011062 0.414343 0.030973 1.419648e-04
1 0.011062 0.414343 0.469027 2.149753e-03
2 0.011062 0.414343 0.460177 2.109192e-03
3 0.011062 0.414343 0.039823 1.825262e-04
4 0.011062 0.278884 0.030973 9.555326e-05
95 0.002212 0.037185 0.039823 3.276112e-06
96 0.002212 0.001328 0.030973 9.100310e-08
97 0.002212 0.001328 0.469027 1.378047e-06
98 0.002212 0.001328 0.460177 1.352046e-06
99 0.002212 0.001328 0.039823 1.170040e-07

100 rows × 4 columns

## [2]

p_under12 = probability['p'][scores['total_strokes']<=strokes].sum()

Solution

print("The probability Tyrrell Hatton's SCORE on Holes 16-18 is 12 Strokes or Less is ~ %s" % round(p_under12,3))
The probability Tyrrell Hatton's SCORE on Holes 16-18 is 12 Strokes or Less is ~ 0.341



Info

download markdown file
email: krellabsinc@gmail.com
twitter: @KRELLabs

import sys
print(sys.version)
3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
Posted on 7/3/2020






← Next post    ·    Previous post →