I have some code to count permutations and combinations, and I\'m trying to make it work better for large numbers.
I\'ve found a better algorithm for permutations th
from numpy import prod def nCr(n,r): numerator = range(n, max(n-r,r),-1) denominator = range(1, min(n-r,r) +1,1) return int(prod(numerator)/prod(denominator))