Skip to content

Instantly share code, notes, and snippets.

@18182324
Created May 19, 2021 09:21
Show Gist options
  • Save 18182324/0da29f885b947b5cb6c1e24580b79986 to your computer and use it in GitHub Desktop.
Save 18182324/0da29f885b947b5cb6c1e24580b79986 to your computer and use it in GitHub Desktop.
Deep L. Prob. Number of Dollar Signs
#Solution for model assumption. Different number of dollar signs.
from scipy.stats import binom
#Define the considered numbers of dollar signs on the die (zero to six):
ndollar = np.asarray(np.linspace(0,6,7), dtype='int')
#Calculate corresponding probability of 2 $-signs in 10 throws
pdollar = binom.pmf(k=2, n=10, p=ndollar/6)
plt.stem(ndollar, pdollar)
plt.xlabel('Number of dollar signs on the dice')
plt.ylabel('Probability observing 2 dollar signs in 10 throws')
plt.title('Unnormalized likelihoods')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment