Last active
January 2, 2020 03:25
-
-
Save arseniyturin/0591fef92b6431e92c98ca367c900c36 to your computer and use it in GitHub Desktop.
Binomial Distribution in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import factorial as fac | |
def binomial_prob(n, x, p): | |
return round( ( fac(n) / ( fac(x) * fac(n-x) ) ) * (p**x) * (1-p)**(n-x) , 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment