Skip to content

Instantly share code, notes, and snippets.

@AllenDowney
Created October 2, 2018 12:46
Show Gist options
  • Save AllenDowney/8ad4ec6a88d2902801de19b3fce187b9 to your computer and use it in GitHub Desktop.
Save AllenDowney/8ad4ec6a88d2902801de19b3fce187b9 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Think Bayes\n",
"\n",
"This notebook presents example code and exercise solutions for Think Bayes.\n",
"\n",
"Copyright 2018 Allen B. Downey\n",
"\n",
"MIT License: https://opensource.org/licenses/MIT"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"# Configure Jupyter so figures appear in the notebook\n",
"%matplotlib inline\n",
"\n",
"# Configure Jupyter to display the assigned value after an assignment\n",
"%config InteractiveShell.ast_node_interactivity='last_expr_or_assign'\n",
"\n",
"# import classes from thinkbayes2\n",
"from thinkbayes2 import Pmf, Suite\n",
"\n",
"import thinkbayes2\n",
"import thinkplot"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The Dungeons and Dragons club\n",
"\n",
"Suppose there are 10 people in my *Dungeons and Dragons* club; on any game day, each of them has a 70% chance of showing up.\n",
"\n",
"Each player has one character and each character has 6 attributes, each of which is generated by rolling and adding up 3 6-sided dice.\n",
"\n",
"At the beginning of the game, I ask whose character has the lowest attribute. The wizard says, \"My constitution is 5; does anyone have a lower attribute?\", and no one does.\n",
"\n",
"The warrior says \"My strength is 16; does anyone have a higher attribute?\", and no one does.\n",
"\n",
"How many characters are in the party?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The prior\n",
"\n",
"Since there are 10 players, each with the 70% chance of attending, the prior distribution is [binomial](https://en.wikipedia.org/wiki/Binomial_distribution) with `n=10` and `p=0.7`.\n",
"\n",
"The PMF of the binomial distribution is:\n",
"\n",
"$ PMF(k; n, p) = P(k ~|~ n, p) = {n \\choose k}\\,p^{k}(1-p)^{n-k}$\n",
"\n",
"We could evalate the right hand side in Python, or use `MakeBinomialPmf`:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on function MakeBinomialPmf in module thinkbayes2.thinkbayes2:\n",
"\n",
"MakeBinomialPmf(n, p)\n",
" Evaluates the binomial PMF.\n",
" \n",
" n: number of trials\n",
" p: probability of success on each trial\n",
" \n",
" Returns: Pmf of number of successes\n",
"\n"
]
}
],
"source": [
"help(thinkbayes2.MakeBinomialPmf)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And we can confirm that the analytic result matches what we computed by convolution."
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGE1JREFUeJzt3Xu0XnV95/H3xyCg0iKU1FEgBCQqqKO0EXXsKC2oWBVcXajQojjFYaxGrUq7UCkipTNe6mVc4AijCKUOiHhLnSBSAbWjQAIoN4vGiBChEg1quQgEvvPH3sGHx0POScg+58c579daZ519+e29v88TOJ/z2+f3/HaqCkmSWvOwmS5AkqSJGFCSpCYZUJKkJhlQkqQmGVCSpCYZUJKkJhlQUi/JOUkOG/D8lWT3fvljSf5mM513QZJbk8zr1y9M8trNce7+fIO+L9ID2WKmC5CGkuQ64DHAPcBtwDLgjVV160Ttq+pF01VbVb1uKu361/DaqvrnDZzremCbzVFXkmOB3avq0JHzT9v7Io2yB6XZ7qVVtQ3we8AzgKPHG6Szyf8vJJmxX/Rm8trS0AwozQlV9WPgHOApcN9tsL9L8v+A24HdRm+NJXlYkqOT/CjJzUn+Icm2/b6F/e26w5NcD5w/0TWT/F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o7rHa+wM/Cld7wu6R4AflOR3+9q3T7LL+EX754NtW92kwX8JPH0KtUqTsgelueoDdL/pr/e/gS8muYTuB/MD9W425Fq6IHkM8Lqq+lWSj9PdBrys75mtYZLHalfVTUneDlxA14tZVlVTeQzCt+hmp34q8HXg82P7vwy8LskVfa0Xje0/C3h6Vd3S13FNkqOBr/ShdzfwBuBHY8f9Ft17t3Vf728MQpE2hbOZS7NAf/vuyKp6yYM4x5eAD1XVVzdbYdKD4C0+aY5L8ugk3wPuMJzUEntQkqQm2YOSJDXJgJIkNcmAkiQ1yYCSJDXJgJIkNen/AyZqDR4fnZTSAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"prior = thinkbayes2.MakeBinomialPmf(10, 0.7)\n",
"thinkplot.Hist(prior)\n",
"\n",
"thinkplot.decorate(title='Prior distribution',\n",
" xlabel='Number of players',\n",
" ylabel='PMF')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Sneaky update\n",
"\n",
"Since two players spoke, we can eliminate the possibility of 0 or 1 players, and then renormalize, which is a sneaky version of a Bayesian update.\n",
"\n",
"It doesn't make much difference, though, since the prior probabilities for 0 and 1 were so low."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAFshJREFUeJzt3X+UpmV93/H3x4GFxJ8omzSy4K5xrdJopJ3dYG2VRlQ2eFhPDnSX1EB6OKWmoCbW9mCiaKB/aIyJyem2QnQjpApLVtNsw65IFbQ9ZmEGNeCixHVFmGDrphiNv9gffPvHc695HAZm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nM5cWgW747s1V9eojOMefA79XVZ+Yt8KkI+AQn7TEJXlakr8Cvm84qSX2oCRJTbIHJUlqkgElSWqSASVJapIBJUlqkgElSWrS/wdeWUJyFvD8uAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"thinkplot.Pmf(prior, color='gray')\n",
"del prior[0]\n",
"del prior[1]\n",
"prior.Normalize()\n",
"thinkplot.Pmf(prior)\n",
"\n",
"thinkplot.decorate(xlabel='Number of players',\n",
" ylabel='PMF')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Likelihood\n",
"\n",
"There are three components of the likelihood function:\n",
"\n",
"* The probability that the highest attribute is 16.\n",
"\n",
"* The probability that the lowest attribute is 5.\n",
"\n",
"* The probability that the lowest and highest attributes are held by different players.\n",
"\n",
"To compute the first component, we have to compute the distribution of the maximum of $6n$ attributes, where $n$ is the number of players.\n",
"\n",
"Here is the distribution for a single die."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1 0.16666666666666666\n",
"2 0.16666666666666666\n",
"3 0.16666666666666666\n",
"4 0.16666666666666666\n",
"5 0.16666666666666666\n",
"6 0.16666666666666666\n"
]
}
],
"source": [
"d6 = Pmf([1,2,3,4,5,6])\n",
"d6.Print()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And here's the distribution for the sum of three dice."
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xl8VPW9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//U/Vx9fITuFb6LxL1R1hIj8N77WPQ2ARsCfVfVfItL/m338r/sakIyvw/Rf/RlOqWqSiNwK/AHfRNt9wPdV9aLL/xTGlAr7BGVM6bkD31pae4AzItIZX7PdL1W1k6q+iK+J6RT/eIr/uC7AKFW9r5Cv2QHfki09gd+JSP2iXlxV/46vDU2SvzjVBv4LGKSqnfEVsWdL569qjPus1ZExpWcsviVWwNcgeCwwuwTHzVDVK0U8N93/3BURWYKvMWdJ1+jqASQAK/wtimKAVSU81hjPWYEyphSISC18jTPbiYjiW91XgTklOPzSVZ4reA5e8fUdDDz7UdQy9wIsUNWxJchgTNCxU3zGlI67gfdVtbG/k3YjfNedcoEqAftdKDAuzigRqeAvgP2BdcBBIEFEYkWkGr4u7oV9/dVALxFpAb61kvzdso0JCVagjCkdY4FPC2z7GN/dfNkisllEfgYswVdcNonIvSX4umvxnSZcDfxRVY+q6iFgKrAF3+KBGwP2fwuYKyJLVDUVeBj4UES2+L9Gm+/8NzSmjNldfMYYY4KSfYIyxhgTlKxAGWOMCUpWoIwxxgQlK1DGGGOCkhUoY4wxQckKlDHGmKBkBcoYY0xQ+v94KrrH2wDm3AAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"thrice = sum([d6] * 3)\n",
"thinkplot.Pdf(thrice)\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='PMF')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's the CDF for the sum of three dice."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcm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2bcOv+4fA9qp6+yLXfDWDR7f8IHB1kpcs9eZVdT2DpWfOH5bTRuDngAuq6hwGJfa+1fmjSuPlUkfSidnJ4FErMFgoeCfwB0fxdXuq6utLHNs9PPb1JPcwWIzzaJ/V9TrgLOCPh0sUrQf+5Ci/VuqKBSUdpyTfxWCxzFclKQZP+C1g71F8+d8sc2zhvHsxWHtwdMZjqUfdB/hkVe08igxS15zik47f24CPVdXLhqtob2Hwc6e/BV4wct7/XbC9ku1JnjMswPOAA8AXgLOSbEjyQgYruS92/f3A65N8HwyekzRcJVuaOhaUdPx2Ah9fsO9OBnfzPZPkYJL3AvcwKJfPJNlxFNf9UwbThPuBX6yqx6vqMeB24AEGDw+8f+T8G4G7ktxTVfPATwG3JHlgeI1XHPefUJog7+KTJHXJEZQkqUsWlCSpSxaUJKlLFpQkqUsWlCSpSxaUJKlLFpQkqUv/Hy4IyfZTvJt9AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cdf_thrice = thrice.MakeCdf()\n",
"thinkplot.Cdf(cdf_thrice)\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Distribution of the maximum\n",
"\n",
"The `Max` method raises the CDF to a power."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on method Max in module thinkbayes2.thinkbayes2:\n",
"\n",
"Max(k) method of thinkbayes2.thinkbayes2.Cdf instance\n",
" Computes the CDF of the maximum of k selections from this dist.\n",
" \n",
" k: int\n",
" \n",
" returns: new Cdf\n",
"\n"
]
}
],
"source": [
"help(cdf_thrice.Max)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"So here's the CDF for the maximum of six attributes."
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"image/png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M1nmo5MUzR1+C1izEQ+/ZZZ9U8fdi2buwcERj5ludR/gi1V16EbUIPWaQ3zS5nsO8Imq2q2dRXsZzftOvwXuP9Dul1PW57IyyY5tAO4HXARcC+yVZIckO9PM5D7d8S8EnpTk4dDcJ6mdJVsaOQaUtPkOBc6esu0smqv57kxyWZLXARfQhMs3k6zaiOP+G80w4YXAX1fV9VV1HXAGcDnNzQMvHWh/MnBukguqahJ4IXBqksvbYzxys5+hNERexSdJ6iV7UJKkXjKgJEm9ZEBJknrJgJIk9ZIBJUnqJQNKktRLBpQkqZf+P8lJexsdyFiMAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"cdf_max_6 = cdf_thrice.Max(6)\n",
"thinkplot.Cdf(cdf_max_6)\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF',\n",
" title='Maximum of 6 attributes')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If there are `n` players, there are `6*n` attributes. Here are the distributions for the maximum attribute of `n` players, for a few values of `n`."
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3Xt0XGW9//H3J2nTQC8CTVFKWtIqyM1SaAGPLAQEpIBQXXKAan8ih4sXUCkCirCggngBztHyw6O/iopwlGsViqccihYFXRYbQQrlUnpKgVC0oVKU3kO/vz/2Th3SJJOms2f2DJ/XWlmdfZlnf2ea5JPn2Xv2o4jAzMwsb+oqXYCZmVl3HFBmZpZLDigzM8slB5SZmeWSA8rMzHLJAWVmZrnkg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HkZx32gQMLdjvH12Wi5ksqTENwMOBBcDzwN6SBkl6G8md3Ltrfz5wiKR3QTJPUnqXbLOq44Ay678pwC+6rJtFcjVfh6THJE0DHiAJlz9LOqUP7f6RZJhwPnBlRCyPiBeB24GFJJMHPlqw/0zgXkkPREQ78EngFkkL0zb27PcrNKsgX8VnZma55B6UmZnlkgPKzMxyyQFlZma55IAyM7NcckCZmVkuOaDMzCyXHFBmZpZL/x86/50uRYQsGAAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for n in range(2, 10, 2):\n",
" cdf_max = cdf_thrice.Max(n*6)\n",
" thinkplot.Cdf(cdf_max, label='n=%s'%n)\n",
"\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF',\n",
" title='Maximum of 6*n attributes')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To check that, I'll compute the CDF for 7 players, estimate it by simulation, and compare."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHrpJREFUeJzt3XuYVXXd9/H3Zzjm+cB0pw45qJgoKup4uilDU281hUpTSctKJU1LKbnV9CIyukrtqfDJ7PEU5m2ISikZpZl0o11iDIkYGEkKMqExkFpyEuL7/LEWtNnsmT3AXrPXHj6v65qLdV7fvZmZz/x+a+3fUkRgZmaWN3XVLsDMzKwUB5SZmeWSA8rMzHLJAWVmZrnkgDIzs1xyQJmZWS45oKwmSXpb0j7VrmNzSRoraamk16tdSyVJ+oCkeQXzCySdWM2arPY5oKzi0l9O70jqU7R8l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HNynWu3dvGhoa6NGjR7VLMTPbLF0ioFpaWthxxx1pbGxEUvkdthERwbJly2hpaaFfv37VLsfMbLNk1sUn6W5JSyT9sY31knSLpPmSZks6fEvPtWrVKnbffXeHUxFJ7L777m5ZmllNyvIa1HiSUYbbcirQP/0aAdy2NSdzOJXm98XMalVmXXwRMW390z/bMAz4cSTDqU+XtIukPSLitaxqMjOzLTdo5KQN07O+W+4h11uvmnfx7cXGj4RuoY1HY0saIalZUnNra2unFNdZ7rvvPgYNGrThq66ujlmzZlW7LDOzqqtmQJXqeyr5cKqIuD0imiKiqb6+7OgYNeW8885j1qxZzJo1i3vvvZfGxkYGDRpU7bLMzKqumgHVAvQtmG8AFleplq22YMECBgwYwMUXX8xBBx3EySefzMqVKzfrGBMmTGD48OEZVWhmVluqeZv5ZOBySfcDRwNvVeL605lX/HCrC2vLpHGXtLv+pZdeYsKECdxxxx2cffbZTJo0iddee4377rtvk22PO+44brnllo2WTZw4kUceeaSiNZuZ1arMAkrSBGAI0EdSC/BVoAdARPwQmAKcBswHVgCfyaqWztKvX78N3XNHHHEECxYs4Prrr2fUqFFl93322WfZbrvtGDhwYNZlmpnVhCzv4mu3ryq9e++yrM5fDb169dow3a1bN1auXMnNN9/coRbU/fff7+49M7MCXWIkiULluuE626hRo8q2oNatW8eDDz7ItGnTOqkqM7P882CxOTBt2jQaGhrYZ599ql2KmVludLkWVLU0Njbyxz/+e1Snq666qsP7DhkyhOnTp2dRlplZzXILyszMcskBZWZmueSAMjOzXHJAmZlZLjmgzMwslxxQZmaWSw6oGjRkyBCam5urXYaZWaYcUGZmlksOqApZvnw5H/7whzn00EMZOHAgEydO5IYbbuDII49k4MCBjBgxgmT4waQFNHLkSI477jgGDBjAjBkz+NjHPkb//v25/vrrgeTxHQcccAAXXHABhxxyCGeddRYrVqzY5LyPP/44xx57LIcffjgf//jHefvttzv1dZuZZaXLjSRx0Z3ZdX3deVFTm+t+9atfseeee/KLX/wCgLfeeouTTjqJ0aNHA/DJT36SR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nj03DqA1wPnBgRh5OE2Jcq81LNOpeHOjLbOsNJHrUCyUDBw4FfdGC/yRGxso11j6TrVkqaSjIYZ0ef1XUMcCDwu3SIop7AMx3c1yxXHFBmW0jS7iSDZQ6UFCRP+A1gSgd2X97OuuJ+9yAZe7Cwx6OtR90L+HVEDO9ADWa55i4+sy13FvDjiNg7HUW7L8l1p3XAjgXb/bNovpxhknqnATgEmAEsBA6U1EvSziQjuZc6/nRgsKT9IHlOUjpKtlnNcUCZbbnhwM+Klk0iuZtvraTnJY0EppKEyyxJ53TguL8n6SacDnw9IhZHxCLgAWA2ycMDnyvY/nbgl5KmRkQr8GlggqTZ6TEO2OJXaFZFvovPzMxyyS0oMzPLJQeUmZnlkgPKzMxyyQFlZma55IAyM7NcckCZmVkuOaDMzCyX/j//3KWNzUkRYQAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"n = 7\n",
"cdf = cdf_thrice.Max(n*6)\n",
"thinkplot.Cdf(cdf, label='n=%s'%n)\n",
"\n",
"sample_max = [max(cdf_thrice.Sample(42)) for i in range(1000)]\n",
"thinkplot.Cdf(thinkbayes2.Cdf(sample_max), label='sample')\n",
"\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF',\n",
" title='Maximum of 6*n attributes')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Looks good.\n",
"\n",
"### Distribution of the minimum\n",
"\n",
"Now, to compute the minimum, I have to write my own function, because `Cdf` doesn't provide a `Min` function."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"def compute_cdf_min(cdf, k):\n",
" \"\"\"CDF of the min of k samples from cdf.\n",
" \n",
" cdf: Cdf object\n",
" k: number of samples\n",
" \n",
" returns: new Cdf object\n",
" \"\"\"\n",
" cdf_min = cdf.Copy()\n",
" cdf_min.ps = 1 - (1 - cdf_min.ps)**k\n",
" return cdf_min"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we can compute the CDF of the minimum attribute for `n` players, for several values of `n`."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XuYXVWd5vHvm5ALEK5JQEgCFRQawi2YAi+0AoJNEoRIwwjRjMiADD2gEBTENg0RmkHBGYWWaSdEGkHlGoVowwhtaMVLIAUIEq4xBlIEJQmJSu6V+s0fe1c8VKrqVCp71dkn9X6ep56cs/c+a//qpOq8tdbZZy1FBGZmZmXTr9YFmJmZdcQBZWZmpeSAMjOzUnJAmZlZKTmgzMyslBxQZmZWSg4oqzlJ35L0T0UfWyaSjpb0sqS3JH201vUUSdJ8Scfmt6dL+m6NS7JthAPKkpG0SNJ6ScPabf+NpJDUABAR50fE1d1pc0uOLZmrgG9GxJCIuK+jAySdKel5Sask/U7SB9rtvzVVcZI+JekX7c8n6Z+rPTYiDo6I/yyghmMlNW9tO7btcEBZar8HJrfdkXQosH3tyqmZfYH5ne2U9GHgq8DZwE7AB4GFynxL0r75cUMlzZC0Y28U3RVJ29W6BtvGRYS//JXkC1gETAPmVWz7GvAlIICGfNutwD/nt48FmoHPAW8ArwNnVzy+o2Mvqzj2o8BE4CXgTeAfO3ps5ePb1Xsp8AywCvg2sCfwIPAX4D+A3br4fj8NLMjPOxvYO9/+O6AVWAO8BQzq4LG/As7ppN1989p/B9wNHJZv/xTwi/w5XUH2x8CELuq7PG/jL8BzwKn59oOAtcDGvL6VwHnABmB9vu1HFc/RF/LnaB2wXb7thHz/dOBe4K78PE8Ch1fUEMC72v+fADvmz09rfr63gL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xI/FWaFcw/KbOt8lGxNrZeANyW9m2zS3UcjYmxEfJVsAtO78vt35Y8bB0yKiI930OZhZEu3vA+4QtLenZ08Im4km3rmuDychgHTgBMi4t1kIXZJMd+qWe/yVEdmW2cy2VIrkE0UPBn49248bnZErOlk3/35vjWSHiGbjLO7a3W9FxgD/DKfomgg8OtuPtasVBxQZj0kaSjZZJmHSAqyFX4DeKAbD1/Vxb724+5BNvdg5YhHZ0vdC3g4IiZ3owazUvMQn1nPnQ7cFhH75rNojyJ736kV2KniuL+0u1/NJEmD8wA8FpgHvAKMkTRI0i5kM7l31P5c4GhJ74JsnaR8lmyzuuOAMuu5ycAP222bRXY1X4ukpyVNBR4hC5ffSDqjG+0+TjZMOBe4OiKWRMRi4G7gGbL/6XGHAAAAU0lEQVTFA5+qOH4G8KCkRyJiKfAp4A5Jz+RtHNjj79CshnwVn5mZlZJ7UGZmVkoOKDMzKyUHlJmZlZIDyszMSskBZWZmpeSAMjOzUnJAmZlZKf1/cR9D1564TLUAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"for n in range(2, 10, 2):\n",
" cdf_min = compute_cdf_min(cdf_thrice, n*6)\n",
" thinkplot.Cdf(cdf_min, label='n=%s'%n)\n",
"\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF',\n",
" title='Minimum of 6*n attributes')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And again we can check it by comparing to simulation results."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAHjV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XShqzoU1+3O8BLWRXlf52XsOLEXG0pA8CXyX7Q9ungDMi4uWCXwqzqvMIyqx7Pkx2T60ngD9LOpjsoru/jYjREfEtsguY3pwv35zvdwgwPiI+VqbPA8lu3fIu4GJJgzs6eERcRXbpmaPzcBoIXAR8ICIOJguxz1fnqZr1LF/qyKx7JpDdagWyCwVPAP6zC/vNiIjVHWybnm9bLWkW2cU4u3qvrsOBkcAD+SWK+gAPdnFfs6Q4oMy2kqQBZBfLPEBSkN3hN4CZXdj9lU62tZ93D7JrD5bOeHR0q3sBv46ICV2owSxpnuIz23onADdGxN75VbSHkn3utB7YpaTd39otVzJeUr88AMcAc4FngJGS+krajexK7uX6nwMcKeltkN0nKb9KtlndcUCZbb0JwC/arbud7Gy+1yU9KulzwCyycHlE0kld6Pd/yKYJ5wBfi4gVEbEcuAVYQHbzwIdL2l8D3CVpVkS0AacDUyUtyPt4+1Y/Q7Ma8ll8ZmaWJI+gzMwsSQ4oMzNLkgPKzMyS5IAyM7MkOaDMzCxJDigzM0uSA8rMzJL0v4XMuTVdV6jRAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"n = 7\n",
"cdf = compute_cdf_min(cdf_thrice, n*6)\n",
"thinkplot.Cdf(cdf, label='n=%s'%n)\n",
"\n",
"sample_min = [min(cdf_thrice.Sample(42)) for i in range(1000)]\n",
"thinkplot.Cdf(thinkbayes2.Cdf(sample_min), label='sample')\n",
"\n",
"thinkplot.decorate(xlabel='Attribute',\n",
" ylabel='CDF',\n",
" title='Minimum of 6*n attributes')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For efficiency and conciseness, it is helpful to precompute the distributions for the relevant values of `n`, and store them in dictionaries."
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0.23288163935889017 0.23288163935889017\n",
"0.28826338107405935 0.2882633810740594\n",
"0.31794402625472684 0.3179440262547268\n",
"0.32955796250238156 0.32955796250238156\n",
"0.32871475364520075 0.3287147536452008\n",
"0.3195146933518256 0.3195146933518255\n",
"0.3049352170780888 0.30493521707808885\n",
"0.2871203018328896 0.28712030183288956\n",
"0.2675970126720095 0.2675970126720096\n"
]
}
],
"source": [
"like_min = {}\n",
"like_max = {}\n",
"\n",
"for n in range(2, 11):\n",
" cdf_min = compute_cdf_min(cdf_thrice, n*6)\n",
" like_min[n] = cdf_min.MakePmf()\n",
" cdf_max = cdf_thrice.Max(n*6)\n",
" like_max[n] = cdf_max.MakePmf()\n",
" print(like_min[n][5], like_max[n][16])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The output shows that the particular data we saw is symmetric: the chance that 16 is the maximum is the same as the chance that 5 is the minimum.\n",
"\n",
"### Probability of different players\n",
"\n",
"Finally, we need the probability that the minimum and maximum are held by the same person. If there are `n` players, there are `6*n` attributes.\n",
"\n",
"Let's call the player with the highest attribute Max. What is the chance that Max also has the lowest attribute? Well Max has 5 more attributes, out of a total of `6*n-1` remaining attributes.\n",
"\n",
"So here's `prob_same` as a function of `n`."
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2 0.45454545454545453\n",
"3 0.29411764705882354\n",
"4 0.21739130434782608\n",
"5 0.1724137931034483\n",
"6 0.14285714285714285\n",
"7 0.12195121951219512\n",
"8 0.10638297872340426\n",
"9 0.09433962264150944\n",
"10 0.0847457627118644\n"
]
}
],
"source": [
"def prob_same(n):\n",
" return 5 / (6*n-1)\n",
"\n",
"for n in range(2, 11):\n",
" print(n, prob_same(n))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The update"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's a class that implements a likelihood function that computes all three parts: the chance that the maximum is 16, the minimum is 5, and they are held by different people."
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"class Dungeons(Suite):\n",
" \n",
" def Likelihood(self, data, hypo):\n",
" \"\"\"Probability of the data given the hypothesis.\n",
" \n",
" data: lowest attribute, highest attribute, boolean\n",
" (whether the same person has both)\n",
" hypo: number of players\n",
" \n",
" returns: probability\n",
" \"\"\"\n",
" lowest, highest, same = data\n",
" n = hypo\n",
" \n",
" p = prob_same(n)\n",
" like = p if same else 1-p\n",
" \n",
" like *= like_min[n][lowest]\n",
" like *= like_max[n][highest]\n",
"\n",
" return like"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's the prior we computed above."
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"7.0008681450402"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAGBBJREFUeJzt3Xu0XnV95/H3xyCg0iKU1FFuCRIV1FHaiDp2lBZUrAquLlRoUZziMFajVqVdqBSV0hkv9TIucIRRhFIHRLylThCpgNpRIAGUm0VjRIhQiYJaLiKB7/yxd/Dh8STnHMjm+SXn/VrrrLMvv73392w455Pffn7P70lVIUlSax4y6QIkSZqKASVJapIBJUlqkgElSWqSASVJapIBJUlqkgEl9ZKcneSwAc9fSXbvlz+a5G820nl3SXJrknn9+gVJXr0xzt2fb9D7Iq3PFpMuQBpKkmuBRwF3A7cBy4DXV9WtU7Wvqhc8WLVV1Wtm0q7/GV5dVf+8gXNdB2yzMepK8k5g96o6dOT8D9p9kUbZg9Lm7sVVtQ3we8DTgKPHG6Rzv38XkkzsH3qTvLY0NANKc0JV/Qg4G3gS3PsY7O+S/D/gdm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r/G/gC0kupvvDvL7ezYZcQxckjwJeU1W/TPIxuseAl/Y9szVM8xHbVXVjkrcC59P1YpZV1Uw+EuGbdDNVPxn4GvC5sf1fAl6T5PK+1gvH9p8JPLWqbunruDrJ0cCX+9C7C3gd8MOx436L7t5t3df7G4NQpPvD2cylzUD/+O7IqnrRAzjHF4EPVtVXNlph0gPgIz5pjkvyyCTfBe4wnNQSe1CSpCbZg5IkNcmAkiQ1yYCSJDXJgJIkNcmAkiQ16f8D+//oyijTwdUAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"suite = Dungeons(prior)\n",
"thinkplot.Hist(suite)\n",
"thinkplot.decorate(title='Prior distribution',\n",
" xlabel='Number of players',\n",
" ylabel='PMF')\n",
"suite.Mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And here's the update based on the data in the problem statement."
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.08548474490284352"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"suite.Update((5, 16, False))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here's the posterior."
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6.940862784521087"
]
},
"execution_count": 20,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEYCAYAAAAJeGK1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAF/ZJREFUeJzt3X20XXV95/H3xyCgUhGa1FGeEkpUGB2lE1HHjtKCGqsFVxcoTFGc4jBWo1alXagUkNoZH+p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qJPsJg7rZPDW1bS3fLu5t0dNuhffcOLT8wtP4AD/0ZGp03rIAAb6qqC4Z3JNmfwQhqnEz5HYw37vyj5zwQeF5V3Z3kEgajPBh8gOQ7gX/hV9clwJlV9Y4x5/pFF4RU1dok+zEIsMOARcDvP8zvQXqQIyjNOFW1BjiXwQMH69zMYLQAg88XevTDOPShSR7VvS+1J4PbXhcAf9p9HAtJnjKNDx68HHhhktndez6HA5dO4/z7JZnXvff0KuCfR/bvCNzRhdPTgOeu21GDj/XYDfhvDEZfMPg48EOS/FZX+85J9hg9afc5aDvWYHLkPwOeNY1apSk5gtJM9UEG/9Jf5/8CX0pyBYNfzOsb3WzIjQyC5InA66vqF0k+weA24FXdyGw1U3zEdlXdluQdwMUMRjFLqmo6H4nwLQYzVT8D+DrwDyP7vwK8Psk1Xa2Xjew/F3hWVd3R1XFDkuOAr3ahdx/wRuCHI/1+g8G1276r99ceQpEeDmczl7YC3e27Y6rq5ZtwjC8DH66qr222wqRN4C0+aYZL8oQk3wPuMZzUEkdQkqQmOYKSJDXJgJIkNcmAkiQ1yYCSJDXJgJIkNen/A5h74b1IJWf6AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"thinkplot.Hist(suite)\n",
"thinkplot.decorate(title='Prior distribution',\n",
" xlabel='Number of players',\n",
" ylabel='PMF')\n",
"suite.Mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For these data, the posterior is not very different from the prior. The mean is slightly lower, which means that these data suggest there might be fewer than the usual number of players."
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2 0.0005007044860801899\n",
"3 0.006177449626400222\n",
"4 0.03402191676923564\n",
"5 0.10823000113979396\n",
"6 0.21684925990462958\n",
"7 0.2798371634966231\n",
"8 0.22697589141459001\n",
"9 0.10574761295351945\n",
"10 0.0216600002091279\n"
]
}
],
"source": [
"suite.Print()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Based on the data, I am 94% sure there are between 5 and 9 players."
]
},
{
"cell_type": "code",
"execution_count": 22,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(5, 9)"
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"suite.CredibleInterval()"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.937639928909156"
]
},
"execution_count": 23,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sum(suite[n] for n in [5,6,7,8,9])"
]
}
],
"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.5"
}
},
"nbformat": 4,
"nbformat_minor": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment