Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"metadata": {
"name": "",
"signature": "sha256:4b65b6a4ab321c13030ce4417c6d415b030ee0736e7758b9752b998020c8ebcf"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"import random\n",
"import matplotlib.pyplot as plt\n",
"import matplotlib\n",
"%matplotlib inline"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"def random_sum(sampler, count):\n",
" return sum(sampler() for i in range(count))\n",
"\n",
"def random_xor(sampler, count):\n",
" return reduce(lambda a,b: a^b, (sampler() for i in range(count)))\n",
"\n",
"def sample_sum(samples):\n",
" return sum(samples)\n",
"\n",
"def sample_xor(samples):\n",
" return reduce(lambda x, y: x^y, samples)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 181
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"count = 100000\n",
"n = 10\n",
"max_value = 2**8-1\n",
"sampler = lambda: random.randint(0, max_value)\n",
"samples = [[sampler() for i in range(n)] for i in range(count)]\n",
"standard_samples = [sample_sum(sample) for sample in samples]\n",
"mod_samples = [sample_sum(sample) % max_value for sample in samples]\n",
"xor_samples = [sample_xor(sample) % max_value for sample in samples]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 182
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"plt.hist(standard_samples);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEACAYAAABCl1qQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFBVJREFUeJzt3W+MXfWd3/H3JzFQdoOCrEQGDAGkdVS8SgW1iiMluzsR\nW2qeACtFwVRFqLFWq5CGKH3QxXlQJq20DZWyLFEFT5Yshu26oEUhbEMIBnH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V//x74JsPLSseTXALQTiHfbqtPn6PLW201OZexH2n1y6fV\nV8WcVNXb1QB/yelLjqt6LpKcxzAoHquqp1p5TR4XI3Px11NzsRTHxbiHxfeBTUmuSnI+cBvw9DL3\naVEl+a0kF7X2bwM3AvsYjvvOttqdwNQL5mlge5Lzk1wNbGJ442o1OaexV9Ux4N0kWzP8PSl3jGyz\norVvilP+iOGxAat4Llq/Hwb2V9VfjCxac8fFmeZiSY6L5b67fxZ3/29ieMf/ELBzufuzBOO9muFP\nL7wK/HBqzMB64HngdeA54OKRbb7c5ucA8C+WewzzHP9uhp/i/38M71f967mMHdjSXjCHgK8v97gW\naC4+y/BG5GvAD9qLe8Nqnwvgk8Cv2mvilfbYthaPizPMxU1LcVz4oTxJUte4X4aSJI0Bw0KS1GVY\nSJK6DAtJUpdhIUnqMiwkSV2GhSSpy7CQJHX9fykwtiKvOoXuAAAAAElFTkSuQmCC\n",
"text": [
"<matplotlib.figure.Figure at 0x112432710>"
]
}
],
"prompt_number": 183
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The sum of independent random variables approaches a normal distribution due to the [central limit theorem](http://en.wikipedia.org/wiki/Central_limit_theorem)."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"plt.hist(mod_samples);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEACAYAAACpoOGTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFAZJREFUeJzt3H/MneV93/H3B2yCUzthKJL5meKtRsUdWxLSONOSxVVT\n5nQdUKkCIw2xxqrUuSlZJ2WxM2mQfzKSqWqpKpC2QrGzxq3XZAwU5OJQjhqpDV4WSAjGA6Y5w05t\nWgiQZD9qj+/+OJfjE/fyD85z/JznOX6/pCNf5zrXfb7X9dw89+e57/scUlVIknS8c6Y9AUnSwmRA\nSJK6DAhJUpcBIUnqMiAkSV0GhCSp66QB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Ykrw5yYrW/hHgWuAphmu6tQ27\nFXig/w6LxonW8yCwIcl5SVYBqxl+MXJRab90R/08w30Ii3B9SQLcC+ypqt8ceWnR78MTrW1W9l+S\ntx29PJZkGfAzwBNMct9N+y78adyl/xDDTx88D2yZ9nzmuJZVDD9F8CTwzaPrAS4EvgQ8CzwCXDDt\nub6BNW1n+A34v2J4v+gXT7Ye4BNtX+4F/uG05z/G+j4MbAO+AXy9/fKtXMTrex/wevtv8on2WD8L\n+/AEa/vQrOw/4Grga2193wA+1vontu/8opwkqWuhX2KSJE2JASFJ6jIgJEldBoQkqcuAkCR1GRCS\npC4DQpLUZUBIkrr+PzJD54A/+dzXAAAAAElFTkSuQmCC\n",
"text": [
"<matplotlib.figure.Figure at 0x10e85a4d0>"
]
}
],
"prompt_number": 184
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" The distribution of the modulo sum of random variables can become uniform again due to boundary conditions of a sort that are removed due to the modulo operation. See <http://emmettmcquinn.com/blog/> for more."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"plt.hist(xor_samples);"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEACAYAAACpoOGTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE/JJREFUeJzt3H+s3fV93/HnK9gOpHZiWZHML6d4q1FxxZqULc60ZHGV\njjrViok0gZHKWGNF6tyWrJOy2pk0yD8ZZKpSqgmkrhBMtrj1mowRBbk4lKNFWsFLA4mD8bCnucNO\nbSpIIMl+9Fq898f53vjU/fgH51zf773Hz4d0dT/n8/18v5/P536uz+t+v9/zdaoKSZJO95a+ByBJ\nWpgMCElSkwEhSWoyICRJTQaEJKnJgJAkNZ01IJI8lOREkv0jdf8myQtJvpnkS0neMbJtR5JDSQ4m\nuXGk/oYk+7tt943UvzXJH3T1Tyf58bmeoCRpPOc6g/gcsOm0uieAn6qqnwZe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X4KYLngG/PzgdYBXwVeBF4AljZ91jfxJx2MXwC/i8Z3i/65bPNB/hk\nt5YHgZ/ve/xjzO+jwCPAt4Bvdv/4Vi/i+b0feKP7nXy2+9o0DWt4hrl9eFrWD7ge+EY3v28Bn+jq\n52ztfFBOktS00C8xSZJ6YkBIkpoMCElSkwEhSWoyICRJTQaEJKnJgJAkNRkQkqSm/w8alay1gTG4\nsgAAAABJRU5ErkJggg==\n",
"text": [
"<matplotlib.figure.Figure at 0x112a731d0>"
]
}
],
"prompt_number": 185
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"XOR is a common simple technique to combine entropy [(see here for more)](https://tools.ietf.org/html/rfc4086#section-5.1)."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment