% = first n approximations to pi found by throwing
%   darts at a dart board.
function result= darts(n)
x= rand(1,n);
y=rand(1,n);
distance= (x .^ 2) + (y .^ 2);
d= distance <= 1;
cums= cumsum(d) ./ (1:n);
result= 4 .* cums