%Demonstration script for Monte Carlo Estimation of pi.
U=rand(1,N);
%
disp('Basic Method:')
X=4*sqrt(1-U.^2);
MCanl(X)
%
disp('Antithetic Method:')
Y=(X+4*sqrt(1-(1-U).^2))/2;
MCanl(Y)
%
disp('Simple Control Variate:')
Z=X-4*(1-U.^2)+8/3;
MCanl(Z)
%
disp('High Order Control Variate:')
Z5=X-4*(142-19*U+16*U.^2-200*U.^3+224*U.^4-128*U.^5)/(81*sqrt(3))+742/(135*sqrt(3));
MCanl(Z5)