ATP Rotterdam - 1st Rd (#1 Daniil Medvedev v. Vasek Pospisil): Will a TIEBREAK be PLAYED in the match?
1:40 PM
Yes: At least 1 tiebreak played
No: No tiebreak played
Inputs Needed To Solve
Service Games Won %
Medvedev and Pospisil
##### User Estimates #####
Med_SRV_Wperct = .81
Pos_SRV_Wperct = .83
Method To Solve
- [1] Use Monte Carlo Simulation and simulate 9999 Sets between Kyrgios and Khachanov using their respective Service Games Won Percent
- [2] The ratio of Simulated Sets that reach TIEBREAK to the total number of Simulations is an estimate of the probability of a set reaching TIEBREAK (p_tie)
## [1]
import numpy as np
def sim_game(server,player1,player2):
if server:
serve = np.random.choice([1,0],1,p=[player1,1-player1])
if serve == 1:
ans = '1'
else:
ans = '0'
else:
serve = np.random.choice([1,0],1,p=[player2,1-player2])
if serve == 1:
ans = '0'
else:
ans = '1'
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(player1,player2):
winner = ''
server = True
set_over_ = False
tie = 0
while not set_over_:
game = sim_game(server,player1,player2)
winner += str(game)
server = not server
set_over_ = set_over(winner)
if winner.count('0') == 6 and winner.count('1') == 6:
tie = 1
return [tie,winner]
iterations = 20
tie_count = 0
for i in range(iterations):
p1 = 0
p2 = 0
while p1 < 2 and p2 < 2:
x = sim_set(Med_SRV_Wperct,Pos_SRV_Wperct)
#print(x)
if x[1].count('1') == x[1].count('0'):
tie_count += 1
break
else:
if x[1].count('1') >= 6:
p1 += 1
else:
p2 +=1
#print([p1,p2])
#print(tie_count)
#print('--')
## [2]
p_tie = tie_count/iterations
Solution
print("The probability a TIEBREAK will be played in the MATCH is ~%s" % round(p_tie,3))
The probability a TIEBREAK will be played in the MATCH is ~0.6
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 2/12/2020