On 10/24/2010 1:17 PM Richard D. Moores said...
In looking through the doc on the random module I came across
random.triangular():

========================================
random.triangular(low, high, mode)
Return a random floating point number N such that low<= N<= high and
with the specified mode between those bounds. The low and high bounds
default to zero and one. The mode argument defaults to the midpoint
between the bounds, giving a symmetric distribution.

New in version 2.6.
========================================

I fooled around with it a bit and wrote this rough demo:
<http://tutoree7.pastebin.com/s4J0Ww12>

The skewing and centering possible by varying the mode, are obvious,
but how is random.trangular() actually used?


From people who would know found at http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.triangular.html


"""The triangular distribution is often used in ill-defined problems where the underlying distribution is not known, but some knowledge of the limits and mode exists. Often it is used in simulations."""

HTH,

Emile




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to