8.2 Binomial Probability Distribution
Lab 8.2.1
21% of all Chicagoans live in poverty. If 30 Chicagoans are randomly selected, find the probability that
- Exactly 1 of them live in poverty
- At most 4 of them live in poverty
- At least 4 of them live in poverty
Binomial Probability Plot
Example
Use the binomplot function below to plot a binomial distribution with n = 20 and probability of success is 0.70.
# binomial graph with n and p
def binomplot(n,p):
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(0,n+1)
y = stats.binom.pmf(x,n,p)
plt.bar(x,y,width=0.2)
plt.suptitle("Binomial Plot")
plt.xlabel("x values")
plt.ylabel("probability")
return plt.show()
Lab 8.2.2
Use the binomplot function to plot a binomial distribution with n = 10 and probability of success is 0.60.
Adapted from Python for Introductory Statistics: Student's Lab Workbook, by Simon Aman (Truman College, City Colleges of Chicago), licensed under CC BY 4.0. Changes were made: reformatted as an accessible XYZ web edition with live in-browser code cells. License: CC-BY-4.0.