Home Archives Search Feed Football Squares How To Use


PGA Travelers: What will be D. Johnson, J. Spieth, J. Thomas, and X. Schauffele’s COMBINED SCORE on Hole 18?


5:08PM
15 Strokes or Fewer
16 Strokes or More


Inputs to Solve

Travelers Championship Course Stats

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

hole_18 = {'3':0.19,
           '4':0.71,
           '5':0.05,
           '6':0.035,
           '7':0.015}

print("The observed distribution of scores on hole 18 is: %s" % hole_18)

The observed distribution of scores on hole 18 is: {‘3’: 0.19, 4’: 0.71, 5’: 0.05, 6’: 0.035, 7’: 0.015}

## Inputs Defined in the Problem

strokes = 15
golfers = ['Johnson','Speith','Thomas','Schauffele']

Method to Solve

## [1]

import numpy as np
import pandas as pd

y = np.array([(a,b,c,d) for a in hole_18.keys() for b in hole_18.keys() for c in hole_18.keys() for d 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([(a,b,c,d) for a in hole_18.values() for b in hole_18.values() for c in hole_18.values() for d in hole_18.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)
scores
Johnson Speith Thomas Schauffele total_strokes
0 3 3 3 3 12
1 3 3 3 4 13
2 3 3 3 5 14
3 3 3 3 6 15
4 3 3 3 7 16
620 7 7 7 3 24
621 7 7 7 4 25
622 7 7 7 5 26
623 7 7 7 6 27
624 7 7 7 7 28

625 rows × 5 columns

probability
Johnson Speith Thomas Schauffele p
0 0.190 0.190 0.190 0.190 1.303210e-03
1 0.190 0.190 0.190 0.710 4.869890e-03
2 0.190 0.190 0.190 0.050 3.429500e-04
3 0.190 0.190 0.190 0.035 2.400650e-04
4 0.190 0.190 0.190 0.015 1.028850e-04
620 0.015 0.015 0.015 0.190 6.412500e-07
621 0.015 0.015 0.015 0.710 2.396250e-06
622 0.015 0.015 0.015 0.050 1.687500e-07
623 0.015 0.015 0.015 0.035 1.181250e-07
624 0.015 0.015 0.015 0.015 5.062500e-08

625 rows × 5 columns

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

Solution

print("The probability that D. Johnson, J. Spieth, J. Thomas, and X. Schauffele's COMBINED SCORE on the Par 4 18th is 15 Strokes or Fewer is ~ %s" % round(p_15,3))

The probability that D. Johnson, J. Spieth, J. Thomas, and X. Schauffele’s COMBINED SCORE on the Par 4 18th is 15 Strokes or Fewer is ~ 0.42




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 6/25/2020






← Next post    ·    Previous post →