<jupyter_start><jupyter_text>Using Numpy<jupyter_code>sample = np.random.geometric(p=p, size=10000)

plt.hist(sample, bins=50)
plt.show()
print("""
mean empirical: %.2f
mean analytical: %.2f
variance empirical: %.2f
variance analytical: %.2f
"""%(np.mean(sample), 1 / p, np.var(sample), (1 - p) / p ** 2))<jupyter_output>mean empirical: 19.99
mean analytical: 20.00
variance empirical: 378.35
variance analytical: 380.00
{'fraction_non_alphanumeric': 0.16904761904761906, 'fraction_numerical': 0.0761904761904762, 'mean_word_length': 5.790322580645161, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '528086', 'license': 'MIT', 'n_tokens_mistral': 194, 'n_tokens_neox': 159, 'n_words': 39, 'path': 'distribution/geometric.ipynb', 'repo_name': 'shawlu95/Data_Science_Toolbox', 'size': '420'}