Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73dd7c7

Browse files
committed
Add info from the docstring for random.gammavariate() to the docs.
1 parent 7554606 commit 73dd7c7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/random.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ be found in any statistics text.
163163
The end-point value ``b`` may or may not be included in the range
164164
depending on floating-point rounding in the equation ``a + (b-a) * random()``.
165165

166+
166167
.. function:: triangular(low, high, mode)
167168

168169
Return a random floating point number *N* such that ``low <= N <= high`` and
@@ -191,6 +192,12 @@ be found in any statistics text.
191192
Gamma distribution. (*Not* the gamma function!) Conditions on the
192193
parameters are ``alpha > 0`` and ``beta > 0``.
193194

195+
The probability distribution function is::
196+
197+
x ** (alpha - 1) * math.exp(-x / beta)
198+
pdf(x) = --------------------------------------
199+
math.gamma(alpha) * beta ** alpha
200+
194201

195202
.. function:: gauss(mu, sigma)
196203

0 commit comments

Comments
 (0)