PGA RBC Heritage - 1st Rd: What will be Branden Grace AND Alex Noren’s COMBINED SCORE on the Par 4 18th?
6:54PM
8 Strokes
Any Other Score
Inputs to Solve
##### User Estimates #####
hole_18 = {'3':40,
'4':253,
'5':92,
'6':12,
'7':5}
print("The observed distribution of scores on hole 18 is: %s" % hole_18)
The observed distribution of scores on hole 18 is: {‘3’: 40, ‘4’: 253, ‘5’: 92, ‘6’: 12, ‘7’: 5}
## Inputs Defined in the Problem
strokes = 8
golfers = ['Grace','Noren']
Method to Solve
- [1] Enumrate all the possible combinations of observed strokes and their respective probabilities for the 2 golfers on hole 18.
- [2] The probability that 8 Strokes are recorded by Grace and Noren on hole 18 is the sum of the probabilities for all the outcomes where the total number of Strokes is exactly equal to 8 (p_8).
## [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) for a in hole_18.keys() for b 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) for a in hole_18.values() for b in hole_18.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)
scores
Grace | Noren | total_strokes | |
---|---|---|---|
0 | 3 | 3 | 6 |
1 | 3 | 4 | 7 |
2 | 3 | 5 | 8 |
3 | 3 | 6 | 9 |
4 | 3 | 7 | 10 |
5 | 4 | 3 | 7 |
6 | 4 | 4 | 8 |
7 | 4 | 5 | 9 |
8 | 4 | 6 | 10 |
9 | 4 | 7 | 11 |
10 | 5 | 3 | 8 |
11 | 5 | 4 | 9 |
12 | 5 | 5 | 10 |
13 | 5 | 6 | 11 |
14 | 5 | 7 | 12 |
15 | 6 | 3 | 9 |
16 | 6 | 4 | 10 |
17 | 6 | 5 | 11 |
18 | 6 | 6 | 12 |
19 | 6 | 7 | 13 |
20 | 7 | 3 | 10 |
21 | 7 | 4 | 11 |
22 | 7 | 5 | 12 |
23 | 7 | 6 | 13 |
24 | 7 | 7 | 14 |
probability
Grace | Noren | p | |
---|---|---|---|
0 | 0.099502 | 0.099502 | 0.009901 |
1 | 0.099502 | 0.629353 | 0.062622 |
2 | 0.099502 | 0.228856 | 0.022772 |
3 | 0.099502 | 0.029851 | 0.002970 |
4 | 0.099502 | 0.012438 | 0.001238 |
5 | 0.629353 | 0.099502 | 0.062622 |
6 | 0.629353 | 0.629353 | 0.396085 |
7 | 0.629353 | 0.228856 | 0.144031 |
8 | 0.629353 | 0.029851 | 0.018787 |
9 | 0.629353 | 0.012438 | 0.007828 |
10 | 0.228856 | 0.099502 | 0.022772 |
11 | 0.228856 | 0.629353 | 0.144031 |
12 | 0.228856 | 0.228856 | 0.052375 |
13 | 0.228856 | 0.029851 | 0.006832 |
14 | 0.228856 | 0.012438 | 0.002846 |
15 | 0.029851 | 0.099502 | 0.002970 |
16 | 0.029851 | 0.629353 | 0.018787 |
17 | 0.029851 | 0.228856 | 0.006832 |
18 | 0.029851 | 0.029851 | 0.000891 |
19 | 0.029851 | 0.012438 | 0.000371 |
20 | 0.012438 | 0.099502 | 0.001238 |
21 | 0.012438 | 0.629353 | 0.007828 |
22 | 0.012438 | 0.228856 | 0.002846 |
23 | 0.012438 | 0.029851 | 0.000371 |
24 | 0.012438 | 0.012438 | 0.000155 |
p_8 = probability['p'][scores['total_strokes']==strokes].sum()
Solution
print("The probability that Branden Grace AND Alex Noren's COMBINED SCORE on the Par 4 18th is 8 Strokes is ~ %s" % round(p_8,3))
The probability that Branden Grace AND Alex Noren’s COMBINED SCORE on the Par 4 18th is 8 Strokes is ~ 0.442
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/18/2020