{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "tags": [ "remove_input" ] }, "outputs": [], "source": [ "path_data = '../../../../data/'\n", "\n", "import numpy as np\n", "import pandas as pd\n", "\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", "plt.style.use('fivethirtyeight')\n", "\n", "import warnings\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Simulation ###\n", "Simulation is the process of using a computer to mimic a physical experiment. In this class, those experiments will almost invariably involve chance. \n", "\n", "We have seen how to simulate the results of tosses of a coin. The steps in that simulation were examples of the steps that will constitute every simulation we do in this course. In this section we will set out those steps and follow them in examples.\n", "\n", "### Step 1: What to Simulate ###\n", "Specify the quantity you want to simulate. For example, you might decide that you want to simulate the outcomes of tosses of a coin. \n", "\n", "### Step 2: Simulating One Value ###\n", "Figure out how to simulate *one* value of the quantity you specified in Step 1. In our example, you have to figure out how to simulate the outcome of *one* toss of a coin. If your quantity is more complicated, you might need several lines of code to come up with one simulated value.\n", "\n", "### Step 3: Number of Repetitions ###\n", "Decide how many times you want to simulate the quantity. You will have to repeat Step 2 that many times. In one of our earlier examples we had decided to simulate the outcomes of 1000 tosses of a coin, and so we needed 1000 repetitions of generating the outcome of a single toss.\n", "\n", "### Step 4: Coding the Simulation ###\n", "Put it all together in code.\n", "- Create an empty array in which to collect all the simulated values. We will call this the collection array.\n", "- Create a \"repetitions sequence,\" that is, a sequence whose length is the number of repetitions you specified in Step 3. For `n` repetitions we will almost always use the sequence `np.arange(n)`.\n", "- Create a `for` loop. For each element of the repetitions sequence:\n", " - Simulate *one* value based on the code you developed in Step 2.\n", " - Augment the collection array with this simulated value.\n", " \n", "That's it! Once you have carried out the steps above, your simulation is done. The collection array contains all the simulated values. \n", "\n", "At this point you can use the collection array as you would any other array. You can visualize the distribution of the simulated values, count how many simulated values fall into a particular category, and so on." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Number of Heads in 100 Tosses ###\n", "It is natural to expect that in 100 tosses of a coin, there will be 50 heads, give or take a few. \n", "\n", "But how many is \"a few\"? What's the chance of getting exactly 50 heads? Questions like these matter in data science not only because they are about interesting aspects of randomness, but also because they can be used in analyzing experiments where assignments to treatment and control groups are decided by the toss of a coin.\n", "\n", "In this example we will simulate the number of heads in 100 tosses of a coin. The histogram of our results will give us some insight into how many heads are likely.\n", "\n", "Let's get started on the simulation, following the steps above.\n", "\n", "### Step 1: What to Simulate ###\n", "The quantity we are going to simulate is the number of heads in 100 tosses. \n", "\n", "### Step 2: Simulating One Value ###\n", "We have to figure out how to make one set of 100 tosses and count the number of heads. Let's start by creating a coin." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "coin = np.array(['Heads', 'Tails'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In our earlier example we used `np.random.choice` and a `for` loop to generate multiple tosses. But sets of coin tosses are needed so often in data science that `np.random.choice` simulates them for us if we include a second argument that is the number of times to toss.\n", "\n", "Here are the results of 10 tosses." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['Tails', 'Tails', 'Tails', 'Heads', 'Tails', 'Tails', 'Tails',\n", " 'Heads', 'Heads', 'Heads'], dtype='\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RepetitionNumber of Heads
0154.0
1254.0
2347.0
3458.0
4557.0
.........
9995999653.0
9996999741.0
9997999849.0
9998999942.0
99991000051.0
\n", "

10000 rows × 2 columns

\n", "" ], "text/plain": [ " Repetition Number of Heads\n", "0 1 54.0\n", "1 2 54.0\n", "2 3 47.0\n", "3 4 58.0\n", "4 5 57.0\n", "... ... ...\n", "9995 9996 53.0\n", "9996 9997 41.0\n", "9997 9998 49.0\n", "9998 9999 42.0\n", "9999 10000 51.0\n", "\n", "[10000 rows x 2 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "simulation_results" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEfCAYAAAAUfVINAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAnVElEQVR4nO3de1gUZf8G8HvcBEGpNZA1Dp4ARQ1PoJCadkJNQhHPmlmJGqTvzzwEakqahqfMNPUlUcPEFBPN1DR9JRPPaRrla6GIJxTlaCossbu/P7zc1w1YZmGWHdj7c138sTMPM9953IvbmXlmHiE/P18HIiIimalj6QKIiIjKwoAiIiJZYkAREZEsMaCIiEiWGFBERCRLDCgiIpIlBhQREckSA4qIiGSp1gZUWlqapUuo1di/5sO+NS/2r3lJ2b+1NqCIiKhmY0AREZEsMaCIiEiWGFBERCRLFgsojUaDefPmoV27dlCpVGjXrh3mzZuHkpISS5VEREQy8oSldrxs2TLExcVh9erVaNOmDX7//XeEh4fDxsYG77//vqXKIiIimbBYQJ08eRJ9+vTBq6++CgBo2rQpXn31VZw+fdpSJRERkYxY7BJfQEAAUlJS8OeffwIALly4gMOHDyMwMNBSJRERkYwIlppRV6fTYd68eVi6dCkUCgVKSkowdepUfPDBB0Z/jw/ZUU2ieeoZ3P5bYbSNc10NFAU3q6kiIvnw8vIyut5il/iSkpKwefNmxMXFwdvbG6mpqYiKikKTJk3wxhtvlPt7FR3QI2lpaaLbkunYv+KcygP67b5htM3+EFd0fqwv2bfmxf41Lyn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l4dBZ14cKFUmcIb775JpYsWYKIiAh07twZv/zyCw4dOgRHR0ez1NKmTRsMHToU48aN0w8z/+uvvwyGS0+cOBE//PADRo0ahSFDhsDX1xdqtRoXL17E9u3b9YFWGfPnz0dISAheeeUVjB49GjqdDmvXrsXff/+Njz76SKrDrJDYY3z55ZdhY2ODYcOG4c0330RxcTE2b95c6pJq3bp1MXv2bEycOBF9+/bF4MGDkZ2djTVr1qB169YGoT5x4kTk5uaiR48ecHV1xc2bN7FmzRo0btzY6OucqPZgQJFsuLu7Y+TIkVi/fn2pdVOnTkVubi6SkpKwY8cOdO/eHd9++63oZ39M5e/vj+effx4LFixARkYGPDw8sHHjRjz//PP6NnZ2dti5cyc+++wzJCUlYdu2bahfvz6aNWuG8PDwMgcCiNWtWzd8++23+Pjjj7Fo0SIIggA/Pz+sX7++0qFXGWKP0dPTEwkJCZg7dy6io6Ph6OiIYcOGoXv37hgwYIDBNkeNGgWdTodly5YhOjoanp6eiI2Nxc6dO5GSkqJvN2TIEGzYsAHr169Hfn4+nJ2dERgYiMjISDg4OFRbH5DlCPn5+dV715WIiEgE3oMiIiJZYkAREZEsMaCIiEiWGFBERCRLDCgiIpIlBhQREckSA4qIiGSJAUVERLLEgCIiIlliQBERkSz9P0OMdaVnZFlsAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig, ax1 = plt.subplots()\n", "\n", "unit = 'unit'\n", "\n", "ax1.hist(simulation_results['Number of Heads'], bins = np.arange(30.5, 69.6, 1), density = True, ec='white')\n", "\n", "y_vals = ax1.get_yticks()\n", "\n", "y_label = 'Percent per ' + (unit if unit else 'unit')\n", "\n", "x_label = 'Number of Heads'\n", "\n", "ax1.set_yticklabels(['{:g}'.format(x * 100) for x in y_vals])\n", "\n", "plt.ylabel(y_label)\n", "\n", "plt.xlabel(x_label)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Each bins has width 1 and is centered at each value of the number of heads.\n", "\n", "Not surprisingly, the histogram looks roughly symmetric around 50 heads. The height of the bar at 50 is about 8% per unit. Since each bin is 1 unit wide, this is the same as saying that about 8% of the repetitions produced exactly 50 heads. That's not a huge percent, but it's the largest compared to the percent at every other number of heads.\n", "\n", "The histogram also shows that in almost all of the repetitions, the number of heads in 100 tosses was somewhere between 35 and 65. Indeed, the bulk of the repetitions produced numbers of heads in the range 45 to 55. \n", "\n", "While in theory it is *possible* that the number of heads can be anywhere between 0 and 100, the simulation shows that the range of *probable* values is much smaller.\n", "\n", "This is an instance of a more general phenomenon about the variability in coin tossing, as we will see later in the course." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### A More Compact Version of the Code ###\n", "We wrote the code for the simulation to show each of the steps in detail. Here are the same steps written in a more compact form. You can see that the code starts out the same way as before, but then some steps are combined." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "heads = np.array([])\n", "\n", "num_repetitions = 10000\n", "\n", "for i in np.arange(num_repetitions):\n", " outcomes = np.random.choice(coin, 100)\n", " heads = np.append(heads, np.count_nonzero(outcomes == 'Heads'))" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([53., 54., 55., ..., 54., 46., 50.])" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heads" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Moves in Monopoly ###\n", "Each move in the game Monopoly is determined by the total number of spots of two rolls of a die. If you play Monopoly, what should you expect to get when you roll the die two times?\n", "\n", "We can explore this by simulating the sum of two rolls of a die. We will run the simulation 10,000 times as we did in the previous example. Notice that is this paragraph we have completed Steps 1 and 3 of our simulation process.\n", "\n", "Step 2 is the one in which we simulate one pair of rolls and add up the number of spots." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "die = np.arange(1, 7)\n", "sum(np.random.choice(die, 2))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "That simulates one value of the sum of two rolls. We are now all set to run the simulation according to the steps that are now familiar." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "moves = np.array([])\n", "\n", "num_repetitions = 10000\n", "\n", "for i in np.arange(num_repetitions):\n", " one_move = sum(np.random.choice(die, 2))\n", " moves = np.append(moves, one_move)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here is a histogram of the results." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAb4AAAEhCAYAAAAAvcV/AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAu7klEQVR4nO3de1zOd+M/8NeldFDsShKdHOrSwZ1ToZXTjJjucr47mK/badEwm1Cbwy22HGJzSOM2FmJC24jpzs0cCjOL2pwuS1IRlVBS1PX7w8P1u691cFXX1aer6/V8PPZ47HN8vz7NvLo+1+cgKiwslIGIiEhLNBM6ABERUUNi8RERkVZh8RERkVZh8RERkVZh8RERkVZh8RERkVZh8RERkVYRtPiSkpLg5+cHR0dHiMVixMTEKCwXi8VV/hMcHFztPs+cOVPlNjdv3lT34RARkQbQFXLw4uJiODk5wd/fHzNmzKi0/MaNGwrTKSkp8PPzw6hRo9647/Pnz8PExEQ+3aZNm3rnJSIizSdo8Xl6esLT0xMAEBQUVGm5ubm5wvTRo0dhZ2eHfv36vXHfZmZmMDU1VU1QIiJqMjTmO76ioiLExcVh0qRJSq0/aNAg2Nvbw8fHB6dPn1ZzurqTSqVCRxCMth47j1u78LgbH0E/8dXGgQMHUFpaCn9//xrXa9euHdatW4devXqhrKwM+/btw8iRIxEfHw8PD49qtxPyP1Jj/gOibtp67Dxu7cLjbngSiaTaZ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pFRYfERFpFRYfERFplf8Hq5hCBHC1OZwAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "results = pd.DataFrame({'Repetition':np.arange(1, num_repetitions + 1), 'Sum of Two Rolls':moves})\n", "\n", "fig, ax1 = plt.subplots()\n", "\n", "unit = 'unit'\n", "\n", "ax1.hist(results['Sum of Two Rolls'], bins = np.arange(1.5, 12.6, 1), density = True, color='darkblue', ec='white')\n", "\n", "y_vals = ax1.get_yticks()\n", "\n", "y_label = 'Percent per ' + (unit if unit else 'unit')\n", "\n", "x_label = 'Sum of Two Rolls'\n", "\n", "ax1.set_yticklabels(['{:g}'.format(x * 100) for x in y_vals])\n", "\n", "plt.ylabel(y_label)\n", "\n", "plt.xlabel(x_label)\n", "\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Seven is the most common value, with the frequencies falling off symmetrically on either side." ] } ], "metadata": { "anaconda-cloud": {}, "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.12" } }, "nbformat": 4, "nbformat_minor": 1 }