Re:The Man Who Invented Modern Probability
by lsconjugate on Thursday August 22, 2013 @05:46PM
(#6260308)
39
[ Parent
| on HN ]
from random import random
sum([(random()*4+1)**3 for x in xrange(1000000)])/1000000
=> ~39
Weird.
Re:The Man Who Invented Modern Probability
by bluetech on Friday August 23, 2013 @03:18AM
(#6262174)
sum(random.uniform(1, 5)**3 for i in range(10000)) / 10000
Many people don't know that the random module allows to sample from many distributions directly without having to construct your own.
Re:The Man Who Invented Modern Probability
by hollerith on Friday August 23, 2013 @06:39AM
(#6262656)
I like the first version better because everyone knows what infix * and + do.
Re:The Man Who Invented Modern Probability
by saucetenuto on Friday August 23, 2013 @08:58AM
(#6263174)
I like the second version better because it taught me something I didn't know.