Men’s US Open - 1st Rd (Steve Johnson v #28 Nick Kyrgios): Will there be a BREAK of SERVE in the FIRST 4 GAMES?
9:00PM
Yes: Break in first 4 games
No: 0 breaks in first 4 games
Inputs Needed To Solve
Service Games Won %
Steve Johnson
Nick Kyrgios
##### User Estimates #####
SJ_SRV_Wperct = .84
NK_SRV_Wperct = .88
## Inputs Defined in the Problem
games = 4
Method To Solve
- [1] Simulate 9999 Games of 4 between Steve Johnson and Nick Kyrgios using their respective Service Games Won Percent
- [2] The ratio of Simulated Games of 4 where there is at least one BREAK to the total number of Simulations is an estimate of the probability there at least one BREAK of SERVE in the FIRST 4 GAMES (p_break) based on the Monte Carlo Method.
## [1]
import numpy as np
def sim_game(server,perct1,perct2):
break_ = False
if server:
serve = np.random.choice([1,0],1,p=[perct1,1-perct1])
if serve != 1:
break_ = True
else:
serve = np.random.choice([1,0],1,p=[perct2,1-perct2])
if serve != 1:
break_ = True
return break_
## [2]
iterations = 999
break_ = 0
for i in range(iterations):
server = True
b = 0
for i in range(games):
g = sim_game(server,SJ_SRV_Wperct,NK_SRV_Wperct)
if g:
b += 1
if b > 0:
break_ += 1
p_break = break_/iterations
Solution
print("The probability there is a BREAK of SERVE in the FIRST 4 GAMES is ~%s" % round(p_break,3))
The probability there is a BREAK of SERVE in the FIRST 4 GAMES is ~0.48
Info
download md 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/27/2019