Two boys play basketball in the following way. They take turns shooting and stop when a basket is made. Player A goes first and has probability p1 of making a basket on any throw. Player B, who shoots second, has probability p2 of making a basket. The outcomes of the successive trials are assumed to be independent. Find the frequency function for the total number of attempts. What is the probability that player A wins?