For a student to qualify, he must pass at least two out of three exams. The probability that he will pass the 1st exam is P . If he fails in one of the exams then the probability of his passing in the next exam is $\mathrm { P } / 2$ otherwise it remains the same. Find the probability that he will qualify.