#### FRV2

##### Semi-Pro

Python:

```
# chance nadal beats field
oddsNadalBeatsField = .9
# chance that djoker beats field
oddsDjokerBeatsField = .8
# chance that fed beats field
oddsFedBeatsField = .65
# chance that fed is in djoker's half
oddsFedInDjokersHalf = .5
# chance that fed is in nadal's half
oddsFedInNadalsHalf = .5
# chance that fed beats djokovic in meeting
oddsFedBeatsDjoker = .25
# chance that fed beats nadal in meeting
oddsFedBeatsNadal = .5
# chance that djokovic beats nadal in meeting
oddsDjokerBeatsNadal = .7
# chance nadal beats non-big3 finals opponent
oddsNadalBeatsNB3 = .9
# chance djokovic beats non-big3 finals opponent
oddsDjokerBeatsNB3 = .7
# chance fed beats non-big3 finals opponent
oddsFedBeatsNB3 = .55
o_FedBeatsFieldInDjokersHalf = oddsFedBeatsField * oddsFedInDjokersHalf
o_FedBeatsFieldInNadalsHalf = oddsFedBeatsField * oddsFedInNadalsHalf
def fedGoesThroughDjoker():
return o_FedBeatsFieldInDjokersHalf * oddsDjokerBeatsField * oddsFedBeatsDjoker
def fedGoesThroughDjokerThenNadal():
return fedGoesThroughDjoker() * (oddsFedBeatsNadal * oddsNadalBeatsField)
def fedGoesThroughNadal():
return o_FedBeatsFieldInNadalsHalf * oddsNadalBeatsField * oddsFedBeatsNadal
def fedGoesThroughNadalThenDjoker():
return fedGoesThroughNadal() * (oddsFedBeatsDjoker * oddsDjokerBeatsField)
def fedFacesNeither():
return oddsFedBeatsField * (1 - oddsDjokerBeatsField) * (1 - oddsNadalBeatsField)
def fedNoDjoker():
return o_FedBeatsFieldInDjokersHalf * (1 - oddsDjokerBeatsField)
def fedNoDjokerBeatsNadal():
return fedNoDjoker() * (oddsFedBeatsNadal * oddsNadalBeatsField)
def fedNoNadal():
return o_FedBeatsFieldInNadalsHalf * (1 - oddsNadalBeatsField)
def fedNoNadalBeatsDjoker():
return fedNoNadal() * (oddsFedBeatsDjoker * oddsDjokerBeatsField)
def fedThroughNadalNoDjoker():
return fedGoesThroughNadal() * (1 - oddsDjokerBeatsField) * oddsFedBeatsNB3
def fedThroughDjokerNoNadal():
return fedGoesThroughDjoker() * (1 - oddsNadalBeatsField) * oddsFedBeatsNB3
def djokerGoesThroughFedThenNadal():
return oddsDjokerBeatsField * o_FedBeatsFieldInDjokersHalf * (1 - oddsFedBeatsDjoker)\
* oddsNadalBeatsField * oddsDjokerBeatsNadal
def djokerBeatsNadal():
return oddsDjokerBeatsField * oddsFedInNadalsHalf * (1 - oddsFedBeatsField) * \
(oddsNadalBeatsField) * (oddsDjokerBeatsNadal) \
+ oddsDjokerBeatsField * o_FedBeatsFieldInNadalsHalf * oddsNadalBeatsField * \
(1 - oddsFedBeatsNadal) * oddsDjokerBeatsNadal
def djokerBeatsFed():
return oddsDjokerBeatsField * fedGoesThroughNadal() * (1-oddsFedBeatsDjoker) + \
oddsDjokerBeatsField * fedNoNadal() * (1-oddsFedBeatsDjoker)
def djokerFacesNeither():
return oddsDjokerBeatsField * (1 - oddsNadalBeatsField) * (1 - oddsFedBeatsField)
def djokerNoFedBeatsNadal():
return oddsDjokerBeatsField * oddsFedInDjokersHalf * (1 - oddsFedBeatsField) * \
oddsNadalBeatsField * oddsDjokerBeatsNadal
def djokerThroughFedNoNadal():
return oddsDjokerBeatsField * oddsFedBeatsField * oddsFedInDjokersHalf * \
(1 - oddsFedBeatsDjoker) * (1 - oddsNadalBeatsField) * oddsDjokerBeatsNB3
def nadalGoesThroughFedThenDjoker():
return oddsNadalBeatsField * o_FedBeatsFieldInNadalsHalf * (1-oddsFedBeatsNadal) * \
oddsDjokerBeatsField * (1-oddsDjokerBeatsNadal)
def nadalBeatsDjoker():
return oddsNadalBeatsField * oddsFedInDjokersHalf * oddsDjokerBeatsField * \
(1 - oddsDjokerBeatsNadal) * ((1 - oddsFedBeatsField) + (1 - oddsFedBeatsDjoker)*oddsFedBeatsField)
def nadalBeatsFed():
return oddsNadalBeatsField * fedGoesThroughDjoker() * (1-oddsFedBeatsNadal) + \
oddsNadalBeatsField * fedNoDjoker() * (1-oddsFedBeatsNadal)
def nadalFacesNeither():
return oddsNadalBeatsField * (1 - oddsDjokerBeatsField) * (1 - oddsFedBeatsField)
def nadalNoFedBeatsDjoker():
return oddsNadalBeatsField * oddsFedInNadalsHalf * (1 - oddsFedBeatsField) * \
oddsDjokerBeatsField * (1 - oddsDjokerBeatsNadal)
def nadalThroughFedNoDjoker():
return oddsNadalBeatsField * o_FedBeatsFieldInNadalsHalf * (1 - oddsFedBeatsNadal) * \
(1 - oddsDjokerBeatsField) * oddsNadalBeatsNB3
fed = fedGoesThroughDjokerThenNadal() + fedGoesThroughNadalThenDjoker() + fedNoNadalBeatsDjoker() \
+ fedNoDjokerBeatsNadal() + fedFacesNeither() \
+ fedThroughNadalNoDjoker() + fedThroughDjokerNoNadal()
djoker = djokerGoesThroughFedThenNadal() + djokerBeatsFed() \
+ djokerBeatsNadal() + djokerFacesNeither() + djokerNoFedBeatsNadal() + djokerThroughFedNoNadal()
nadal = nadalGoesThroughFedThenDjoker() + nadalBeatsFed() + nadalBeatsDjoker() \
+ nadalFacesNeither() + nadalNoFedBeatsDjoker() + nadalThroughFedNoDjoker()
field = 1 - fed - djoker - nadal
print("Fed's Chances: " + str(round(fed,3) * 100) + "%")
print("Djoker's Chances: " + str(round(djoker,3) * 100) + "%")
print("Nadal's Chances: " + str(round(nadal,3) * 100) + "%")
print("Field's Chances: " + str(round(((1- fed - djoker - nadal) * 100), 3)) + "%")
"""
Federer chances = 12.7%
Djokovic chances = 53.0%
Nadal chances = 31.1%
Non-Big3 chances = 3.186%
"""
```

Last edited: