Skip to content

Commit

Permalink
Add info from the docstring for random.gammavariate() to the docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Sep 17, 2011
1 parent 7554606 commit 73dd7c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,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
Expand Down Expand Up @@ -191,6 +192,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)

Expand Down

0 comments on commit 73dd7c7

Please sign in to comment.