Finding the probability that $A$ occurs before $B$ Given an experiment has $3$ possible outcomes $A, B$ and $C$ with respective probabilities $p, q$ and $r$ where $p + q + r = 1.$ The experiment is repeated until either outcome $A$ or outcome $B$ occurs. How can I show that $A$ occurs before B with probability $\dfrac{p}{p+q}$?

Let $a$ denote the given probability. Then by independence, we see that $$a = p + ra,$$
which yields
$$a = \frac p{1-r}= \frac p{p+q}. $$
