
xbasc();
n=1000;
z=zeros(1,n);
for i=1:n,
  u=rand(1);
  if (u>1/2) then
   x=-log(2*(1-u));
  else
   x=log(2*u);
  end,
  z(1,i)=x;
end,
histplot(ceil(n/20),z,style=2);
r=-10:0.1:10;
y=exp(-abs(r))/2;
plot(r,y,'red');

