Last active
July 17, 2020 09:09
-
-
Save SaraM92/ded4fe90d1e6f6ba6d5767f4ede0bd8d to your computer and use it in GitHub Desktop.
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
#Import Essential Libraries | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import scipy.stats as stat | |
#Generate the Binomial Distribution | |
x = np.arange(0, 25) | |
noOfTrials = 20 #Number of trials | |
prob = 0.9 #probability of success | |
binom = stat.binom.pmf(x, noOfTrials, prob) | |
plt.plot(x, binom, color="#8d0801") | |
plt.xlabel('Random Variable', fontsize=15) | |
plt.ylabel('Probability', fontsize=15) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment