The Open Championship 2019: What will be W. Simpson and S. Garcia’s COMBINED SCORE on the Par 4 18th
1:00 PM
8 Strokes
Any Other Number
Inputs To Solve
Royal Portrush Golf Club Course Stats
##### User Estimates #####
hole_18 = {'3':17,
'4':93,
'5':61,
'6':7,
'7':2}
print("The observed distribution of scores on hole 18 is: %s" % hole_18)
The observed distribution of scores on hole 18 is: {‘3’: 17, ‘4’: 93, ‘5’: 61, ‘6’: 7, ‘7’: 2}
## Inputs Defined in the Problem
strokes = 8
golfers = ['Simpson','Garcia']
Method to Solve
- Enumrate all the possible combinations of observed scores and their respective probabilities for the 2 golfers on hole 18.
- The probability that exactly 8 Strokes are recorded by Simpson and Garcia on hole 18 is the sum of the probabilities for all the outcomes where the total number of Strokes is exactly equal to 8.
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([(x,z) for x in hole_18.keys() for z in hole_18.keys()])
scores = pd.DataFrame(y)
scores.columns = golfers
scores = scores.convert_objects(convert_numeric=True)
scores['total_strokes'] = scores.sum(axis=1)
z = np.array([(x,y) for x in hole_18.values() for y in hole_18.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)
scores.head()
Simpson | Garcia | total_strokes | |
---|---|---|---|
0 | 3 | 3 | 6 |
1 | 3 | 4 | 7 |
2 | 3 | 5 | 8 |
3 | 3 | 6 | 9 |
4 | 3 | 7 | 10 |
probability.head()
Simpson | Garcia | p | |
---|---|---|---|
0 | 0.094444 | 0.094444 | 0.008920 |
1 | 0.094444 | 0.516667 | 0.048796 |
2 | 0.094444 | 0.338889 | 0.032006 |
3 | 0.094444 | 0.038889 | 0.003673 |
4 | 0.094444 | 0.011111 | 0.001049 |
p = probability['p'][scores['total_strokes']==strokes].sum()
Solution
print("The probability that W. Simpson and S. Garcia's COMBINED SCORE on the Par 4 18 is 8 STROKES equals ~%s" % round(p,3))
The probability that W. Simpson and S. Garcia’s COMBINED SCORE on the Par 4 18 is 8 STROKES equals ~0.331
Posted on 7/19/2019