<jupyter_start><jupyter_text>Monte Carlo and Jet TutorialBy <NAME><jupyter_code>import pandas
import matplotlib.pyplot as plt
import numpy as np
import random
import math<jupyter_output><empty_output><jupyter_text>3 Monte Carlo Simulation Basicsgenerate random numbers between 5 and 15 and create a histogram<jupyter_code>dist = np.array([random.random() for i in range(0,1000)])
modified_dist = np.add(np.multiply(dist,10), 5)
fig, axs = plt.subplots(2, 1, tight_layout=True)
axs[0].hist(dist, bins=50)
axs[0].set_title("Uniform Dist from 0 to 1")
axs[1].hist(modified_dist, bins=50)
axs[1].set_title("Uniform Dist from 5 to 15")
plt.show()<jupyter_output><empty_output><jupyter_text>The uniform distribution ranging from 5 to 15 has a mean of 10 and 5 times the variance of the distribution ranging from 0 to 1  3.2 Accept-Reject Monte Carlogenerate random numbers distributed according to a Gaussian distribution with a mean $\mu$ of 5 and a width $\sigma$ of 2 in the range of \[0,10\]<jupyter_code>def gaussian_pdf(mu, sigma, n):
    pdf = np.array([math.exp((-1/2)((random.random() - mu)/sigma)^2) for i in range(0,n)])
    return pdf
pdf =
plt.hist(gaussian_pdf()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.115, 'fraction_numerical': 0.03833333333333333, 'mean_word_length': 6.023391812865497, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '502573', 'license': 'MIT', 'n_tokens_mistral': 445, 'n_tokens_neox': 411, 'n_words': 131, 'path': 'Monte Carlo and Jet Tutorial.ipynb', 'repo_name': 'Chkoda/Monte-Carlo-Jet', 'size': '1212'}