% Monte Carlo estimate of an integral.

n=10^6
x=rand(1,n);
y=rand(1,n);
sum(y<sin(pi*x))/n