# Central limit theorem automatic_replot = 0 ; gset nokey gset tics out p0=[0.9 ; 0.1]; y = p0' ; T=1000; for t=1:T s=size(y); r = 0:(s(2)-1); ## the list of possible values of r, where ## r = sum_{n=1}^N x_n ## set graph ranges command = sprintf ( "gset xrange [ 0-0.5:%d+0.5 ] " , (s(2)-1) ) ; eval(command) ; ymin = min(y)/10.0; if(ymin<1e-300) ymin=1e-300; endif command = sprintf ( "gset yrange [ %g:%g] " , ymin , max(y)*1.1 ) ; eval(command) ; gplot y' w impulse 3 ; y = conv(y,p0); ans=input("ready"); endfor