Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def fact(n):
  2. if (n == 1): return 1
  3. else: return n * fact(n - 1)
  4. def combinations(n,k):
  5. return(fact(n)/(fact(k)*fact(n - k)))
  6. def Pk(n,k,p):
  7. return combinations(n,k)*(p ** k)*((1 - p) ** (n - k))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement