Skip to content

Instantly share code, notes, and snippets.

@Paddy3118
Created January 12, 2019 18:19
Show Gist options
  • Save Paddy3118/b4a00131a7ee4dfddb3a7cec75710e55 to your computer and use it in GitHub Desktop.
Save Paddy3118/b4a00131a7ee4dfddb3a7cec75710e55 to your computer and use it in GitHub Desktop.
Create an N-faced fair die from throwing an M-faced one.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"toc": "true"
},
"source": [
"# Table of Contents\n",
" <p><div class=\"lev1 toc-item\"><a href=\"#Create-an-N-sided-die-from-an-M-sided-die\" data-toc-modified-id=\"Create-an-N-sided-die-from-an-M-sided-die-1\"><span class=\"toc-item-num\">1&nbsp;&nbsp;</span>Create an N-sided die from an M-sided die</a></div><div class=\"lev2 toc-item\"><a href=\"#What-does-fair-mean?\" data-toc-modified-id=\"What-does-fair-mean?-1.1\"><span class=\"toc-item-num\">1.1&nbsp;&nbsp;</span>What does fair mean?</a></div><div class=\"lev1 toc-item\"><a href=\"#A-six-sided-die-simulation\" data-toc-modified-id=\"A-six-sided-die-simulation-2\"><span class=\"toc-item-num\">2&nbsp;&nbsp;</span>A six-sided die simulation</a></div><div class=\"lev2 toc-item\"><a href=\"#How-good-is-the-simulation?\" data-toc-modified-id=\"How-good-is-the-simulation?-2.1\"><span class=\"toc-item-num\">2.1&nbsp;&nbsp;</span>How good is the simulation?</a></div><div class=\"lev1 toc-item\"><a href=\"#Smaller,-(or-equal),--die-from-larger\" data-toc-modified-id=\"Smaller,-(or-equal),--die-from-larger-3\"><span class=\"toc-item-num\">3&nbsp;&nbsp;</span>Smaller, (or equal), die from larger</a></div><div class=\"lev2 toc-item\"><a href=\"#die4from6-Tests\" data-toc-modified-id=\"die4from6-Tests-3.1\"><span class=\"toc-item-num\">3.1&nbsp;&nbsp;</span>die4from6 Tests</a></div><div class=\"lev1 toc-item\"><a href=\"#Larger-die-from-smaller\" data-toc-modified-id=\"Larger-die-from-smaller-4\"><span class=\"toc-item-num\">4&nbsp;&nbsp;</span>Larger die from smaller</a></div><div class=\"lev2 toc-item\"><a href=\"#Multiple-throws\" data-toc-modified-id=\"Multiple-throws-4.1\"><span class=\"toc-item-num\">4.1&nbsp;&nbsp;</span>Multiple throws</a></div><div class=\"lev2 toc-item\"><a href=\"#Creating-die13-from-die6\" data-toc-modified-id=\"Creating-die13-from-die6-4.2\"><span class=\"toc-item-num\">4.2&nbsp;&nbsp;</span>Creating die13 from die6</a></div><div class=\"lev2 toc-item\"><a href=\"#Check-die13from6-created-from-die6-thrown-twice\" data-toc-modified-id=\"Check-die13from6-created-from-die6-thrown-twice-4.3\"><span class=\"toc-item-num\">4.3&nbsp;&nbsp;</span>Check die13from6 created from die6 thrown twice</a></div><div class=\"lev1 toc-item\"><a href=\"#Lets-generalise-to-n-from-m\" data-toc-modified-id=\"Lets-generalise-to-n-from-m-5\"><span class=\"toc-item-num\">5&nbsp;&nbsp;</span>Lets generalise to n from m</a></div><div class=\"lev2 toc-item\"><a href=\"#Check-die5_6-created-from-Die_n_from_m(5,-6)\" data-toc-modified-id=\"Check-die5_6-created-from-Die_n_from_m(5,-6)-5.1\"><span class=\"toc-item-num\">5.1&nbsp;&nbsp;</span>Check die5_6 created from Die_n_from_m(5, 6)</a></div><div class=\"lev2 toc-item\"><a href=\"#Check-die-created-from-Die_n_from_m(17,-6)\" data-toc-modified-id=\"Check-die-created-from-Die_n_from_m(17,-6)-5.2\"><span class=\"toc-item-num\">5.2&nbsp;&nbsp;</span>Check die created from Die_n_from_m(17, 6)</a></div><div class=\"lev2 toc-item\"><a href=\"#Check-die-created-from-Die_n_from_m(10,-3)\" data-toc-modified-id=\"Check-die-created-from-Die_n_from_m(10,-3)-5.3\"><span class=\"toc-item-num\">5.3&nbsp;&nbsp;</span>Check die created from Die_n_from_m(10, 3)</a></div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create an N-sided die from an M-sided die\n",
"This is all about fair dice simulations. \n",
"\n",
"## What does fair mean? \n",
"For the purposes of the simulation, a fair, X-sided die has equal probability of producing the numbers 1-to-N, inclusive, on a simulated roll.\n",
"\n",
"# A six-sided die simulation"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Help on method randint in module random:\n",
"\n",
"randint(a, b) method of random.Random instance\n",
" Return random integer in range [a, b], including both end points.\n",
"\n"
]
}
],
"source": [
"from random import randint \n",
"\n",
"help(randint)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"def die6():\n",
" return randint(1, 6)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## How good is the simulation?\n",
"I'll not go as far as Chi-squared tests, just show a histogram and summary data from rolling (calling) the die a few times"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Series.describe: \n",
" Generates descriptive statistics that summarize the central tendency,\n",
" dispersion and shape of a dataset's distribution, excluding\n",
" ``NaN`` values.\n"
]
}
],
"source": [
"from pandas import Series\n",
"from collections import Counter\n",
"from pprint import pprint as pp\n",
"import matplotlib.pyplot as plt\n",
"\n",
"count = 500_000 # Sample count\n",
"samples = Series(Counter(die6() for x in range(count)))\n",
"\n",
"print('Series.describe:', '\\n'.join(samples.describe.__doc__.split('\\n')[:4]))"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 83239,\n",
" 2: 83387,\n",
" 3: 83948,\n",
" 4: 83327,\n",
" 5: 83092,\n",
" 6: 83007}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEICAYAAAB/Dx7IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLC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Tn19GF+Tjrmvaq4BvllLuqc/HWdfJwB2llHtLKT8FPgu8iAk5voZiWH0udGcEt9P9lpvusD9uFP07PLGP+4/Z9kLIH9XhV7PthZBr6/j96foL96uPO4D967R/qvNOXwg5tWdNAS4Gzpsxfqy1AQcBy+rwXsBXgdPozowGL9S8pQ6/lW0v1Fxah49j2ws1t9NdpNmp/Q68lMcvTo69Jrqzs6UDw/9IdwfBJBxjXwWOrsPn1prGXldd9lPAb0zCcU93Decmums6obuo+7ZJOL6G9Rh2oJ5KdzfFbcA5Iym460O7G/gp3W++N9P1R32Z7jafLw/s8AB/Weu5AVg10M5v0t3Kc+uMA24V3S1EtwF/Qf9btV5M9+fSt3n81qhTx10b8It0t9x9uy77X+r4lXRX62+tB/Sedfzi+vzWOn3lQFvn1HXfwsCV/Z3Z72wb3GOvqdbwLR6/ffKcOn4SjrHnAlN1X/4tXcBNQl17A/cB+w6MG/dx/z662yZvBD5GF75jP76G9fAj75LUGD85KUmNMbglqTEGtyQ1xuCWpMYY3JLUGINbkhpjcEtSY/4/Y+wKipEfqCMAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"def show_me(values):\n",
" print(\"Map then graph rolled numbers to their frequencies:\")\n",
" pp(dict(values), width=20)\n",
" #print(\"\\nSummary stats:\")\n",
" #print(Series(list(Counter(dict(values)).elements())).describe())\n",
" values.sort_index(ascending=False).plot.barh(title=\"Frequencies of rolled numbers\")\n",
" plt.show()\n",
"\n",
"show_me(samples)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Well, that looks good enough."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Smaller, (or equal), die from larger\n",
"That's easy. Lets say we want to make a four sided die from the six sided one; all we do is select the first four possibilites from from the six sided die throws as valid outputs. If a five or a six is thrown by `die6` then throw again until it gives a `1` to `4` then return that number. We know that all the numbers from `die6` have the same probability of occuring **on _any_ throw**"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"def die4from6():\n",
" while True:\n",
" thrown = die6()\n",
" if 1 <= thrown <= 4:\n",
" return thrown"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## die4from6 Tests"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 124766,\n",
" 2: 124725,\n",
" 3: 125224,\n",
" 4: 125285}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEICAYAAAB/Dx7IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAErBJREFUeJzt3XmwJVVhx/Hvzxl2CIsgNTDIgAoKmoiZiiLGEERBQDGVSgkuBRFDElNGoyWCWBXUWK4xxDIRCRJEFMU9wQ0iThSj4BsXFgeUfRUYkD0awJM/+jzoebzlvuH1m3fg+6m6NX1Pd58+p8+9P/qevveRUgqSpHY8bl03QJI0Owa3JDXG4JakxhjcktQYg1uSGmNwS1JjDG4NLsndSXaex+Ntm+Q7Se5K8o9zUN/hSc7tPS9JnryWda31vnMpyYokr13X7dDaWbyuGyBIchWwLfBAr3iXUsoN66ZFc6uUsuk8H/JIYDXwO8UfKuhRyCvuheMlpZRNe4+HhXYS/0M7mh2Bn40a2kkWDdyeR610zJF55glfwJIsqx+tj0hyDXBOLX9Okv9JcnuSnybZu7fPTkn+u04TnJ3kI0lOq+v2TnLdhGNclWTfuvy4JEcnuTzJrUnOSLLVhLYcluSaJKuTHNurZ1GSt9V970qyMskOdd2D0wNJNkjywVrHTUlOSLJRXbd1kjNrv25L8t2pQiHJc5P8MMkd9d/n1vJTgMO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u2BTgVOH5C+QdY8+bI++vygax5A+b8Wr4V3bzslvVxJbBVXffDuu34DZgDBu7T3jx0c/JzrHnD5HV1+W9Y84bJGXV5d9a8KXMF3Q2ZeR1D4LvArnX5uDoezY0J8GzgYmDjeqxPAK9vaVx4+Bz34OMw1TEG6Mv+wM+AbSZsN+vzPdsxHey9M8eDfwDdNzYuB44dsuGzbNfz6D62XAD8pD4OoJuD+hbwi/rv+AstwL/UflwILO/V9Rrgsvr48175cuCius9HGPDGRD3e3jwU3DvT3bm/rL6wNqjlG9bnl9X1O/f2P7a29VJ637aYzzEEngmM1XH5cn3DNzkmwDuAS+rxPlnDoIlxAU6nm5u/j+7K8Yj5GIepjjFAXy6jm38ef++fsLbne23GdIiHP3mXpMb4y0lJaozBLUmNMbglqTEGtyQ1xuCWpMYY3JLUGINbkhrz/1YflaXpsrl8AAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"samples = Series(Counter(die4from6() for x in range(count)))\n",
"show_me(samples)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"That looks good again."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Larger die from smaller\n",
"\n",
"That's a little more involved. Lets first take a concrete case of creating a thirteen-sided die from a six sided die.\n",
"\n",
"## Multiple throws\n",
"If we throw the six sided die two times then there are `6*6 = 36` possible outcomes from the two throws. (We can keep the outcome order significant so a throw of `3` followed by a throw of `4` is distinct from a throw of `4` then a throw of `3`)."
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{(1, 1): 13733,\n",
" (1, 2): 13887,\n",
" (1, 3): 13904,\n",
" (1, 4): 13977,\n",
" (1, 5): 13970,\n",
" (1, 6): 14022,\n",
" (2, 1): 13891,\n",
" (2, 2): 13776,\n",
" (2, 3): 14051,\n",
" (2, 4): 13885,\n",
" (2, 5): 13966,\n",
" (2, 6): 13840,\n",
" (3, 1): 13751,\n",
" (3, 2): 14080,\n",
" (3, 3): 13848,\n",
" (3, 4): 13993,\n",
" (3, 5): 13707,\n",
" (3, 6): 13972,\n",
" (4, 1): 13879,\n",
" (4, 2): 13907,\n",
" (4, 3): 13741,\n",
" (4, 4): 13911,\n",
" (4, 5): 13720,\n",
" (4, 6): 13906,\n",
" (5, 1): 13817,\n",
" (5, 2): 14138,\n",
" (5, 3): 13929,\n",
" (5, 4): 14194,\n",
" (5, 5): 13797,\n",
" (5, 6): 14116,\n",
" (6, 1): 13779,\n",
" (6, 2): 13969,\n",
" (6, 3): 13774,\n",
" (6, 4): 13655,\n",
" (6, 5): 13723,\n",
" (6, 6): 13792}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEICAYAAABS0fM3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3XucXWV97/HPNwkkBDDcAhKSEAIJcglCjYiAAgEBFRGLoog1ID2UI6AtgkXjwWl7OFKBYjlaEYFCRASLFDxB5GpaqlxMBBLDRUgIkkRu0YSEKbfwO388z07WTGbvvfYw+5Lk+3695jV7r+tvr5nZa/Z6vut5FBGYmdmGa1C7CzAzs/byicDMbAPnE4GZ2QbOJwIzsw2cTwRmZhs4nwjMzDZwPhHYOknSSknjW7i/7ST9p6QVki4agO2dKOm/Cs9D0i793Fa/1x1IkmZK+st212GNG9LuAqw5JC0EtgNWFSZPjIgl7aloYEXEZi3e5SnAi8Dbwjff2HrGnwjWbx+JiM0KX2udBCT5n4FydgQeKXsSkDS4yfWst5T4vamFfLA3MJLG5UsJJ0v6PXB3nr6fpF9JWibpYUkHF9bZSdJ/5Msid0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ASToKeD4iZpeoq9a8Vv4shpA+Vn83IvYhDYBUq32o7TXn6+ofJV2OGEUaZ+ODNfbf9ppLaLTGltcuaRrwBvDDyqQqNbS1ZknDSQNyndvX7Co1tLTmTj4RLCJdU6sYDSxpUy0AKHWb/RPSR9Eb8+TnJFUG7tkeeD5Pr1Z/K1/XAcDRkhYC15EuD30L2EJpdLje+19dW54/Avhji2teBCyKiPvz8xtIJ4ZOPs6HAU9FxAsR8TpwI7A/nX2cKwbquC7Kj3tPb4rceHoUcELkayT9qPlFqv+MBtLOpH8SHs5/i6OB30h6ez9qbs5xHsjrjwP5RfrPcEE+gJUGnj3aWI+A6cC3ek2/gJ6Nbd/Mjz9Mz0agB/L0rUjXwLfMX08BW7Wg/oNZ01j8b/RsIPt8fnwaPRsxf5wf70HPRrgFNLex+B5g1/y4Kx/jjj3OwHuAecDwXMfVwBmdeJxZu41gwI4rqXfi/VjTiPmhJtV8JGmI25G9luvz+FHjvaTaz2iga+41byFr2gg64jg35Q95AH9pP0RK58wHprW5lgNJH8HmAA/lrw+RrjPeBTyRv1d+WAK+k2ufC0wubOtzwJP566QW1X8wa04E40nJgyfzH8LQPH1Yfv5knj++sP60/FoeZwBSCnVq3ZvUvfkcUjckW3b6cQb+DniM1K36D/KbUUcdZ+BHpDaM10n/WZ48kMcVmJxf/3xSZ5VqUs1Pkq6fV/4OL613/KjyXlLtZzTQNfeav5A1J4KOOM7uYsLMbAPXyW0EZmbWAj4RmJlt4HwiMDPbwPlEYGa2gfOJwMxsA+cTgZnZBs4nAjOzDdz/B2DHpqE8dG0GAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Number of distinct values from two throws is 36\n"
]
}
],
"source": [
"samples = Series(Counter((die6(), die6()) \n",
" for x in range(count)))\n",
"show_me(samples)\n",
"print(f'\\nNumber of distinct values from two throws is {len(samples)}')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Creating die13 from die6\n",
"We can make die13 by \n",
"\n",
"* throwing die6 twice; \n",
"* select and number the first 13 possibilites from the six sided die throws as valid outputs. \n",
" * If invalid possibilities are thrown then throw die6 __twice__ again until it gives a valid output, \n",
"* then return the number associated with that valid combination. \n",
"\n",
"We know that all the two-throw number combinations from `die6` have the same probability of occuring so those selcted for die13 should also occur with the same probability."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"First thirteen of possible die6 2-throws:\n",
" ((1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1))\n"
]
}
],
"source": [
"from itertools import product\n",
"\n",
"possible_2throws = tuple(product(range(1, 6+1), repeat=2))\n",
"assert set(samples.keys()) == set(possible_2throws), 'Does not check with last sim result of two throws, above'\n",
"\n",
"print(f'First thirteen of possible die6 2-throws:\\n {possible_2throws[:13]}')"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{(1, 1): 1,\n",
" (1, 2): 2,\n",
" (1, 3): 3,\n",
" (1, 4): 4,\n",
" (1, 5): 5,\n",
" (1, 6): 6,\n",
" (2, 1): 7,\n",
" (2, 2): 8,\n",
" (2, 3): 9,\n",
" (2, 4): 10,\n",
" (2, 5): 11,\n",
" (2, 6): 12,\n",
" (3, 1): 13}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"throws2output = {throw: n+1 for n, throw in enumerate(possible_2throws[:13])}\n",
"throws2output"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
"def die13from6():\n",
" while True:\n",
" thrown = tuple(die6() for _ in range(2))\n",
" if thrown in throws2output:\n",
" return throws2output[thrown]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check die13from6 created from die6 thrown twice"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 38260,\n",
" 2: 38376,\n",
" 3: 38480,\n",
" 4: 38427,\n",
" 5: 38356,\n",
" 6: 38558,\n",
" 7: 38590,\n",
" 8: 38550,\n",
" 9: 38869,\n",
" 10: 38408,\n",
" 11: 38473,\n",
" 12: 38299,\n",
" 13: 38354}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXkAAAEICAYAAAC6fYRZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGL5JREFUeJzt3X2cXVV97/HP1+EhJERCSOBCgozhSR5UoLlWRSkSLBgi2AdfYq82VG9Tq22letVQfJWo9VVaq6X3tpVaoAFRFFGqF4tNKqZIK9AJBJIYkBAChERCxIRAWh7Cr3/slbAzzJyZ2XvNPsPO9/16ndfs5/U7a5/zmz1r71lLEYGZmbXTy7odgJmZjR4neTOzFnOSNzNrMSd5M7MWc5I3M2sxJ3kzsxZzkreukvSkpBkNlneQpJslbZX0+QzHO0/SLaX5kHRExWNV3jcnSUsk/e9ux2F57NHtAKwzSWuBg4DtpcVHRcT67kSUV0Ts23CR84BNwMvD/yRiuwFfyb80vD0i9i29XpTgJfkX9vAcBvx4uAleUs8ox9NaKjjHdJlPwEuUpN705/37JT0E3JSWv17Sv0vaLOkuSaeW9nmlpH9NTRWLJf21pKvTulMlretXxlpJp6fpl0maL+l+ST+TdK2kyf1imSvpIUmbJF1YOk6PpD9K+26VtFTSoWndziYKSXtL+ot0jEclXSppn7RuiqQb0vt6XNIPB0sgkt4o6T8kbUk/35iWLwTmAh9PzUSnD7D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agPVohPFG2nl/RbPmbqskOMY6YuganApDS9D/BDYM5gxwU+xK43DK+tGnuGGA8u1fMlwMXd/t6kY53KCzdeu1aPTSXa2RRPFNwPXNhEmaWyZ6SKuAtYuaN8inav7wP3pZ87TrKAv0mxLgdmlo71PoobIKuB36oZ1zUUf6I/S/Hb+f05YwJmAivSPn9N+u/mDDF+OcVwN/Addk1UF6by7qX0VMJg5z+dm9tT7N8A9q4Q45so/ly9G1iWXrPHUl12iHHM1CXwGuDOFMsK4I87HRcYl+ZXp/UzqsaeIcabUj2uAK7mhSdwuvK9KR3rVF5I8l2rR3drYGbWYv6PVzOzFnOSNzNrMSd5M7MWc5I3M2sxJ3kzsxZzkjczazEneTOzFvtvB+PzAO3IKywAAAAASUVORK5CYII=\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"samples = Series(Counter(die13from6() for x in range(count)))\n",
"show_me(samples)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Lets generalise to n from m\n",
"Tidy global variables into a class and make its instances callable."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"class Die_n_from_m():\n",
" def __init__(self, n, m):\n",
" self.n = n\n",
" self.m = m\n",
" # Work out ho many die_m rolls will be needed\n",
" rollcount, possibilities = 1, m\n",
" while possibilities < n:\n",
" rollcount, possibilities = rollcount + 1, possibilities * m\n",
" self.rollcount = rollcount\n",
" #\n",
" possible_throws = tuple(product(range(1, m + 1), repeat=rollcount))[:n]\n",
" self.throws2output = {throw: n+1 for n, throw in enumerate(possible_throws)}\n",
"\n",
" def die_m(self):\n",
" return randint(1, self.m) \n",
"\n",
" def die_n(self):\n",
" while True:\n",
" thrown = tuple(self.die_m() for _ in range(self.rollcount))\n",
" if thrown in self.throws2output:\n",
" return self.throws2output[thrown] \n",
"\n",
" __call__ = die_n\n"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"d5_6 = Die_n_from_m(5, 6)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"d5_6()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check die5_6 created from Die_n_from_m(5, 6)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"scrolled": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 100063,\n",
" 2: 99908,\n",
" 3: 100384,\n",
" 4: 99886,\n",
" 5: 99759}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAW4AAAEICAYAAAB/Dx7IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAExFJREFUeJzt3X+UZ3V93/Hny+XHIhB+CHIWFllRMII2we5JQGxqEEURNec0PcFEA40JTdPTavVoIHpO0TQnpk2tzUkapGoRiSbGH9GSKNDgxpAoZDb+AFxQlJ+CwkrABauV9d0/7mfwMs7sfHcz39n57Dwf59wz93t/fO7ncz93XnO/997vfFNVSJL68bjdXQFJ0s4xuCWpMwa3JHXG4JakzhjcktQZg1uSOmNwa+qSPJTk2GXc3hFJPpVkW5L/ugTlnZvkmtHrSvLUXSxrl9ddSkk2Jfnl3V0P7Zq9dncFBEluA44Ato8mH19Vd++eGi2tqjpgmTd5HrAV+JHygwraA3nGvXK8pKoOGA0/FNpJ/EM7mWOAL04a2knWTLk+e6wMzJFl5g5fwZJsaG+tX5XkDuDqNv3kJH+b5IEkn0/y3NE6T07yV+0ywVVJfj/JZW3ec5PcNWcbtyU5vY0/Lsn5Sb6S5JtJPpD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F8yy6p/b/YlZEe5cyuO8Cjh69Xg/cvYTlL6skezOE9h9V1Yfb5G8kWdfmrwPubdMXavuOpq+fZ/pKcCrw0iS3AX/McLnk7cDBSWb/t824vo+2sc0/CLifnd8nK8VdwF1VdW17/UGGIF8NfQ9wOnBrVd1XVd8DPgw8m9XT/7OWo78X2sailjK4/w44rt193ofhRsXHlrD8ZdPu+r4L2FJVbxvN+hgwe7f4HIZr37PTf7HdcT4ZeLC99bkCeEGSQ9qZzAsYru/dA2xLcnLb1i+OytqtquqCqlpfVRsY+vDqqvoF4JPAz7bF5rZ9dp/8bFu+2vSz21MHTwaOY7hJs6KPk6r6OnBnkqe1Sc8Dvsgq6PvmDuDkJI9v9Ztt/6ro/5Hl6O+FtrG4Jb7AfybDExhfAd64u284/CPa8RyGtzNfAD7XhjMZrt39JfDl9vPQtnyAP2jtvh7YOCrrl4Bb2vCvRtM3Aje0dX6fOTfDVsIAPJcfPFVyLMMv3i3AnwL7tulr2+tb2vxjR+u/sbXvZkZPTqz04wT4cWCm9f+fMTwlsGr6HngzcFOr43sZngzZY/sfeD/D9fzvMZwhv2o5+nuhbUwy+JF3SeqMn5yUpM4Y3JLUGYNbkjpjcEtSZwxuSeqMwS1JnTG4Jakz/x9DsQZAR5TAQgAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"samples = Series(Counter(d5_6() for x in range(count)))\n",
"show_me(samples)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check die created from Die_n_from_m(17, 6)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 29751,\n",
" 2: 29224,\n",
" 3: 29494,\n",
" 4: 29372,\n",
" 5: 29534,\n",
" 6: 29077,\n",
" 7: 29438,\n",
" 8: 29573,\n",
" 9: 29817,\n",
" 10: 29182,\n",
" 11: 29079,\n",
" 12: 29364,\n",
" 13: 29690,\n",
" 14: 29256,\n",
" 15: 29399,\n",
" 16: 29558,\n",
" 17: 29192}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAGthJREFUeJzt3Xu8HWV97/HPlwAJCTEhBJAkQAiXCAkY6C5VUcpVECLR9rRAj56g1NSKVlsUo/iSVOurtIjieemRRkgBUQRRqgdEyZHGSMulOwgkGJBbgFxMCJgQSLkk+Z0/5kmcbPZel5m11t578n2/Xuu1Z808M8/vmVn7t2c/M/MsRQRmZjb47dTfAZiZWWs4oZuZVYQTuplZRTihm5lVhBO6mVlFOKGbmVWEE7r1K0kvSprUwfr2kbRQ0gZJl7Vge+dKujP3PiQdXHBbhddtJUkLJP1lf8dhzdu5vwOw2iQtA/YBNudmHxoRK/snotaKiN07XOUsYC3whvBDGFYxPkMfHN4dEbvnXq9L5pL8x7kxBwC/bjSZSxrS5ngqSxnnmA7yzh6kJE1M/6KfJ+lp4I40/y2S/lPSOkkPSDo+t86Bkn6RuhvmS/q6pOvSsuMlLe9RxzJJJ6fpnSTNlvS4pOck3ShpTI9YZkp6WtJaSRfltjNE0mfTuhskLZK0X1q2rZtB0lBJX07bWC3pCkm7pWVjJd2S2vW8pF/2lSwkvU3Sf0lan36+Lc2/GpgJXJi6ek7uZd2rJX1T0k8kvQScIGmUpGslPSvpKUmfayRR1WpPWv4pSaskrZT0wTrbWiDpi5L+I+3D2yWNbfDYzZH0fUnXpXUXSzpU0mckrZH0jKR39qjyIEn3pn34o63HOm2v1mdsgaQvSfoPYCMwSVm31BOp7icl/c96+84Kigi/BvALWAac3Mv8iUA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iJJs9K8fSJiFWQfVmDvNL+vNg7EtreqDePTdM/5/emjqfth3tauCZpv155kX3q+qcf8jkn/kh9FduZXiePVo00wyI+VpCGS7gfWkP3RfLxGLNviT8vXp9hbnjc6kdB766cbDPdKHhsRRwPvAs6XdFyNsn21cTC1vdk2DLS2fRM4CJgGrAIuS/MHVbsk7Q78APhERLxQq2gv8wZku3pp06A/VhGxOSKmARPIzqgPqxFLx9rViYS+HNgv934CsLID9ZYSESvTzzXAzWQHbXX615X0c00q3lcbB2LbW9WG5Wm65/x+ERGr0y/ZFuBbZMcLmm/XWrLui517zG87SbuQJb7vRMQP0+xBfbx6a1MVjtVWEbEOWEDWh95XLNviT8tHkXUZtj5vdOACws5kF2YO5Pcd/FPaXW/JmEcAI3PT/0nW930p21+g+uc0fQbbX6C6N80fAzxJdnFqjzQ9psNtmcj2Fw9b1gbgv1LZrRfZTu/Hdu2bm/5bsr5JgClsf+HpCbKLTn1+LoHvs/3FrY90oD0i69e+vMf8QXu8arRpsB+rvYDRaXo34JfA9L5iAc5n+4uiNxZtb93Y2t34FPjpZFe4Hwcu6kSdJeOdlHbiA8BDW2Mm6/f6OfBo+rn1F0XAN1L7FgNduW19kOxix2PABzrcjuvJ/qV9jeyv/nmtbAPQBSxJ63yd9ORxP7Xr2ynuB4Ef90gaF6UYHyF3Z0dfn8t0/O9N7f0+MLQDbXo72b/VDwL3p9fpg/l41WjTYD9WRwK/SvEvAT5fKxZgWHr/WFo+qWh767386L+ZWUX4SVEzs4pwQjczqwgndDOzinBCNzOrCCd0M7OKcEI3M6sIJ3Qzs4r4/2D6sU7rxq/oAAAAAElFTkSuQmCC\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"die = Die_n_from_m(17, 6)\n",
"samples = Series(Counter(die() for x in range(count)))\n",
"show_me(samples)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Check die created from Die_n_from_m(10, 3)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Map then graph rolled numbers to their frequencies:\n",
"{1: 50081,\n",
" 2: 49733,\n",
" 3: 50368,\n",
" 4: 50142,\n",
" 5: 49675,\n",
" 6: 50060,\n",
" 7: 49977,\n",
" 8: 50023,\n",
" 9: 49943,\n",
" 10: 49998}\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEICAYAAABPgw/pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAFkRJREFUeJzt3XuUZWV95vHvY3Nt6NA0t+GmLV4IoPEytVREGQWJiniZ21IzuiBx0pPRlejo0mB0jWgmK+bmkKxkgj3qIFGJ9zFDosKIHTVRSLVCaGyQiyDQSIvY2NDjBfzNH/ttPV1WV1edc/pUs+v7Weus2mff3vfdZ5+ndr1779qpKiRJD30PW+wKSJLGw0CXpJ4w0CWpJwx0SeoJA12SesJAl6SeMNC1aJLcl+S4CZZ3RJIvJNma5E/GsL5zknxp4H0lefSQ6xp62XFKsi7Jf1zsemg4ey12BbRzSW4BjgAeHBj92KratDg1Gq+qOnDCRa4B7gZ+obwBQz3kEfqe74VVdeDA6+fCPIm/mOfnEcDX5xvmSZbt5vr0Vjrmy4S5wR+Ckqxuf6K/Ksm3gMvb+Kcl+cckW5JcneRZA8s8Msnft+6Gy5L8eZIPtGnPSnL7jDJuSfKcNvywJOcmuSnJd5N8JMmqGXU5O8m3ktyd5C0D61mW5HfasluTrE9ybJv2026GJPsm+eO2jruSXJBk/zbt0CSXtHbdk+SLOwuLJE9P8k9J7m0/n97GXwicDbypdfU8Z5ZlL0zyl0n+Lsn9wLOTHJTkoiTfSXJrkrfOJ6jmak+b/sYkdybZlOT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Y2YZv0dIsjddmH+wqj7RRi+Jtg+qqi3AOro+0pVJth8YDdb5p+1s0w8C7mHh22VPcArwoiS3AH9N1+1yPkuj7VTVpvZzM90v8qewp+73E+h/2ovuBMAj+dkJj5MWu19sxDatZsc+9D9ixxMkf9iGX8COJ0iubONXAd+kOzlycBte1ab9U5t3+wmSMxe7va1eAS4Czp8xvvdtb3U7DFjZhvcHvgicBXyUHU8MvroNv4YdTwx+pA2fxI4nBm+mOyn4kPieAM/iZydFe9924ABgxcDwPwLP21P3+0ltlDPproq4CXjLYn9II7blYuBO4Md0v11fRdc/+DnghvZz+wcV4C9au68BpgbW82vAje31qwPjp4ANbZk/p93Nu9gv4Bl0fwr+M3BVe525FNre6vZLwNda+zcA/7WNP47uKoUbW8Dt28bv197f2KYfN7Cut7Q2Xs/AFQ0Phe8JOwZ679ve2nh1e127vW576n7vrf+S1BPeKSpJPWGgS1JPGOiS1BMGuiT1hIEuST1hoEtSTxjoktQT/x9VW3K/7qsD/AAAAABJRU5ErkJggg==\n",
"text/plain": [
"<Figure size 432x288 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
}
],
"source": [
"die = Die_n_from_m(10, 3)\n",
"samples = Series(Counter(die() for x in range(count)))\n",
"show_me(samples)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.8"
},
"nav_menu": {},
"toc": {
"navigate_menu": true,
"number_sections": true,
"sideBar": true,
"threshold": 6,
"toc_cell": true,
"toc_section_display": "block",
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment