clear
tic
N = 1e4;
n = 0;
for i = 1 : N
    x1 = rand;
    x2 = rand;
    if ( x1^2 + x2^2 )<=1
        n = n + 1;
    end
end
PIexp = 4 * n / N
toc