sim=1000;
X = zeros(sim,1);
for i=1:sim,
Y = exponential_RV(rand);
X(i,1) = (rand)^(1/Y);
end;

figure(3)
hist(X);