[issue5139] Add combinatoric counting functions to the math module.

Terry J. Reedy report at bugs.python.org
Fri Feb 6 20:39:47 CET 2009


Terry J. Reedy <tjreedy at udel.edu> added the comment:

If you semi-optimize the implementation by pre-cancelling out the larger
of the denominators, then these functions would be justified as more
efficient than the naive use of the factorial function indicated by the
formulas.

Possible shorter names:
ncombos
nperms
ncombos_with_reps

I would prefer that these and other integer-only functions be in a
separate imath module.  I have the impression that this was not done
with the first because "we can't have a module with just one function",
but these would make at least 4 or 5, which is enough for a module.

----------
nosy: +tjreedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5139>
_______________________________________


More information about the Python-bugs-list mailing list