find number of tennis matches required [closed]
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this questionHi I came across this question from my friend.
Give me a generalised formula to find how many tennis matches (singles) are required for n players ?
Example : if the number of players are 16 then
first : we need 8 mataches (for 16 players) , here 8 players will be eliminated and 8 players will be there
secode : we need 4 matches (for 8 players) , here again 4 players will be eliminated and 4 will be remaining
third : we need 2 matches (for 4 players) , here again 2 players will be eliminated and 2 will be remaining
Final : we need 1 macth to decide a winner among the 2 players
so totally 15 matches are required.
I need a generalised formula to find , such that if I give the value n I should get the number of matches required to find the winner
n开发者_如何学Go may be odd or even
For elimination game, the number of matches is always n-1, because one player will be eliminated after one game and n-1 players have to be eliminated in total.
As eventually every player but 1 (the champion) has to lost his match (and every player can lost only in 1 match) then the number of matches required is n-1
n-1, because there is one player to leave after each game. and the champion remains
精彩评论