Suppose that X and Y are discrete random variables with a joint probability mass function pXY(x, y).
a. Generate X ~ pX(x).
b. Accept X with probability p(y|X).
c. If X is accepted, terminate and return X. Otherwise go to Step a.
Show that the following procedure generates a random variable X ~ pX|Y(x|y).