[Python-ideas] random.boolean or bernoulli

M.-A. Lemburg mal at egenix.com
Thu Apr 21 22:25:09 CEST 2011


Robert Kern wrote:
> On 4/21/11 1:46 PM, Raymond Hettinger wrote:
> 
>> P.S. Bernoulli isn't even jargon; it's a person's name.
>> A Bernoulli trial just means that events are independent.
>> It doesn't imply anything about a distribution or population
>> of possible result values.
> 
> Actually, it is the canonical name of a particular discrete probability
> distribution. *If* one cared to add it, it would be a perfectly fine
> name for it, though "bernoullivariate" might fit better with the other
> named distributions.
> 
>   http://en.wikipedia.org/wiki/Bernoulli_distribution
> 

I don't think those suggested functions are really missing from the
random module.

Distributions that are missing (at least AFAIK) are these two
important discrete distributions:

One which returns integers distributed according to the
binomial distribution B(n,p):

    http://en.wikipedia.org/wiki/Binomial_distribution

(The Bernoulli distribution is a special case (B(1,p)).)

The other important discrete distribution missing is the Poisson
distribution Pois(lambda):

    http://en.wikipedia.org/wiki/Poisson_distribution

Both are often used in simulations and test data generators
for real world discrete events.

In the past we've used Ivan Frohne's fine rv module for these,
but it would be great if they could be added to the standard
random module (taking benefit of the much better performance
this provides):

    http://svn.scipy.org/svn/scipy/tags/pre_numeric/Lib/stats/rv.py

Perhaps a nice project for a GSoC student...

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Apr 21 2011)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/



More information about the Python-ideas mailing list