function N=q29(k)
%generates a total of k random variables as in question 29
N=[];
for i=1:k
   x=cumprod(rand(1,10));
   while x(length(x))>exp(-3)
    x=[x x(length(x))*cumprod(rand(1,10))];
   end
   N=[N sum(x>exp(-3))];
end
