PGA Charles Schwab: What will be R. McIlroy, B. Koepka and J. Rahm’s COMBINED SCORE on the Par 4 18th?
6:38PM
11 Strokes or Fewer
12 Strokes or More
Inputs to Solve
##### User Estimates #####
hole_18 = {'3':65,
'4':274,
'5':37,
'6':8,
'7':1}
print("The observed distribution of scores on hole 18 is: %s" % hole_18)
The observed distribution of scores on hole 18 is: {‘3’: 65, ‘4’: 274, ‘5’: 37, ‘6’: 8, ‘7’: 1}
## Inputs Defined in the Problem
strokes = 11
golfers = ['McIlroy','Koepka','Rahm']
Method to Solve
- [1] Enumrate all the possible combinations of observed strokes and their respective probabilities for the 3 golfers on hole 18.
- [2] The probability that 11 Strokes or Fewer are recorded by McIlroy, Koepka and Rahm on hole 18 is the sum of the probabilities for all the outcomes where the total number of Strokes is 11 or less (p_under11)
## [1]
import numpy as np
import pandas as pd
t=sum(hole_18.values())
for i in hole_18:
hole_18[i] = hole_18[i]/t
y = np.array([(a,b,c) for a in hole_18.keys() for b in hole_18.keys() for c 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) for a in hole_18.values() for b in hole_18.values() for c in hole_18.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)
scores.head()
McIlroy | Koepka | Rahm | total_strokes | |
---|---|---|---|---|
0 | 3 | 3 | 3 | 9 |
1 | 3 | 3 | 4 | 10 |
2 | 3 | 3 | 5 | 11 |
3 | 3 | 3 | 6 | 12 |
4 | 3 | 3 | 7 | 13 |
probability.head()
McIlroy | Koepka | Rahm | p | |
---|---|---|---|---|
0 | 0.168831 | 0.168831 | 0.168831 | 0.004812 |
1 | 0.168831 | 0.168831 | 0.711688 | 0.020286 |
2 | 0.168831 | 0.168831 | 0.096104 | 0.002739 |
3 | 0.168831 | 0.168831 | 0.020779 | 0.000592 |
4 | 0.168831 | 0.168831 | 0.002597 | 0.000074 |
p_under11 = probability['p'][scores['total_strokes']<=strokes].sum()
Solution
print("The probability that R. McIlroy, B. Koepka and J. Rahm's COMBINED SCORE on the Par 4 18th is 11 Strokes or Fewer is ~ %s" % round(p_under11,3))
The probability that R. McIlroy, B. Koepka and J. Rahm’s COMBINED SCORE on the Par 4 18th is 11 Strokes or Fewer is ~ 0.33
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/11/2020