function [value,error] = piNumberAndError(n,m)
% Finds number pi using Monte Carlo method: chooses random points
% in the square 0<(x,y)<1 and counts how many obey x^2+y^2<1. This
% must be the ratio of one fourth the area of the circle of unit
% radius (pi/4) to the area of the square (one).
% Input
%   n  : Number of Monte Carlo trial points in each sub-calculation
%   m  : Number of sub-calculations
% Output
%   value : Estimated value of pi
%   error : Estimated error of pi
% Usage
%   [pi,err] = piNumberAndError(1000,10)
% Author
%   Jose M Soler. Nov.2010
for i = 1:m
    x(i) = piNumber(n);
end
value = meanValue(x);
error = standDev(x)/sqrt(m-1);
end
