function result = montepi(n) result = sum(rand(1,n).^2+rand(1,n).^2<1)/n*4; endfunction