monte carlo是摩纳哥的一个赌城
===================
clear all; close all; clc;
N = 1e9;
in = 0;
for s = 1 : N
x = rand;
y = rand;
if x^2 + y^2 < 1
in = in +1 ;
end
end
estimate = 4* in/N
monte carlo是摩纳哥的一个赌城
===================
clear all; close all; clc;
N = 1e9;
in = 0;
for s = 1 : N
x = rand;
y = rand;
if x^2 + y^2 < 1
in = in +1 ;
end
end
estimate = 4* in/N