A candidate takes three tests in succession and the probability of passing the first test is P. The probability of passing each succeeding test is P or P2 according as he passes or fails in the preceding one. The candidate is selected if he passes at least two tests. The probability that the cndidate is selected is