Created
June 25, 2015 05:15
-
-
Save jkseppan/8b09b9d6ba7cf5c8f4a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Simo Kivelä [pyysi laskinvalmistajia simuloimaan Buffonin neulaongelmaa](http://simokivela.blogspot.fi/2015/05/buffon-laskimet-ja-koulu.html) omilla tuotteillaan. En ole laskinvalmistaja, mutta olen jossain yhteydessä suositellut Pythonia, joten tässä pientä testailua IPython Notebookilla." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Populating the interactive namespace from numpy and matplotlib\n" | |
] | |
} | |
], | |
"source": [ | |
"%pylab inline\n", | |
"rcParams['figure.figsize'] = (8,8)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Piirretään muutama yhdensuuntainen viiva. Sovitaan, että neulan toinen pää osuu yksikköneliön sisään, kuvassa keltaisella. Tehdään kuvan piirtämisestä saman tien funktio, jotta sitä voidaan hyödyntää myöhemmin." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAHaCAYAAAAkILGUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAE9xJREFUeJzt3V+MpXd93/HP19r6IkGygASDbOxU/C2RIpdKjhGVPFLV\nYFtRlkpWgFYioVJkIVmJlEhxmiB5uQs3lUJI5DpyIlwFmSgSsIBp7AimiIu6Fs4WQ9awqMEYF7at\nwFH5c+E6317McZiuZ2Yn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z/MsFG+qi+2T362ZVdWN2\n3pVw47/pLlT2/35y3I6V5+27T475sfLHSf66u39vn8dXdryMPZM+SFW9NcnvJ/mJJJ+oqjPdfWtV\nvSLJH3X3z3f3c1V1Z5KHsvPDyH3dfXaNyz4K70vyZ1X1b5M8meQXk2T3fsnOpfKPLN4j/USSP+3u\nh9a14Etlv69/Vd2x83Df290PVtVtVfXVJN9L8q51rvlSO8w+SXJ7Vb07ybNJfpDkbetb8dGpqg9l\n59cMvrSqvp7k7iRX5pgeK8nF90mO77Hy5iT/JsnjVfVX2XlZ8bez868mVn68eO9uABhqEy53A8BG\nEmkAGEqkAWAokQaAoUQaAIYSaQAYSqQBYKj/B3RNwXpNr3L6AAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x109794d50>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"def pohja():\n", | |
" hlines([-1, 0, 1, 2], -1, 2)\n", | |
" bar(0, 1, 1, color='yellow', alpha=0.2)\n", | |
" xlim([-1.1, 2.1])\n", | |
" ylim([-1.1, 2.1])\n", | |
"pohja()\n", | |
"show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Piirretään kuvaan myös muutama mahdollinen neula. Jos alkupään koordinaatit ovat vaikka $(x, y)$ ja suuntakulma on $\\theta$, loppupään koordinaatit ovat $(x + \\cos\\theta, y + \\sin\\theta)$." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAekAAAHaCAYAAAAkILGUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XucVXW9//HXBwa8kagYoihoopGZmZqXrOBoXuCoaMKx\nPOeYdjGLyvJSZpZYJ6tf3io100yzU1neEVG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", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x10af3b6d0>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"def neula(x, y, theta):\n", | |
" plot([x, x + cos(theta)],\n", | |
" [y, y + sin(theta)],\n", | |
" color='blue', lw=2)\n", | |
"\n", | |
"pohja()\n", | |
"neula(0.5, 0.5, 0)\n", | |
"neula(0.1, 0.1, 1.1 * pi)\n", | |
"neula(0.2, 0.9, pi/6)\n", | |
"neula(0.8, 0.3, 3*pi/8)\n", | |
"show()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Ilmeisesti neula pysyy kahden viivan välissä, jos $0 < y + \\sin\\theta < 1$. Tehdään tästä funktio:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"def valissa(y, theta):\n", | |
" return 0 < y + sin(theta) < 1\n", | |
"\n", | |
"def ylittaa(y, theta):\n", | |
" return not valissa(y, theta)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Sitten vain toistetaan monta kertaa. Tehdään tästäkin funktio, jotta voidaan kohta mitata aikaa." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.63641\n", | |
"0.637155\n", | |
"0.636206\n" | |
] | |
} | |
], | |
"source": [ | |
"def simulaatio(n):\n", | |
" ylityksia = 0\n", | |
" n = 1000000\n", | |
" for i in range(n):\n", | |
" y = random.uniform(0, 1)\n", | |
" theta = random.uniform(0, 2*pi)\n", | |
" if ylittaa(y, theta):\n", | |
" ylityksia += 1\n", | |
" return 1.0 * ylityksia / n\n", | |
"\n", | |
"print simulaatio(1000)\n", | |
"print simulaatio(10000)\n", | |
"print simulaatio(1e6)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Aikaa menee minun koneellani pari sekuntia:" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"1 loops, best of 3: 1.84 s per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit simulaatio(1e6)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Nopeutta saa lisää vektoroimalla. Seuraava tuhlaa muistia mutta välttää silmukoiden ajamisen Python-tulkissa. Vielä vähän hienompi ratkaisu pilkkoisi tehtävän sopivan mittaisiin paloihin, joista kukin olisi erikseen vektoroitu, ja yhdistäisi tulokset Python-silmukalla." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.63663671\n", | |
"1 loops, best of 3: 6.37 s per loop\n" | |
] | |
} | |
], | |
"source": [ | |
"def simulaatio2(n):\n", | |
" y = random.uniform(0, 1, size=n)\n", | |
" theta = random.uniform(0, 2*pi, size=n)\n", | |
" sin(theta, out=theta)\n", | |
" add(y, theta, out=y)\n", | |
" return logical_or(greater(y, 1), less(y, 0)).mean()\n", | |
"print simulaatio2(1e8)\n", | |
"%timeit simulaatio2(1e8)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.9" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment