Solution
= Solution
For one trial and any measurable set $A$,
$$
P(Y\in A,\text{accept})=\int_Aq(y)\frac{p(y)}{Mq(y)}dy=\frac1M\int_Ap(y)dy.
$$
Since the acceptance probability is $1/M$, conditioning gives target probability $\int_Ap$. Repeating failed <independent> trials does not alter this conditional law: summing over the trial number multiplies by the geometric sum $\sum_{j\ge0}(1-1/M)^j/M=1$. Taking $A=(-\infty,x)$ proves
$$
\boxed{P(X<x)=\int_{-\infty}^xp(y)dy.}
$$