Home Archives Search Feed Football Squares How To Use


PGA Tour Championship - 1st Rd (Atlanta, GA): Which PLAYER will card a LOWER SCORE on the Par 3 2nd?


1:20PM
Adam Scott (AUS) or Tie
Dustin Johnson (USA)


Inputs To Solve

East Lake Golf Club 2018 Course Stats

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

hole_2 = {'2':18,
          '3':84,
          '4':18}
## Inputs Defined in the Problem

golfers = ['AS2','DJ2']

Method to Solve

## [1]

import numpy as np
import pandas as pd
t=sum(hole_2.values())
for i in hole_2:
    hole_2[i] = hole_2[i]/t

y = np.array([(a,b) for a in hole_2.keys()for b in hole_2.keys()])
y = y.astype(int)
scores = pd.DataFrame(y)
scores.columns = golfers
scores['DJ_less'] = scores['DJ2'] < scores['AS2']
scores.head()
AS2 DJ2 DJ_less
0 2 2 False
1 2 3 False
2 2 4 False
3 3 2 True
4 3 3 False
z = np.array([(a,b) for a in hole_2.values() for b in hole_2.values()])
probability = pd.DataFrame(z)
probability.columns = golfers
probability['p'] = probability.product(axis=1)
probability.head()
AS2 DJ2 p
0 0.15 0.15 0.0225
1 0.15 0.70 0.1050
2 0.15 0.15 0.0225
3 0.70 0.15 0.1050
4 0.70 0.70 0.4900
## [2]

p_DJ = probability['p'][scores['DJ_less']==True].sum()

Solution

print("The probability that Dustin Johnson's score is lower than Adam Scott's is ~%s" % round(p_DJ,3))
The probability that Dustin Johnson's score is lower than Adam Scott's is ~0.232



Info

download markdown file
email: krellabsinc@gmail.com
twitter: @KRELLabs

import sys
print(sys.version)
3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Posted on 8/22/2019






← Next post    ·    Previous post →