]> granicus.if.org Git - python/commitdiff
Issue 10787: Document the probability density function for random.gammavariate.
authorRaymond Hettinger <python@rcn.com>
Tue, 22 Mar 2011 22:55:51 +0000 (15:55 -0700)
committerRaymond Hettinger <python@rcn.com>
Tue, 22 Mar 2011 22:55:51 +0000 (15:55 -0700)
Lib/random.py

index 592e4b899a17b9d218ec0d9f058785951389aeb7..49f5859b2bae9df053ab068336db828e6661ca8a 100644 (file)
@@ -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