A student appears for tests I, II, and III. The student is successful if he passes either in tests I and II or tests I and III. The probabilities of the student passing in tests I, II, III are $p$, $q$ and $\frac{1}{2}$, respectively. If the probability that the student is successful is $\frac{1}{2}$, then: (Assuming his performance in tests are independent).