<jupyter_start><jupyter_text>p(w|R) = P(w and R)/P(R)<jupyter_code>p =  (ctab.iloc[0,0]/ctab.sum().sum())/(ctab.sum()[0]/ctab.sum().sum())
d.shape
import scipy.stats as stats
import matplotlib.pyplot as plt

k = np.arange(0,229, 1)
k.sort()
n = 229
binomial = stats.binom.pmf(k,n,p)

plt.figure(figsize=(20,7))
plt.plot(k,binomial,'o-')
plt.title('Binomial: n=%i , p=%.2f' % (n,p), fontsize=15)
plt.xlabel('Number of Successes')
plt.ylabel('Probability of Successes')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22334004024144868, 'fraction_numerical': 0.03420523138832998, 'mean_word_length': 6.217391304347826, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '615384', 'license': 'MIT', 'n_tokens_mistral': 249, 'n_tokens_neox': 230, 'n_words': 35, 'path': 'Day 22/Binomial distribution.ipynb', 'repo_name': 'vgaurav3011/100-Days-of-ML', 'size': '497'}