Problem 44502. Anyone for tennis? Your chances of winning a (standard) game
Imagine you are playing tennis, and for each point played your chance of winning is x % (input as a uint8). Given the ITF's scoring system for a "standard game" of tennis (excerpted below), please determine your likelihood of winning a game (output as a single).
Note that as x is taken to be the same for every point in this problem, it does not matter whether you are serving or not.
EXAMPLE
x = uint8(40) chance = single(0.2642707692307693)
-----
" A standard game is scored as follows with the server’s score being called first:
- No point - “Love”
- First point - “15”
- Second point - “30”
- Third point - “40”
- Fourth point - “Game”
except that if each player/team has won three points, the score is “Deuce”. After “Deuce”, the score is “Advantage” for the player/team who wins the next point. If that same player/team also wins the next point, that player/team wins the “Game”; if the opposing player/team wins the next point, the score is again “Deuce”. A player/team needs to win two consecutive points immediately after “Deuce” to win the “Game”. "
-----
See also Problem 44503. Anyone for tennis? Your chances of winning a tie-break game.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
-
40770 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1744 Solvers
-
Create an n-by-n null matrix and fill with ones certain positions
580 Solvers
-
336 Solvers
-
There are 10 types of people in the world
1096 Solvers
More from this Author32
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!