it says two teams A & B have to play a match, and we have to find probability of team A. I can't understand the way to calculate its percentage. The main points are:
1) the match is played by two teams: A and B;
2) the first team to win K games in a match, wins the match;
3) each game consists of rounds; each round is won by one of the teams, and the team adds one point to its score for the current game;
4) the first team to win L points in a game, wins the game;
5) if team A serves the ball in a round, it has Pa% chance to win the round (and (100-Pa)% to loose it);
6) if team B serves the ball in a round, it has Pb% chance to win the round (and (100-Pb)% to loose it);
7) if a round is not the first in a game, the ball in the round is served by the team that won the last round;
8) if a game is not the first in a match, the ball in the first round of the game is served by the team that did not served the ball in the first round of the previous game;
9) both teams have an equal chance to serve the ball in the first round of the very first game of a match.
2 \\data sets
100 50 1 3\\values for Pa,Pb,K,L
100 1 1 1\\same as above
Sample Output \\this is wat i cant calculate
I m a beginner and need help so plz just let me know how can I do it?
It probably has many if conditions, but how many is the Question??