{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial A13" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__1__ Modify the coinflip section from lesson A13 to simulate throwing a dice. Throw the dice 100 times and save the outcomes $X_i$ with $i = 1, ... , N$ in a list. Plot the result as a histogram." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__2__ Modify the code further to throw $N = 10, 100, 1000$ dice and store the mean values $S_N = \\frac{1}{N}\\sum_{i=1}^N X_i = \\langle X \\rangle$ in a list. For each $N$ repeat the experiment 5000 times and plot the resulting distributions of mean values." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__3__ Repeat the experiment of task __2__ but instead of plotting the distribution of mean values $S_N$, plot the distribution of $\\sqrt{N}(S_N - \\mu)$,\n", "where $\\mu$ is the expectation value $\\mu = \\frac{1}{M}\\sum_k^M w_k X_k$, where $\\omega_k$ and $X_k$ are the weights and possible outcomes of the random variables, respectively. In the case of a dice the expectation value is $\\mu = (1 + 2 + 3 + 4 + 5 + 6) / 6 = 3.5$.\n", "What do you observe?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.10" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }