Re:PEP 450: Adding A Statistics Module To The Standard Library
by blt on Monday August 12, 2013 @12:06AM
(#6197608)
Hmm. Python has default Bignum promotion so the naive N choose K implementation will not suffer from overflow. I guess it could be slow for large values, but how many casual users need to calculate N choose K for large N?
Re:PEP 450: Adding A Statistics Module To The Standard Library
by megrimlock on Sunday August 11, 2013 @01:29PM
(#6195496)
Put differently, you want the functions that count the number of permutations and combinations possible, not functions that yield/generate the actual permutations and combinations.
Not exactly. Given argument lists, Itertools provides result lists (actually, iterators for that purpose) with the original elements permuted and combined, but doesn't provide numerical results for numerical arguments, as shown here: http://arachnoid.com/binomial_probability
I was referring to permutation and combination mathematical functions, not generator functions.