{
"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",
"import math\n",
"from scipy import stats\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": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"colors = pd.read_csv(path_data + 'roulette_wheel.csv', usecols=['Color'])['Color']\n",
"\n",
"pockets = np.array(['0','00'])\n",
"\n",
"for i in np.arange(1, 37):\n",
" pockets = np.append(pockets, str(i)) \n",
"\n",
"wheel = pd.DataFrame(\n",
" {'Pocket':pockets,\n",
" 'Color':colors})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The Central Limit Theorem ###\n",
"Very few of the data histograms that we have seen in this course have been bell shaped. When we have come across a bell shaped distribution, it has almost invariably been an empirical histogram of a statistic based on a random sample.\n",
"\n",
"The examples below show two very different situations in which an approximate bell shape appears in such histograms."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Net Gain in Roulette ###\n",
"In an earlier section, the bell appeared as the rough shape of the total amount of money we would make if we placed the same bet repeatedly on different spins of a roulette wheel. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
"
\n",
"
\n",
"
Pocket
\n",
"
Color
\n",
"
\n",
" \n",
" \n",
"
\n",
"
0
\n",
"
0
\n",
"
green
\n",
"
\n",
"
\n",
"
1
\n",
"
00
\n",
"
green
\n",
"
\n",
"
\n",
"
2
\n",
"
1
\n",
"
red
\n",
"
\n",
"
\n",
"
3
\n",
"
2
\n",
"
black
\n",
"
\n",
"
\n",
"
4
\n",
"
3
\n",
"
red
\n",
"
\n",
"
\n",
"
5
\n",
"
4
\n",
"
black
\n",
"
\n",
"
\n",
"
6
\n",
"
5
\n",
"
red
\n",
"
\n",
"
\n",
"
7
\n",
"
6
\n",
"
black
\n",
"
\n",
"
\n",
"
8
\n",
"
7
\n",
"
red
\n",
"
\n",
"
\n",
"
9
\n",
"
8
\n",
"
black
\n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Pocket Color\n",
"0 0 green\n",
"1 00 green\n",
"2 1 red\n",
"3 2 black\n",
"4 3 red\n",
"5 4 black\n",
"6 5 red\n",
"7 6 black\n",
"8 7 red\n",
"9 8 black"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"wheel.head(10)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The bet on red pays even money i.e. 1 to 1. We define the function `red_winnings` that returns the net winnings on one \\$1 bet on red. Specifically, the function takes a color as its argument and returns 1 if the color is red. For all other colors it returns -1."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"def red_winnings(color):\n",
" if color == 'red':\n",
" return 1\n",
" else:\n",
" return -1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The table `red` shows each pocket's winnings on red."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
"
\n",
"
\n",
"
Pocket
\n",
"
Color
\n",
"
Winnings: Red
\n",
"
\n",
" \n",
" \n",
"
\n",
"
0
\n",
"
0
\n",
"
green
\n",
"
-1
\n",
"
\n",
"
\n",
"
1
\n",
"
00
\n",
"
green
\n",
"
-1
\n",
"
\n",
"
\n",
"
2
\n",
"
1
\n",
"
red
\n",
"
1
\n",
"
\n",
"
\n",
"
3
\n",
"
2
\n",
"
black
\n",
"
-1
\n",
"
\n",
"
\n",
"
4
\n",
"
3
\n",
"
red
\n",
"
1
\n",
"
\n",
" \n",
"
\n",
"
"
],
"text/plain": [
" Pocket Color Winnings: Red\n",
"0 0 green -1\n",
"1 00 green -1\n",
"2 1 red 1\n",
"3 2 black -1\n",
"4 3 red 1"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"red = wheel.copy()\n",
"\n",
"red['Winnings: Red'] = wheel['Color'].map(red_winnings)\n",
"\n",
"red.head(5)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Your net gain on one bet is one random draw from the `Winnings: Red` column. There is an 18/38 chance making \\\\$1, and a 20/38 chance of making -\\$1. This probability distribution is shown in the histogram below."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAi4AAAFZCAYAAAC/haQ7AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAtd0lEQVR4nO3de1hU5d7/8c+IJzwkZSNmnggohCwNFcPUwqK2bDUNNDtuSzPM0kpL2k+aZqFbrNSIbbk13UpPnio0q62JaSlqZmqeIhXzOCSKiQEmzO+P/WOeRg6uIYZhwft1Xfwx675nre/c1+30aR3usWRnZ9sFAABgArU8XQAAAIBRBBcAAGAaBBcAAGAaBBcAAGAaBBcAAGAaBBcAAGAaBBcAAGAaBBcAAGAaBBcD0tPTPV2CqTBermG8XMN4uYbxcg3j5RpPjBfBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmAbBBQAAmEZtTxdgBvn5DfXtt1meLsM0fv21js6eZbyMql+/oadLAADTILgYkJl5QZMmbfZ0GaaRn5+nevXqe7oM0xg/vqOnSwAA0+BSEQAAMA2CCwAAMA2CCwAAMA2CCwAAMA2CCwAAMA2CCwAAMA2CCwAAMA2PBZf4+Hj5+Pg4/V1//fWOdrvdrvj4eAUFBal58+aKiorS3r17PVUuAACo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AABQEsPB5bfffivzN4IkKScn508XBAAAUBrDwSUgIECrV68utf0///mPrrvuugopCgAAoCSGg8sjjzyitWvX6rnnnnNa+j8rK0vPP/+81q1bp4cfftgtRQIAAEgu3Jw7bNgw7dq1S/PmzdP7778vq9Uqi8WizMxM2e12PfDAA4qNjXVnrQAAoIYzHFwkaebMmYqJiVFKSooyMjJkt9vl5+enfv366bbbbnNXjQAAAJJcDC6S1L17d3Xv3t0dtQAAAJSJlXMBAIBpuHTGZcGCBZo/f74yMjJK/C0ji8XidOMuAABARTIcXCZNmqS33npLISEhiomJKXMVXQAAAHcwHFwWLlyo3r17a+HChe6sBwAAoFSG73E5f/687rzzTnfWAgAAUCbDwaVr167avXu3O2sBAAAok+HgMm3aNH3xxRdauHCh7Ha7O2sCAAAokeF7XAYPHqwLFy7omWee0QsvvKAWLVrIy8vLqY/FYlFaWlqFFwkAACC5EFyuvvpqWa1WBQQEuLMeAACAUhkOLp9++qk76wAAALgsVs4FAACmUeoZlyNHjkiSWrVq5fT6cor6AwAAVLRSg8tNN90ki8WikydPqm7duo7Xl3P69OkKLRAAAKBIqcHl7bfflsViUZ06dZxeAwAAeEqpweXBBx8s8zUAAEBl4+ZcAABgGgQXAABgGgQXAABgGgQXAABgGgQXAABgGoaCS15enqZOnaq1a9e6ux4AAIBSGQou9evX15tvvqmjR4+6ux4AAIBSGb5U1L59ex08eNCdtQAAAJTJcHAZP368FixYoC+++MKd9QAAAJSq1JVzLzVz5kz5+Pho8ODBatGihdq2bStvb2+nPhaLRYsXL67wIgEAACQXgsu+fftksVjUsmVLSdLPP/9crA+/ZQQAANzJcHDZtWuXO+sAAAC4LNZxAQAApuFScCkoKNDixYs1cuRIDRo0SD/88IMkKTs7Wx999JFOnjzpliIBAAAkF4LL2bNnFRkZqeHDh+uTTz7R6tWrlZWVJUlq3Lix/v73v+vdd991W6EAAACGg8vEiRO1b98+LVmyRN9//73sdrujzcvLS3369NHq1asNH/i9995TeHi4WrVqpVatWumuu+5yetTabrc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HTv022+/aeDAgaW2de3aVZJksVgcPx7nTpV1nMrUvHlzp6XMBw8erI4dOyopKYngArgZl4oAk7r11lu1b98+ZWdnO7alpaXpmmuu0aBBg0psK3qfVPK9J/Hx8fLx8dGBAwf07LPPys/PT9dee60effRRnT592un47du313333adt27bpnnvuUfPmzRUSEqJ33nnHqd+fPY7dbldCQoJCQkJ0zTXXKDIyUlu2bFFUVJSioqKc+s6ZM0fh4eFq0aKF2rZtq549e2ru3LmXHcuTJ0/qxx9/1O+//37ZviWxWq0KDAws9tstdrtd7777rsLDw+Xr6ys/Pz8NGzZMx44dK7aPhQsXKjQ0VL6+vurWrZs+++yzctUCVHcEF8CkunbtqsLCQm3ZssWxLS0tTWFhYercubMkFWurX7++OnbseNl9P/744zp+/Lj+/ve/65FHHtHKlSv1wgsvFOt3+PBh3X///QoLC9Nrr72mtm3b6qWXXtLatWsNfQYjx3n11Vc1efJkBQUFadKkSbrllls0cOBAHT9+3KnfggULNGbMGAUEBOi1117TSy+9pNDQUEdgK8vEiRPVpUuXYvs06uLFizp+/LiuvPJKp+3PPfec4uLi1KFDB8XHx+uJJ57QmjVr9Je//MUpVCYnJ2vkyJFq0qSJXnnlFd19990aPny4duzYUa56gOqMS0WASRWdOUlLS1NkZKQkafPmzXr22Wd1xRVXKCgoqFhbx44dVa9evcvu+/rrr9e7777reG232/Xee+9p+vTpatKkiWP7Tz/9pI8//li33367JOmhhx7SjTfeqPnz5ysiIuJPH+eXX37RrFmzFBkZqQ8//FAWi0WSFBwcrGeeeUYtWrRwvPeLL75Qu3bttGDBgsse98/6/ffflZWVJem/97jMmDFDNptNTz75pKPP5s2bNW/ePKdfSZf+e4P07bffrnfffVcvvPCCLl68qFdeeUVBQUFatWqV47LabbfdpgEDBqhVq1Zu/zyAmXDGBTApf39/+fr6Ou5lOXDggDIzMx33sHTt2rVYW3h4uKF9P/74406vu3XrpoKCAh09erRYDUWhRZLq1aunTp06KSMjo0KOs27dOv3+++8aOnSoI7RI0gMPPOAUo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MTNQPP/ygO++8Uw0aNNDhw4e1cuVKPfzww3r22WdVp04djR8/Xk8//bR69+6tmJgYnTp1Su+9957atWvnOIMD4L844wKYXNFj0e3atSt2KeiPZ1nMeMZFksaPH6+XXnpJe/fu1csvv6xt27Zp8eLFatKkidNTOEOGDFFubq6SkpI0ZswYLVu2TA8++KA++eQT1apVOV91I0eO1MmTJ5WcnCxJmjp1qpKSknT+/HnFx8drwoQJ+vzzz9WrVy/99a9/dbzv4Ycf1syZM5Wdna0JEybos88+0+zZs9WhQ4dKqRswE0t2djZ3fwEwlYKCAgUEBKhPnz6aOXOmp8sBUIk44wKgSsvNzS22bdGiRTpz5ox69OjhgYoAeBL3uACo0pYvX6758+fr7rvv1pVXXqnt27dr0aJFuvHGG9W3b19PlwegkhFcAFRpISEhatCggd555x2dPXtWV199tR555BG9/PLLqlu3rqfLA1DJuMcFAACYBve4AAAA0yC4AAAA0yC4AAAA0yC4AAAA0yC4AAAA0yC4AAAA0/h/Y0OCTjo2IS0AAAAASUVORK5CYII=\n",
"text/plain": [
"
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"unit = 'inch'\n",
"\n",
"fig, ax = plt.subplots(figsize=(8,5))\n",
"\n",
"ax.hist(red['Winnings: Red'], bins=np.arange(-1.5, 1.6, 1), \n",
" density=True, color='darkblue', alpha=0.8, ec='white', zorder=5)\n",
"\n",
"y_vals = ax.get_yticks()\n",
"\n",
"y_label = 'Percent per ' + (unit if unit else 'unit')\n",
"\n",
"x_label = 'Winnings : Red'\n",
"\n",
"ax.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.title('');\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now suppose you bet many times on red. Your net winnings will be the sum of many draws made at random with replacement from the distribution above.\n",
"\n",
"It will take a bit of math to list all the possible values of your net winnings along with all of their chances. We won't do that; instead, we will approximate the probability distribution by simulation, as we have done all along in this course. \n",
"\n",
"The code below simulates your net gain if you bet \\$1 on red on 400 different spins of the roulette wheel. "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"num_bets = 400\n",
"repetitions = 10000\n",
"\n",
"net_gain_red = np.array([])\n",
"\n",
"for i in np.arange(repetitions):\n",
" spins = red.sample(num_bets, replace=True)\n",
" new_net_gain_red = spins['Winnings: Red'].sum()\n",
" net_gain_red = np.append(net_gain_red, new_net_gain_red)\n",
"\n",
"\n",
"results = pd.DataFrame(\n",
" {'Net Gain on Red':net_gain_red}\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAAFZCAYAAACc3vXuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAA43UlEQVR4nO3de1hVZd7/8c8WUVI0FAlPmI6iomkqJaR5yBpMe9Sy8FTpGJ7TzDQP9TPzUOSINkrIU8Olaco8UlqRNpqWpalomqemsRjPImCCeEAFhP37o8s9bYHNBvZmw+L9ui7+2Ote617ffV+KH9e6171MGRkZZgEAABhYFVcXAAAA4GwEHgAAYHgEHgAAYHgEHgAAYHgEHgAAYHgEHgAAYHgEHgAAYHgEHgAAYHgEHidKTEx0dQnlGuNjG+NTNMbINsbHNsbHNqOND4EHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYXlVXFwAAJZWVVVP796c5tM9GjWqqQQMPh/YJwPUIPAAqrAsXsjVv3l6H9hkR0Z3AAxgQt7QAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAI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+al58+YaPHiwfv75Z6t9zGazwsPD1bp1a9WvX19PPPGE/v3vf7uoYtdavHixvLy89Oqrr1q2GWl8DBl4JGnUqFE6evSoLly4oO+++87qiS1nGjdunH799VfFxsZq9+7dGjJkiMaOHatdu3ZZ1XbkyBF9/PHH+uSTT3TkyBGNHTu2TOorD/bv36+nnnpKDz/8sLZu3apvv/1WEydOVNWq/73gWNnHSJLee+89ubm5FdhWWccnOTlZycnJmjt3rnbv3q33339fu3fvVlhYmNV+lXV8pP8uvDp16lTt2LFDnTt3VmhoqM6ePevq0src999/r7CwMG3ZskXx8fGqWrWqnnzySV26dMmyz9KlSxUVFaWFCxfqm2++kY+Pj5566ildvXrVhZWXvR9++EGrVq1S27ZtrbYbaXwM91i6qzVq1EgLFy7Uc889Z9l23333aezYsZo0aZJ++eUXBQUFafPmzQoODpYk7dmzR3369NEPP/wgf39/V5VeZkJCQtStWzfNnj27wHbGSDp48KCee+45ffvtt/L399eqVas0YMAASYzPnb766isNHjxYp0+fVu3atSv9+Dz66KNq27atli1bZtnWqVMnDRgwoNIvvHrt2jU1adJEa9euVZ8+fWQ2m9W6dWuNHj1a06ZNkyTduHFD/v7+mj9/fqWZBnH58mX16NFDS5cu1V//+le1adNGixYtMtz4GPYKj6sEBwfrs88+U3p6uvLy8rRp0yalpaWpR48ekqR9+/bJ09PTagJ1cHCwatasWeYLI7rCb7/9pn379snX11ePP/64/P391adPH3333XeWfSr7GF29elVhYWF69913C3yysLKPz52uXr2q6tWrq0aNGpIq9/iUp4VXy6Nr164pLy9PXl5ekqTTp08rNTXVarzuuusudenSpVKN18svv6wBAwZY/p26zWjjQ+BxsJUrV8pkMulPf/qT7rnnHo0ZM8ZyP12SLly4IG9vb6s1gUwmk+rVq5fvUXojOnXqlCQpPDxczz77rD755BM99NBDGjhwoI4ePSqJMXrllVf06KOPKiQkpMD2yj4+f5SRkaG33npLw4cPt9wSrczjk5aWptzc3HxB2cfHx/Df3R4zZ85Uu3bt1LlzZ0m/z7mUVKnHa9WqVTpx4oRef/31fG1GGx9DPqXlaAsWLFBERITNfb744gt169ZNCxYsUFpamj7//HPVrVtXmzZt0vjx47Vp0ya1a9dOUv5FEaWKvzCivWNUrVo1SdLIkSP1/PPPS5Luv/9+ff/991q5cqWWLFkiyXhjZO/4JCUl6aeffsq3rMKdKuv4dOvWzfI5MzNTQ4cOVYMGDTRv3jyrfY02PsXFwqv5vfbaa0pISNDmzZvzzY2rrOOVmJioefPm6Z///Kfld3NBjDI+BB47jB8/XoMGDbK5T+PGjXXy5El98MEH2rlzpyXctGvXTnv27NEHH3ygyMhI3XPPPbp48aLVHxiz2ay0tLQKvTCivWN0+38FrVq1smpr2bKlzp07J0mGHCN7xyc2NlbHjh1To0aNrNpGjhypzp07a/PmzZV6fG67du2aQkNDJUnr1q2Th8d/34lkxPGxFwuvFmzWrFnasGGDvvjiCzVt2tSy3dfXV9LvVwX/+OersozXvn37lJaWpoceesiyLTc3V7t379aKFSuUkJAgyTjjQ+Cxg7e3t7y9vYvc7/r165KU738Pbm5uysvLkyR17txZ165d0759+yxzDPbt26fMzMwKvTCivWN07733qkGDBkpMTLTafvz4cbVp00aSMcfI3vGZPXu2Jk2aZLWtS5cumj9/vp544glJlXt8pN/n7ISGhspsNuuTTz6Rp6enVbsRx8def1x49cknn7Rs3759u/r37++6wlxoxowZ2rBhgzZu3KiWLVtatd17773y9fXV9u3b1alTJ0nSzZs3tWfPnnxXDY3oiSeeUMeOHa22vfjii2revLleeeUVtWjRwlDjQ+BxoJYtW+pPf/qTpk6dqgULFqhu3brauHGjtm/frtjYWEm/X9l47LHHNGXKFC1dulRms1lTpkxR7969Df/0iPT7pdFJkybpnXfe0X333af27dvr008/1Q8//KC//vWvkir3GDVs2FANGzbMt71x48aW/5lW5vG5evWqBg4cqKtXr2rt2rW6fv265T8aderUUbVq1Sr1+EgsvPpH06ZN07p167RmzRp5eXlZ5qTUrFlTnp6eMplMGj9+vBYvXix/f3+1aNFCERERqlmzpp555hkXV+98Xl5elgn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r//d//1YsvvihJysvLU926dQudNF2jRg2r7/HHK1i3sV4SkB+3tIBK6PYtqoSEBCUkJFhdwWnatKnq169vaWvbtm2+20Dl3e0rQMePH7fafuvWLZ05cybf/jVr1tSAAQO0bNkyHTlyRKGhoVq5cmWJJyPb689//rN69OihiIgIXbt2TZLUrFkzZWRkKDAwUD179sz3czt8NmnSRJL066+/5uv3zu8NgMADVErt2rWTp6enNm3apMTExHy3rIKCggptqwh69uypqlWrKiYmxupqR2xsrC5fvmy1752Ps1etWlVt27aVJKsnogpS2sfSJWny5Mm6dOmSVq5cKUkaOHCg8vLy9M477+Tb12w2WyY9d+zYUT4+Pvrwww918+ZNyz7ffPONjh07VuJ6AKPilhZQCbm5uemBBx7Qt99+qypVquiBBx6wag8KCtJrr70mSXZPWC5PfHx8NHHiRP3tb3/TM888o8cff1wnTpzQ//3f/6lZs2ZWt4Geeuop+fj4KDg4WPfcc49OnjypDz74QG3atCly8u/cuXP1j3/8Q4cPH7Z74vKdevXqpbZt2yoqKkpjxoxRly5dNHbsWEVFRemnn37SY489pho1auj06dPauHGjnn/+eU2ZMkXu7u564403NGnSJPXt21ehoaG6ePGi/v73vysgIMByxQjA77jCA1RStx9PDwgIyHfL6o9XdSriFR5JeuONN/Taa6/p3//+t2bPnq0DBw4oLi5Od999t9VTTSNHjtSNGzcUHR2tadOmaf369Xr22Wf1+eefq0qVsvkVOXHiRKWkpCg2NlaStHDhQkVHRyszM1Ph4eGaM2eONm/erEcffVT/8z//Yznu+eef17Jly5SRkaE5c+bon//8p95//3116NChTOoGKhJTRkYGs9sAVAq5ublq0aKF+vXrp2XLlrm6HABliCs8AAzpxo0b+batXbtWly5dUvfu3V1QEQBXYg4PAEPasGGDVq1apd69e6tOnTo6ePCg1q5dq/vuu0/9+/d3dXkAyhiBB4AhtW3bVjVq1NDy5ct1+fJl1atXT8OHD9fs2bNVrVo1V5cHoIwxhwcAABgec3gAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDhEXgAAIDh/X8kpxR6eAGsiQAAAABJRU5ErkJggg==\n",
"text/plain": [
"
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"unit = 'inch'\n",
"\n",
"fig, ax = plt.subplots(figsize=(8,5))\n",
"\n",
"ax.hist(results, bins=np.arange(-80, 50, 6), \n",
" density=True, color='darkblue', alpha=0.8, ec='white', zorder=5)\n",
"\n",
"y_vals = ax.get_yticks()\n",
"\n",
"y_label = 'Percent per ' + (unit if unit else 'unit')\n",
"\n",
"x_label = 'Winnings : Red'\n",
"\n",
"ax.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.title('');\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That's a roughly bell shaped histogram, even though the distribution we are drawing from is nowhere near bell shaped.\n",
"\n",
"**Center.** The distribution is centered near -20 dollars, roughly. To see why, note that your winnings will be \\$1 on about 18/38 of the bets, and -$1 on the remaining 20/38. So your average winnings per dollar bet will be roughly -5.26 cents:"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.05263157894736842"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"average_per_bet = 1*(18/38) + (-1)*(20/38)\n",
"average_per_bet"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"So in 400 bets you expect that your net gain will be about -\\$21:"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-21.052631578947366"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"400 * average_per_bet"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For confirmation, we can compute the mean of the 10,000 simulated net gains:"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-20.9324"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.mean(results.iloc[:,0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Spread.** Run your eye along the curve starting at the center and notice that the point of inflection is near 0. On a bell shaped curve, the SD is the distance from the center to a point of inflection. The center is roughly -\\$20, which means that the SD of the distribution is around \\$20.\n",
"\n",
"In the next section we will see where the \\$20 comes from. For now, let's confirm our observation by simply calculating the SD of the 10,000 simulated net gains:"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"20.00472519781272"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.std(results.iloc[:,0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Summary.** The net gain in 400 bets is the sum of the 400 amounts won on each individual bet. The probability distribution of that sum is approximately normal, with an average and a SD that we can approximate."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Average Flight Delay ###\n",
"The table `united` contains data on departure delays of 13,825 United Airlines domestic flights out of San Francisco airport in the summer of 2015. As we have seen before, the distribution of delays has a long right-hand tail."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"united = pd.read_csv(path_data + 'united_summer2015.csv')"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjgAAAFZCAYAAACVNVWUAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAssklEQVR4nO3de1xVdb7/8fcWQQw0kIgjiqlAKngNb8dGprxg2ZhOqQgep2NqZrfHKS21m5qNaKKNJlonasrQjgg2ovnQU2mOWnQxTaupoRRvCSYICAkk7N8f/eQMIbDY7M3ee/F6Ph48Hu211nevz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TExP15ptv1tiuoKBA33zzjUaNGmX/CgEAABqozoBTUlKi3NzcqteFhYWqrKysto3FYtE111yje+65R/PmzXNMlQAAAA1QZ8CZMWOGZsyYIUnq3bu3li5dqtGjRzdJYQAAALYy/LDNI0eOOLIOAAAAuzEccK64ePGiTp8+rQsXLshqtdZYf/PNN9ulMAAAAFsZDjgXLlzQ3Llz9c4776iioqLGeqvVKovFovz8fLsWCAAA0FCGA86jjz6q7du3a8aMGbr55pvl5+fnwLIAAABsZzjgvP/++5o5c6b+/Oc/O7IeAACARjN8oz8vLy+FhoY6shYAAAC7MBxwxo4dq/fee8+RtQAAANiF4YDz8MMPKycnR/fff78+++wz5eTk6KeffqrxAwAA4GyG5+BERUXJYrHo8OHDSk1NrXU7vkUFAACczXDAeeKJJ+p82CYAAICrMBxw5s+f78g6AAAA7MbwHJx/VVFRofz8fF2+fNne9QAAADRagwLOF198oXHjxik4OFhhYWE6cOCAJCkvL08TJ07U3r17HVIkAABAQxgOOJ9++qlGjx6t48ePa9KkSdWeQxUQEKDi4mK99dZbDdr5gQMHNGnSJPXo0UN+fn7asGFDndufOHFCfn5+NX7ef//9Bu0XAACYm+E5OIsXL1ZoaKg++OADlZSUaP369dXWDx06VJs2bWrQzktKShQREaG4uDjdf//9hselp6erZ8+eVa/9/f0btF8AAGBuhgPOF198oaefflre3t76+eefa6zv0KGDcnNzG7TzmJgYxcTESJIeeOABw+PatWunoKCgBu0LAAA0H4YvUbVo0UItWtS+eW5urlq3bm2XouozZcoUhYWFadSoUdq6dWuT7BMAALgPw2dw+vbtq507d2rmzJk11pWXl2vz5s0aOHCgXYv7LV9fXy1evFiDBw9Wy5YttWPHDk2dOlXr1q1TbGxsreOysrIcWldDFBV5qqys1Obxto4tKrqorKzmcxNGV/qduyp6ZAx9qh89MoY+1a+2HoWHhzf4vQwHnMcee0zjx4/XQw89pAkTJkiScnJy9P777ysxMVHHjx9XUlJSgwtoiICAAD388MNVr/v166f8/HytWrWqzoBjS2McpbAwT61aeds83taxbdu2UXh4gM37dSdZWVku9Tt3RfTIGPpUP3pkDH2qn717ZDjg3HrrrXrllVf0+OOPa+PGjZKkWbNmyWq16tprr1VycrIGDBhgt8KMioqKqvfbVwAAoHkxHHAkafz48Ro9erT27NmjH374QZWVlerSpYuGDx8uX19fR9VYp6NHjzLhGAAAVNOggCNJ11xzje644w677Ly4uFjHjh2TJFVWVur06dM6cuSI/P39FRISokWLFungwYPKyMiQJG3cuFGenp7q3bu3WrRooZ07dyo5OVkLFy60Sz0AAMAcDH+LaseOHXr88cdrXf/4449r586dDdr5oUOHFB0drejoaF26dEkJCQmKjo7WkiVLJP06x+f48ePVxiQmJurWW2/VsGHDlJ6erjVr1ujBBx9s0H4BAIC5GT6D89JLL6lr1661ri8tLdWqVat02223Gd750KFDVVBQUOv6devWVXsdHx+v+Ph4w+8PAACaJ8NncL755hv17du31vV9+vTRt99+a4+aAAAAGsVwwLl8+bIuXbpU6/pLly6prKzMLkUBAAA0huGAExERoYyMDFVWVtZYV1lZqYyMDHXv3t2uxQEAANjCcMC5//77dfDgQcXFxenw4cMqKytTWVmZDh8+rPj4eB08ePCqdzkGAABoaoYnGd999906fvy4EhIS9N5770mSLBaLrFarLBaL5s6dW+fdhAEAAJpKg+6DM2fOHI0fP17btm1Tdna2rFarunTpojFjxqhz584OKhEAAKBhDAWcS5cuaeLEiYqNjdV//Md/VHseFAAAgKsxNAendevW+vLLL1VRUeHoegAAABrN8CTj3/3ud/roo48cWQsAAIBdGA44y5Yt0xdffKFnnnlG2dnZV/26OAAAgCswPMl4wIABslqtSkpKUlJSklq0aCFPT89q21gsFv344492LxIAAKAhDAecP/7xj7JYLI6sBQAAwC4MB5zfPvgSAADAVRmegwMAAOAuGhRwTp48qUceeUR9+/ZVSEiI9u/fL0nKy8vT7NmzdfjwYUfUCAAA0CCGL1F99913uu2221RZWan+/fvr5MmTVffFCQgI0GeffaaysjKtWbPGYcUCAAAYYTjgLFiwQG3atNH7778vDw8PhYWFVVsfExOjv/3tb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tz366KM2fQYAroM5OACcbu/evVq+fLluuOEGTZw4UYGBgYqOjtYbb7yh06dP19i+rstTkuTh4SGr1VptWVpams6ePXvV7ePi4rRv3z6tWrVKPj4+GjNmjO0fBoBL4AwOgCb1wQcf6NixY7p8+bJ++ukn/f3vf9eePXsUEhKit99+W97e3pKklStXatSoUbr55pt1zz33KDQ0VHl5efryyy+1e/dunTp1qtZ93H777fqf//kftWnTRhERETp69Ki2bNlSdWbot8aPH6+nnnpKW7du1cSJE+Xr6+uIjw6gCRFwADSpK5eNvLy85O/vr4iICCUkJGjy5Mlq06ZN1XZhYWH68MMP9cILL2jz5s06f/68AgIC1K1bNy1evLjefXh6euqdd95RSkqK+vbtq/T0dD3zzDNX3d7f31+jRo3Stm3b+PYUYBKWgoICa/2bAYC5TZs2TQcOHNDXX38tDw8PZ5cDoJGYgwOg2cvLy9O7776riRMnEm4Ak+ASFYBmKzs7W5988ok2btwoq9Wq6dOnO7skAHZCwAHQbB04cEAPPvigOnbsqKSkJHXq1MnZJQGwE+bgAAAA02EODgAAMB0CDgAAMB0CDgAAMB0CDgAAMB0CDgAAMB0CDgAAMJ3/B9s9X0bcBzWsAAAAAElFTkSuQmCC\n",
"text/plain": [
"
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"unit = 'inch'\n",
"\n",
"fig, ax = plt.subplots(figsize=(8,5))\n",
"\n",
"ax.hist(united['Delay'], bins=np.arange(-20, 300, 10), \n",
" density=True, color='darkblue', alpha=0.8, ec='white', zorder=5)\n",
"\n",
"y_vals = ax.get_yticks()\n",
"\n",
"y_label = 'Percent per ' + (unit if unit else 'unit')\n",
"\n",
"x_label = 'Delay'\n",
"\n",
"ax.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.title('');\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The mean delay was about 16.6 minutes and the SD was about 39.5 minutes. Notice how large the SD is, compared to the mean. Those large deviations on the right have an effect, even though they are a very small proportion of the data."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(16.658155515370705, 39.48019985160957)"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean_delay = np.mean(united['Delay'])\n",
"sd_delay = np.std(united['Delay'])\n",
"\n",
"mean_delay, sd_delay"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now suppose we sampled 400 delays at random with replacement. You could sample without replacement if you like, but the results would be very similar to with-replacement sampling. If you sample a few hundred out of 13,825 without replacement, you hardly change the population each time you pull out a value.\n",
"\n",
"In the sample, what could the average delay be? We expect it to be around 16 or 17, because that's the population average; but it is likely to be somewhat off. Let's see what we get by sampling. We'll work with the table `delay` that only contains the column of delays."
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"
\n",
"\n",
"
\n",
" \n",
"
\n",
"
\n",
"
Delay
\n",
"
\n",
" \n",
" \n",
"
\n",
"
0
\n",
"
257
\n",
"
\n",
"
\n",
"
1
\n",
"
28
\n",
"
\n",
"
\n",
"
2
\n",
"
-3
\n",
"
\n",
"
\n",
"
3
\n",
"
0
\n",
"
\n",
"
\n",
"
4
\n",
"
64
\n",
"
\n",
"
\n",
"
...
\n",
"
...
\n",
"
\n",
"
\n",
"
13820
\n",
"
-4
\n",
"
\n",
"
\n",
"
13821
\n",
"
8
\n",
"
\n",
"
\n",
"
13822
\n",
"
3
\n",
"
\n",
"
\n",
"
13823
\n",
"
-1
\n",
"
\n",
"
\n",
"
13824
\n",
"
-2
\n",
"
\n",
" \n",
"
\n",
"
13825 rows × 1 columns
\n",
"
"
],
"text/plain": [
" Delay\n",
"0 257\n",
"1 28\n",
"2 -3\n",
"3 0\n",
"4 64\n",
"... ...\n",
"13820 -4\n",
"13821 8\n",
"13822 3\n",
"13823 -1\n",
"13824 -2\n",
"\n",
"[13825 rows x 1 columns]"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"delay = united[['Delay']]\n",
"delay"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"17.2125"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.mean(delay['Delay'].sample(400, replace=True))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The sample average varies according to how the sample comes out, so we will simulate the sampling process repeatedly and draw an empirical histogram of the sample average. That will be an approximation to the probability histogram of the sample average."
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [],
"source": [
"sample_size = 400\n",
"repetitions = 10000\n",
"\n",
"means = np.array([])\n",
"\n",
"for i in np.arange(repetitions):\n",
" sample = delay.sample(sample_size, replace=True)\n",
" new_mean = np.mean(sample['Delay'])\n",
" means = np.append(means, new_mean)\n",
"\n",
"results = pd.DataFrame(\n",
" {'Sample Mean': means})"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAjwAAAFZCAYAAACc3vXuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAyxklEQVR4nO3deVTU9f7H8deIKIYaSkRoYAaTStmipqbpzzYtvS6VG1p5zC3NsoWu0uZVu40m2TUjr/fn6VfmkpiUpB7L0tJIvNfCpSybcifERFEhVpnfHx3nXGQbZmFmvjwf53BO3+Xznfcb4uuL72rKzc21CQAAwMAaeLsAAAAATyPwAAAAwyPwAAAAwyPwAAAAwyPwAAAAwyPwAAAAwyPwAAAAwyPwAAAAwyPweJDVavV2CV5RX/uW6L2+ovf6qb727q99E3gAAIDhEXgAAIDhEXgAAIDhE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AALjC4cAzZ84cRUdHa+fOnXr55ZcrLO/Vq5d27drl1uIAAADcweHA89133+mhhx5SUFBQpXdrtW7dWtnZ2W4tDgAAwB0cDjwNGjRQgwZVr56dna0mTZq4pSgAAAB3cjjw3Hzzzdq0aVOly4qLi7VmzRp17drVbYUBAAC4i8OB55lnntG2bds0depU7du3T5J04sQJff755xo0aJAOHTqkZ5991mOFAgAAOMvhBw/ecccdWrJkiZ577jmtXLlSkjR58mTZbDZdfvnlWrp0qW699VaPFQoAAOAshwOPJA0dOlT9+/fX1q1b9euvv6qsrExt27bVXXfdpaZNm3qqRgAAAJfUKvBI0mWXXaYBAwZ4ohYAAACPcDjwbNy4UVu3btX8+fMrXf7cc8/prrvu0r333uu24gAA1TOZGmjXrhynx7duHayIiCA3VgT4JocDz6JFi3TttddWubywsFALFy4k8ABAHTp1qkAWy06nxycm9ibwoF5w+C6t/fv36+abb65y+U033aSffvrJHTUBAAC4lcOBp7S0VAUFBVUuLygoUFFRkVuKuqhjx44KCQmp8DV8+PBK1z9y5Eil63/++edurQsAAPgXh09pxcbGKjU1VVOnTq3wxOWysjKlpqaqffv2bi1u69atunDhgn36xIkT6tOnj4YMGVLtuLVr1+qGG26wT7do0cKtdQEAAP/i8BGexx57TN9++63i4uK0e/duFRUVqaioSLt379aoUaP07bffatKkSW4t7oorrlB4eLj9a/PmzWrWrFmNgadly5blxjVq1MitdQEAAP/i8BGeBx98UIcOHZLFYtHmzZslSSaTSTabTSaTSdOnT9eIESM8VqjNZtP777+vESNG6LLLLqt23YcffliFhYWKjo7WlClTNHjwYI/VBQAAfF+tnsMTHx+voUOH6pNPPtHhw4dls9nUtm1bDRw4UNdcc42HSvzT1q1bdeTIET388MNVrtO0aVPNmTNH3bt3V8OGDbVx40aNHTtWixcvrjGMWa1Wd5fs0e36uvratxSooqJCp0eXlJR4bbyrny2J3p3kzdrPnTsvq/W00+Ol+vz7Xn9798W+zWZztcsdCjwFBQUaPny4RowYoYceekhPPPGEW4qrjffee0+dO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e/Zoy5YtOnbsWJWfcd999+mDDz5Qs2bNFBsbq3379iklJcV+5OhSQ4cO1QsvvKB169Zp+PDhatq0qSdaB+AhBB4APufiaaZGjRqpRYsWio2NlcVi0ejRo9WsWTP7ejExMfryyy/12muvac2aNTp16pRCQ0PVrl07zZkzp8bPCAwM1EcffaTly5fr5ptv1tq1a/XSSy9Vun6LFi3Ur18/ffLJJ9ydBfghU25urq3m1QAA48aNU1pamn744QcFBAR4uxwAtcA1PADggJycHG3YsEHDhw8n7AB+iFNaAFCNw4cPa+fOnVq5cqVsNpvGjx/v7ZIAOIHAAwDVSEtL0+OPP66rr75aSUlJioqK8nZJAJzANTwAAMDwuIYHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAYHoEHAAAY3v8DVTzqxKgVCnoAAAAASUVORK5CYII=\n",
"text/plain": [
"
"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"unit = 'inch'\n",
"\n",
"fig, ax = plt.subplots(figsize=(8,5))\n",
"\n",
"ax.hist(results, bins=np.arange(10, 25, 0.5), \n",
" density=True, color='darkblue', alpha=0.8, ec='white', zorder=5)\n",
"\n",
"y_vals = ax.get_yticks()\n",
"\n",
"y_label = 'Percent per ' + (unit if unit else 'unit')\n",
"\n",
"x_label = 'Delay'\n",
"\n",
"ax.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.title('');\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Once again, we see a rough bell shape, even though we are drawing from a very skewed distribution. The bell is centered somewhere between 16 ad 17, as we expect."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Central Limit Theorem (*pretty important!*)) ###\n",
"\n",
"The reason why the bell shape appears in such settings is a remarkable result of probability theory called the **Central Limit Theorem**. \n",
"\n",
"**The Central Limit Theorem says that the probability distribution of the sum or average of a large random sample drawn with replacement will be roughly normal, *regardless of the distribution of the population from which the sample is drawn*.**\n",
"\n",
"As we noted when we were studying Chebychev's bounds, results that can be applied to random samples *regardless of the distribution of the population* are very powerful, because in data science we rarely know the distribution of the population.\n",
"\n",
"The Central Limit Theorem makes it possible to make inferences with very little knowledge about the population, provided we have a large random sample. That is why it is central to the field of statistical inference."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Proportion of Purple Flowers ###\n",
"Recall Mendel's probability model for the colors of the flowers of a species of pea plant. The model says that the flower colors of the plants are like draws made at random with replacement from {Purple, Purple, Purple, White}.\n",
"\n",
"In a large sample of plants, about what proportion will have purple flowers? We would expect the answer to be about 0.75, the proportion purple in the model. And, because proportions are means, the Central Limit Theorem says that the distribution of the sample proportion of purple plants is roughly normal.\n",
"\n",
"We can confirm this by simulation. Let's simulate the proportion of purple-flowered plants in a sample of 200 plants."
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"