Monte Carlo Method, Random Number Generator, Importance Sampling, Reversetransformsampling, Rejection Sampling.
Pi-Calculation with Monte Carlo integration(Simulation parameter n : number of samples) def f(x,y): if (x*x+y*y<=1): return 1 else: return 0 n = 10 N = [] P = [] while n <= 100000: s = np.random.uniform(-1,1,(n,2)) nn = 0 for x in s: nn+=f(x[0],x[1]) pi = 4*nn/n N.append(n) P.append(pi) n = n*2