fromscipy.statsimportbinombinom.pmf(x,n,p)# probability mass function# Excel# If you roll a die 16 times, what is the probability that a five comes up 3 times?# x=3(success);n=16;p=1/6# BINOM.DIST(x,n,p,FALSE)
Poisson Distribution
fromscipy.statsimportpoissonpoisson.pmf(n,x)# Fewer than 3poisson.cdf(2,8)# cumulative distribution function# No deliveries between 4 and 4:05...poisson.pmf(0,8/12)# Excel# What is the probability that only 4 deliveries will arrive between 4 and 5pm this Friday?# POISSON.DIST(x,n,FALSE)# What is the probability that fewer than 3 will arrive...# POISSON.DIST(x,n,TRUE)
Normal Distribution
fromscipyimportstatsstats.norm.cdf(z)stats.norm.ppf(p)# Excel# input z NORMDIST(z) output p# input p NORMSINV(p) output z