Which formula is used to compute binomial coefficient? C(n,k)= C(n-1,k-1) + C(n-1,k) C(n,k)= C(n-1,k-1) + C(n-1,k-1) C(n,k)= C(n ,k-1) + C(n-1,k) C(n,k)= C(n-1,k) + C(n-2,k) code example
Example: binomial coefficient python
def binomialCoef(n, k):
C = [0 for x in range(k+1)]
C[0] = 1
for i in range(n+1):
for j in range(min(i, k),0,-1):
C[j] = C[j] + C[j-1]
return C[k]