Monte Carlo Method, Random Number Generator, Importance Sampling, Reversetransformsampling, Rejection Sampling.
reverse_generator(s) print("n_sample = ",n_sample) gen_xx =random.sample(theta,n_sample) plt.scatter(gen_xx,[0]*n_sample,marker='x') xx=np.linspace(-15,15,1000) plt.plot(xx,[p_laplace(i) for i in xx],c='red') plt.legend(['Laplace Distribution','generated number']) plt.title("Random Numbers directly