Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG3ZJREFUeJzt3X2sZVdZx/Hfw7QVExASZ4xNZ8Zp4phY8YV6U0pITCMQ\np62Z+QPUNkEtApOgVQxEU9QUrH9YJEFFq9gA4UWhVDRkhMGGhBoSk9aZ8ibTWjKpxU4l6VCgaBDq\n6OMf55x2u2atvdfeZ7/v7yeZzD3nrLPP2vfc+5x1n/Wstc3dBQCYl2cM3QEAQPsI7gAwQwR3AJgh\ngjsAzBDBHQBmiOAOADNEcAeAGSK4A8AMEdwBYIYuGOqFd+/e7QcOHBjq5QFgku67776vuPueqnaD\nBfcDBw7o5MmTQ708AEySmX0ppx1pGQCYIYI7AMwQwR0AZojgDgAzRHAHgBmqDO5m9m4ze8zMvpB4\n3Mzs7WZ22sw+b2aXt99NAEAdOSP390g6VPL41ZIOrv8dlfTn23cLALCNyuDu7p+S9NWSJkckvc9X\n7pH0XDO7uK0OAsCcHLjpYzpw08c6f502FjFdIumRwu0z6/u+HDY0s6Naje61f//+Fl4aAKahGNAf\nvvXazl+v1wlVd7/d3XfcfWfPnsrVswAwebGR+lRG7o9K2le4vXd9HwAsVlkA72Pk3kZwPybpRjO7\nQ9ILJD3h7uelZABgCfoYleeoDO5m9kFJV0nabWZnJL1J0oWS5O7vkHRc0jWSTkv6pqRXdtVZABir\nOkH9wE0f63z0Xhnc3f36isdd0q+01iMAmJAmI/XZTagCwFxsU9I4lQlVAFiMNgLzVCZUAWD2xjJR\nmou0DACUCNMvD996be2Rdx8j9RDBHQAitsmphx8Am+P0GeRJywBAQRvpl9QxNvePohQSAJZgajn1\nKqRlACxa0/TLNiNvqmUAoANdjdIfvvXa0fwFQHAHsBhdB96xBHaJ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fblY0nvNbJdWH0B3uvtHbZoXsc85l18zs8OSzml1LjcM1tua+nxPWKEKADM05bQMACCB\n4A4AM0RwB4AZIrgDwAwR3AFghgjuADBDBHcAmCGCOwDM0P8BDv/PHbYjQPoAAAAASUVORK5CYII=\n",
"text/plain": [
"<matplotlib.figure.Figure at 0x110f3db38>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import random\n",
"\n",
"a1 = 1.0\n",
"a2 = 4.0\n",
"\n",
"xs = []\n",
"a = []\n",
"for i in range(100000):\n",
"\tan = a1 + (a2 - a1) * float(i) / 100000\n",
"\tx = random.random()\n",
"\tfor j in range(1000):\n",
" \tx = an * x * (1 - x)\n",
"\ta.append(an)\n",
"\txs.append(x)\n",
"\n",
"plt.plot(a,xs,\",\")\n",
"plt.show()"
]
}
],
"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.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.