<jupyter_start><jupyter_text>Sampling from the participants<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
plt.rcParams.update({'figure.dpi': 200})
plt.rcParams.update({'font.size': 22})


age = np.arange(0,36,1)

hist_age = np.zeros(len(age))
hist_age[35] = 1
hist_age[28] = 1
hist_age[27] = 2
hist_age[26] = 2
hist_age[25] = 4
hist_age[24] = 7
hist_age[23] = 10
hist_age[22] = 4
hist_age[21] = 4
hist_age[19] = 1

plt.bar(age, hist_age)
plt.xlabel('Alter')
plt.ylabel('Anzahl')
plt.show()
mean = np.sum(age*hist_age)/np.sum(hist_age)
variance = np.sum(age**2*hist_age)/np.sum(hist_age) - mean**2
error_mean = variance/np.sqrt(np.sum(hist_age))

print('mean     = ', mean)
print('variance = ', variance)
print('error(mean) = ', error_mean)
plt.bar(age, hist_age/np.sum(hist_age))
plt.xlabel('Alter')
plt.ylabel('Verteilung')
plt.plot(age, 1/np.sqrt(2*np.pi*variance)*np.exp(-(age-mean)**2/2/variance))
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19270833333333334, 'fraction_numerical': 0.04791666666666667, 'mean_word_length': 6.225563909774436, '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': '115450', 'license': 'MIT', 'n_tokens_mistral': 462, 'n_tokens_neox': 424, 'n_words': 64, 'path': 'lecture_MonteCarlo_101.ipynb', 'repo_name': 'zierenberg/lecture_MC_disease', 'size': '960'}