---------------------------------------------------
% Monte Carlo computation of pi.
r = 5; % repearing time
count = 0;
n= 100;
for l =1:r,
for i=1:n,
x = rand ; y = rand ; % Generate random points
if (x-.5)^2 + (y-0.5)^2 <= .25, % general solution for any circle
count = count + 1;
end;
end...