News for hackers. Stuff that matters.
Re:How many draws of a random number [0,1] are needed to sum... by Kafka on Sunday February 24, 2013 @05:59PM (#5276324)
Here's a Ruby one-liner

    n=1234567;(1..n).reduce{|t,n|s=i=0;loop{i+=1;s+=rand;break if s>=1};t+i}.to_f/n

There are no comments on this comment yet.