Monte Carlo Method, Random Number Generator, Importance Sampling, Reversetransformsampling, Rejection Sampling.
p(x). If the cumulative distribution function of p(x) is P(x), then the inverse function of u=P(x) is x =P^-1 (u). Now, x = P^-1 (u) has p(x) as probability density function on [0,1]. Therefore, with n samples from uniform distribution on [0,1] {u_i} (i=1,2,…,n), we can generate n sample of p(x)