
So far, I completed nCr:
a = 6 b = 4 def nCr(a, b): #Since a nCr B = a!/(b!*(a-b)!): a!, b!, and (a-b)! are 3 elements and are put into a list for simplicity L1 = [a, b, a-b] L2 = [0, 0, 0] for i in range(3): n = L1[i] g = 1 #Factorial for each list element in L1 for j in range(1,n + 1): g = g*j #Put the factorial in it's own element in L2 L2[i] = g #Since each L2 element were factorialed, do the same thing as a!/(b!*(a-b)!) return L2[0] / (L2[1] * L2[2]) Ans = nCr(a, b) print(Ans)
If this is the formula for binompdf(, how can this be interpreted in python as a function?
def binompdf(n, p, k)
Hewwo, my name is Achak Claw. I was formerly BioHazard.