Two players, A and B, take turns on a gambling machine until one of them scores a success, the first to do so being the winner. Their probabilities for success on a single play are p for A and q for B, and successive plays are independent.
(a) Determine the probability that A wins the contest given that A plays first.
(b) Determine the mean number of plays required, given that A wins.