summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2011-03-22 22:55:51 (GMT)
committerRaymond Hettinger <python@rcn.com>2011-03-22 22:55:51 (GMT)
commita8e4d6eb6e386dc12fa586bd4a920546b505f17b (patch)
tree41a5ad32e3d91851e14c3b5569c42ad73b5d686f /Lib
parentb199b2262cb37235447b9ab88e6479e227004d3c (diff)
downloadcpython-a8e4d6eb6e386dc12fa586bd4a920546b505f17b.zip
cpython-a8e4d6eb6e386dc12fa586bd4a920546b505f17b.tar.gz
cpython-a8e4d6eb6e386dc12fa586bd4a920546b505f17b.tar.bz2
Issue 10787: Document the probability density function for random.gammavariate.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/random.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 592e4b8..49f5859 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