Skip to content

Instantly share code, notes, and snippets.

@arseniyturin
Last active January 2, 2020 03:25
Show Gist options
  • Save arseniyturin/0591fef92b6431e92c98ca367c900c36 to your computer and use it in GitHub Desktop.
Save arseniyturin/0591fef92b6431e92c98ca367c900c36 to your computer and use it in GitHub Desktop.
Binomial Distribution in Python
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