WTA Rogers Cup - 2nd Rd (Tatjana Maria v. #2 Naomi Osaka): Will Osaka’s SERVE be BROKEN in the 1st Set?
5:10M
Yes: Osaka broken in 1st Set
No: Osaka never broken in 1st Set
Inputs Needed To Solve
Service Games Won %
(Maria and Osaka)
##### User Estimates #####
Maria_SRV_Wperct = .67
Osaka_SRV_Wperct = .75
Method To Solve
- Simulate 9999 Sets between Maria and Osaka using their respective Service Games Won Percent
- The ratio of Simulated Sets with a Maria break to the total number of Simulations is an estimate of the probability Osaka’s SERVE is BROKEN in the 1st Set
import numpy as np
def sim_game(server):
if server:
serve = np.random.choice([1,0],1,p=[Osaka_SRV_Wperct,1-Osaka_SRV_Wperct])
if serve == 1:
ans = '10'
else:
ans = '01'
else:
serve = np.random.choice([1,0],1,p=[Maria_SRV_Wperct,1-Maria_SRV_Wperct])
if serve == 1:
ans = '00'
else:
ans = '10'
return ans
def set_over(winner):
set_over = False
if winner.count('1') >= 7:
set_over = True
if winner.count('0') >= 7:
set_over = True
if winner.count('1') >=6 and winner.count('0') < 5:
set_over = True
if winner.count('0') >=6 and winner.count('1') < 5:
set_over = True
if winner.count('0') == 6 and winner.count('1') == 6:
set_over = True
return set_over
def sim_set():
winner = []
breaks = []
server = True
set_over_ = False
ans = 0
while not set_over_:
game = sim_game(server)
winner.append(game[0])
breaks.append(game[1])
server = not server
set_over_ = set_over(winner)
if '1' in breaks:
ans = 1
return [ans,winner]
iterations = 9999
osaka_broken_count = 0
for i in range(iterations):
x = sim_set()
osaka_broken_count += x[0]
if i < 15:
print(x[1])
p_osaka_broken = osaka_broken_count/iterations
[‘1’, ‘1’, ‘1’, ‘0’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’]
[‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘1’]
[‘1’, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘1’, ‘1’, ‘0’]
[‘1’, ‘0’, ‘0’, ‘1’, ‘1’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’]
[‘1’, ‘1’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’]
[‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘1’, ‘0’, ‘0’, ‘1’, ‘0’]
[‘0’, ‘0’, ‘1’, ‘1’, ‘1’, ‘0’, ‘1’, ‘1’, ‘1’]
[‘1’, ‘1’, ‘1’, ‘0’, ‘1’, ‘1’, ‘1’]
[‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘1’, ‘1’, ‘1’]
[‘1’, ‘0’, ‘1’, ‘1’, ‘1’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’]
[‘0’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’]
[‘1’, ‘1’, ‘1’, ‘1’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’]
[‘0’, ‘0’, ‘1’, ‘1’, ‘1’, ‘1’, ‘1’, ‘0’, ‘1’]
[‘1’, ‘1’, ‘1’, ‘0’, ‘1’, ‘1’, ‘1’]
[‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’]
Solution
print("The probability Osaka's SERVE will be BROKEN in the 1st Set is ~%s" % round(p_osaka_broken,3))
The probability Osaka’s SERVE will be BROKEN in the 1st Set is ~0.727
Posted on 8/7/2019