From: Raymond Hettinger Date: Tue, 22 Mar 2011 22:55:51 +0000 (-0700) Subject: Issue 10787: Document the probability density function for random.gammavariate. X-Git-Tag: v3.2.1b1~231^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8e4d6eb6e386dc12fa586bd4a920546b505f17b;p=thirdparty%2FPython%2Fcpython.git Issue 10787: Document the probability density function for random.gammavariate. --- diff --git a/Lib/random.py b/Lib/random.py index 592e4b899a17..49f5859b2bae 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -470,6 +470,12 @@ class Random(_random.Random): Conditions on the parameters are alpha > 0 and beta > 0. + The probability distribution function is: + + x ** (alpha - 1) * math.exp(-x / beta) + pdf(x) = -------------------------------------- + math.gamma(alpha) * beta ** alpha + """ # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2