clear; clc;

N = 1e7;
m = 0;

for i = 1 : N
    x = rand(1);
    y = rand(1);
    if x ^ 2 + y ^ 2 < 1
        m = m + 1;
    end
end
pi_estimator = 4 * m / N