]> granicus.if.org Git - python/commitdiff
Add info from the docstring for random.gammavariate() to the docs.
authorGeorg Brandl <georg@python.org>
Sat, 17 Sep 2011 18:36:28 +0000 (20:36 +0200)
committerGeorg Brandl <georg@python.org>
Sat, 17 Sep 2011 18:36:28 +0000 (20:36 +0200)
Doc/library/random.rst

index e18b217c90f10dfb86ad0efdb36443c87f82f7a7..de98c040d45e6069dd522b929dee7f83333880d3 100644 (file)
@@ -196,6 +196,7 @@ be found in any statistics text.
    The end-point value ``b`` may or may not be included in the range
    depending on floating-point rounding in the equation ``a + (b-a) * random()``.
 
+
 .. function:: triangular(low, high, mode)
 
    Return a random floating point number *N* such that ``low <= N <= high`` and
@@ -226,6 +227,12 @@ be found in any statistics text.
    Gamma distribution.  (*Not* the gamma function!)  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
+
 
 .. function:: gauss(mu, sigma)