Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fact(n):
- if (n == 1): return 1
- else: return n * fact(n - 1)
- def combinations(n,k):
- return(fact(n)/(fact(k)*fact(n - k)))
- def Pk(n,k,p):
- return combinations(n,k)*(p ** k)*((1 - p) ** (n - k))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement