You and several friends are playing a tennis game called king of the court. The idea behind
the game is that one person is the "king of the court", and each of the other players, in turn,
tries to win two points before the king wins one point. An opponent who successfully scores two
points without allowing the king to score becomes the new king of the court; otherwise, he returns
to the back of the line to wait to play again. When the king is defeated, the winner becomes the
new king, and the king returns to the back of the line. A player is declared the winner when
he or she has been the king and consecutively defeated each of the other opponents.
You are given a int ability, where each element of ability is the
relative skill level of each given player. The first element of ability refers to the
player who is king initially. The remaining players are lined up to play, in the same order that
they appear in ability.
On any given turn, the probability that a player A will win the point against player B is
based upon their relative skill level. Thus, if two players have skill levels A and
B, the probability that the first player will win the point (regardless of who is king)
You are to return a double indicating the probability that the player who is
king initially will go on to win the game.