function q28
v=[];
for i=1:1000
u=rand;
while (sum(u)<1)
    u=[u rand];
end
n=1+length(u);
v=[v n];
end
mean(v)

