Message 81294 - Python tracker (original) (raw)
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.