commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ori ziv <zivo...@gmail.com>
Subject [math] basic utilities for probability - isProbability(double) and isSampleSpace(double[])
Date Sun, 15 Jul 2012 11:36:56 GMT
Hi,

I've wrote two basic but useful utilities for probability and tests
for them. I would like to ask if the developers of the Apache Commons
Math project are interested in me submitting them. I still have some
touching up to do so that they fit the style guidelines.

The first is isProbability(double)
which returns true if and only if x is a probability, i.e., not
smaller than zero and not bigger than one.
The other is isSampleSpace(double[]) which returns true if and only if
the values are a sample space, i.e., each value is a probability and
the sum of the values in the input array is one.

Prototype is attached.

Thanks,

Ori Ziv.


Mime
View raw message