min = 0.01
n = 1000000
sum = [0.0] * n
for i in xrange(n):
a = 1.0
while a > min:
a *= random()
sum[i] += a
sum.sort()
hist_w = 0.1
hist_n = int(sum[-1] / hist_w) + 1
hist = [0] * hist_n
j = 0
for i in xrange(hist_n):
while j < n and sum[j] < (i+1) * hist_w:
hist[i] += 1
j += 1
line2d(zip([hist_w * i for i in xrange(hist_n)], hist))