<jupyter_start><jupyter_text>Distribution: Triangular distributionSee: https://en.wikipedia.org/wiki/Triangular_distribution<jupyter_code>def build_plot(n, subsets_num):
    values = np.random.triangular(0, 0.5, 1, size = (subsets_num,n))
    
    means = np.sort(np.sum(values, axis = 1) / n) 
    
    fit = norm.pdf(means, 0.5, np.sqrt(1./(24 * n))) # <=========== Theoretical distribution
    plt.xlabel('x')
    plt.ylabel('f(x)')
    plt.plot(means, fit,'-')
    plt.hist(means, bins = 7, normed=True)
    plt.xlim((0.3, 0.7))<jupyter_output><empty_output><jupyter_text>For Triangular distribution with parameters a = 0, b = 1, c = 0.5 => mean = 0.5, variance = 1/24. So mean ~N(0.5, 1/(24 * n)), where n - number of experiments<jupyter_code>build_plot(n = 100, subsets_num = 1000)
build_plot(n = 500, subsets_num = 1000)
build_plot(n = 1000, subsets_num = 1000)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17483296213808464, 'fraction_numerical': 0.05679287305122494, 'mean_word_length': 4.351190476190476, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 1, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '587949', 'license': 'MIT', 'n_tokens_mistral': 392, 'n_tokens_neox': 339, 'n_words': 69, 'path': 'Coursera/Machine-learning-data-analysis/Course 1/Central-Limit-Theorem.ipynb', 'repo_name': 'ALEXKIRNAS/DataScience', 'size': '898'}