PGA RBC Heritage - 2nd Rd: Will M. Hubbard AND A. Schenk record the SAME SCORE on the Par 4 18th?
6:49PM
Yes: Bothttp://fantasy.espn.com/streak/en/createOrUpdateEntry?matchup=m85570o82297h record same score
No: Both record a different score
Inputs to Solve
2020 Course Stats
(data used up to start of 2nd round)
##### User Estimates #####
hole_18 = {'3':14,
'4':108,
'5':27,
'6':2}
## Inputs Defined in the Problem
golfers = ['Hubbard','Schenk']
Method to Solve
- [1] Enumerate all the possible combinations of scores for 2 golfers on the 18th hole (2^4 combinations).
- [2] The probability that at the 2 golfer’s scores are the same (p_same) is the sum of all the probabilities where the scores are equal.
## [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['same'] = scores['Hubbard']==scores['Schenk']
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
Hubbard | Schenk | same | |
---|---|---|---|
0 | 3 | 3 | True |
1 | 3 | 4 | False |
2 | 3 | 5 | False |
3 | 3 | 6 | False |
4 | 4 | 3 | False |
5 | 4 | 4 | True |
6 | 4 | 5 | False |
7 | 4 | 6 | False |
8 | 5 | 3 | False |
9 | 5 | 4 | False |
10 | 5 | 5 | True |
11 | 5 | 6 | False |
12 | 6 | 3 | False |
13 | 6 | 4 | False |
14 | 6 | 5 | False |
15 | 6 | 6 | True |
probability
Hubbard | Schenk | p | |
---|---|---|---|
0 | 0.092715 | 0.092715 | 0.008596 |
1 | 0.092715 | 0.715232 | 0.066313 |
2 | 0.092715 | 0.178808 | 0.016578 |
3 | 0.092715 | 0.013245 | 0.001228 |
4 | 0.715232 | 0.092715 | 0.066313 |
5 | 0.715232 | 0.715232 | 0.511557 |
6 | 0.715232 | 0.178808 | 0.127889 |
7 | 0.715232 | 0.013245 | 0.009473 |
8 | 0.178808 | 0.092715 | 0.016578 |
9 | 0.178808 | 0.715232 | 0.127889 |
10 | 0.178808 | 0.178808 | 0.031972 |
11 | 0.178808 | 0.013245 | 0.002368 |
12 | 0.013245 | 0.092715 | 0.001228 |
13 | 0.013245 | 0.715232 | 0.009473 |
14 | 0.013245 | 0.178808 | 0.002368 |
15 | 0.013245 | 0.013245 | 0.000175 |
## [2]
p_same = probability['p'][scores['same']==True].sum()
Solution
print("The probability that M. Hubbard AND A. Schenk record the SAME SCORE on the Par 4 18th is ~ %s" % round(p_same,3))
The probability that M. Hubbard AND A. Schenk record the SAME SCORE on the Par 4 18th is ~ 0.552
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/19/2020