PGA Travelers: How many BIRDIES will V. Hovland, J. Rose and T. Finau record on HOLES 7 and 8?
11:39AM
1 Birdie
Any Other Number
Inputs to Solve
##### User Estimates #####
p_bird = [22/378, 30/378]
count = 7
for p in p_bird:
print("The probability that a golfer BIRDIES hole " + str(count) + " is %s" % round(p,3))
count +=1
The probability that a golfer BIRDIES hole 7 is 0.058
The probability that a golfer BIRDIES hole 8 is 0.079
## Inputs Defined in the Problem
total_birdies = 1
holes = ['Hovl_7','Rose_7','Finau_7','Hovl_8','Rose_8','Finau_8']
Method to Solve
- [1] Enumerate all the possible combinations BIRDIES and NON-BIRDIES being scored on holes 7-8 for 3 golfers (2^6 combinations).
- [2] The probability that 1 BIRDIE is recorded by V. Hovland, J. Rose and T. Finau on HOLES 7 and 8 is the sum of the probabilities for all the outcomes where the total number of BIRDIES is exactly equal to 1 (p_1).
## [1]
import numpy as np
import pandas as pd
outcomes = (1,0)
y = np.array([(a,b,c,d,e,f) for a in outcomes for b in outcomes for c in outcomes
for d in outcomes for e in outcomes for f in outcomes])
birdies = pd.DataFrame(y)
birdies.columns = holes
birdies['total_birdies'] = birdies.sum(axis=1)
x = np.array([(a,b,c,d,e,f) for a in (p_bird[0],1-p_bird[0]) for b in (p_bird[0],1-p_bird[0])
for c in (p_bird[0],1-p_bird[0]) for d in (p_bird[1],1-p_bird[1])
for e in (p_bird[1],1-p_bird[1]) for f in (p_bird[1],1-p_bird[1])])
probability = pd.DataFrame(x)
probability.columns = holes
probability['p'] = probability.product(axis=1)
birdies
Hovl_7 | Rose_7 | Finau_7 | Hovl_8 | Rose_8 | Finau_8 | total_birdies | |
---|---|---|---|---|---|---|---|
0 | 1 | 1 | 1 | 1 | 1 | 1 | 6 |
1 | 1 | 1 | 1 | 1 | 1 | 0 | 5 |
2 | 1 | 1 | 1 | 1 | 0 | 1 | 5 |
3 | 1 | 1 | 1 | 1 | 0 | 0 | 4 |
4 | 1 | 1 | 1 | 0 | 1 | 1 | 5 |
… | … | … | … | … | … | … | … |
59 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
60 | 0 | 0 | 0 | 0 | 1 | 1 | 2 |
61 | 0 | 0 | 0 | 0 | 1 | 0 | 1 |
62 | 0 | 0 | 0 | 0 | 0 | 1 | 1 |
63 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
64 rows × 7 columns
probability
Hovl_7 | Rose_7 | Finau_7 | Hovl_8 | Rose_8 | Finau_8 | p | |
---|---|---|---|---|---|---|---|
0 | 0.058201 | 0.058201 | 0.058201 | 0.079365 | 0.079365 | 0.079365 | 9.855553e-08 |
1 | 0.058201 | 0.058201 | 0.058201 | 0.079365 | 0.079365 | 0.920635 | 1.143244e-06 |
2 | 0.058201 | 0.058201 | 0.058201 | 0.079365 | 0.920635 | 0.079365 | 1.143244e-06 |
3 | 0.058201 | 0.058201 | 0.058201 | 0.079365 | 0.920635 | 0.920635 | 1.326163e-05 |
4 | 0.058201 | 0.058201 | 0.058201 | 0.920635 | 0.079365 | 0.079365 | 1.143244e-06 |
… | … | … | … | … | … | … | … |
59 | 0.941799 | 0.941799 | 0.941799 | 0.079365 | 0.920635 | 0.920635 | 5.619258e-02 |
60 | 0.941799 | 0.941799 | 0.941799 | 0.920635 | 0.079365 | 0.079365 | 4.844188e-03 |
61 | 0.941799 | 0.941799 | 0.941799 | 0.920635 | 0.079365 | 0.920635 | 5.619258e-02 |
62 | 0.941799 | 0.941799 | 0.941799 | 0.920635 | 0.920635 | 0.079365 | 5.619258e-02 |
63 | 0.941799 | 0.941799 | 0.941799 | 0.920635 | 0.920635 | 0.920635 | 6.518339e-01 |
64 rows × 7 columns
## [2]
p_1 = probability['p'][birdies['total_birdies']==total_birdies].sum()
Solution
print("The probability that V. Hovland, J. Rose and T. Finau record 1 BIRDIE on HOLES 7 and 8 is ~ %s" % round(p_1,3))
The probability that V. Hovland, J. Rose and T. Finau record 1 BIRDIE on HOLES 7 and 8 is ~ 0.289
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/26/2020