so I was wondering how i could get around this problem where i have this code
#defining a function that computes the factorial of an integer
def fac(b):
if b==1:
return 1
else:
return b * fac(b-1)
#takes two integers and does the binomial coefficient operand
def combinations(n,k):
result = (fac(n)) / (fac(k) * fac(n-k))
return result
n=10
k=2
print(combinations(n,k))
and using it to (nCk) large numbers such as (1000,700) without using the
sys.setreccursionlimit(x)
for example. can i somehow remove the lowest values in (6C3) so it just calculates (6x5x4)/(3x2x1) since 6! is 6x5x4x3x2x1 and 3! is 3x2x1. and the formula is n!/(k!x(n-k)!)
and therefore lowering the amounts of recursions happening