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