You have a discrete distribution:
p(X=0) = 0.5
p(X=1) = 0.3
P(X=2) = 0.2
Develop an inverse transform sampler for this.
Develop a rejection sampler for this using a uniform distribution as your proposal distribution. What proportion of proposed samples will be rejected?