Home Archives Search Feed Football Squares How To Use


ATP Cincinnati - 3rd Rd (#1 N. Djokovic v. P. Carreno Busta): Will Djokovic FACE a BREAK POINT in the 1st Set?)


7:10PM
Yes: Djokovic faces at least 1 break point in 1st Set
No: Djokovic never faces break point in 1st Set


Inputs To Solve

Djokovic Service Games Won and Break Points Faced
Busta Service Games Won

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

djokovic_servwon = .86
busta_servwon = .77

Djokovic_BreakFacedperSERVE = 5256/12681

print("The observed ratio of Break Points Faced per Serves for Djokovic is %s" % round(Djokovic_BreakFacedperSERVE,3))

# adjust to match the odds that djokovic is a heavy favorite
djokovic_servwon = .96
busta_servwon = .525

Djokovic_BreakFacedperSERVE = .10
The observed ratio of Break Points Faced per Serves for Djokovic is 0.414

Method to Solve

[1] Use Monte Carlo Simulation and simulate 9999 Sets between Djokovic and Busta using their respective Service Games Won Percent to obtain an estimate for the number of times each player will serve and therefore an estimate of the probability Djokovic faces a BREAK POINT (p_break).

## [1]

import numpy as np
import pandas as pd
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
    break_faced = 0

    while not set_over_:
        game = sim_game(server,player1,player2)
        winner += str(game)
        
        if server:
            a = np.random.choice([1,0],1,p=[Djokovic_BreakFacedperSERVE,1-Djokovic_BreakFacedperSERVE])

        break_faced += a
        
        server = not server
        set_over_ = set_over(winner)
        
    dj_win = 0
    if winner.count('1') > winner.count('0'):
        dj_win = 1
    
    B = 99
    if break_faced > 0:
        B = 1
    else:
        B = 0
        
    return [dj_win,B]
iterations = 9999
breaks = 0
dj_win = 0

for i in range(iterations):
    ans = sim_set(djokovic_servwon,busta_servwon)
    breaks += ans[1]
    dj_win += ans[0]
round(dj_win/iterations,3)
0.955
p_break = breaks/iterations

Solution

print("The probability DJOKOVIC faces a BREAK POINT in the 1st SET is ~%s" % round(p_break,3))
The probability DJOKOVIC faces a BREAK POINT in the 1st SET is ~0.362



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/15/2019






← Next post    ·    Previous post →