
f=@(x) 4*sqrt(1-x.^2);

Np=10;
N=floor(logspace(1,5,Np));

erand=zeros(1,Np);
elcg =zeros(1,Np);

for i=1:Np
	erand(i)=abs( sum( f(rand(1,N(i))))/N(i) - pi);
	elcg(i) =abs( sum( f(lcgrand(1,N(i),2,1,10,1)))/N(i) - pi);
end

loglog(N,erand,'-', N, elcg, '+-');

set(gca,'fontsize',40); % increase font size
print('check_lcg.eps');


