update

parent f5cc4b65
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
"# À propos du calcul de $\\pi$\n", "# À propos du calcul de $\\pi$\n",
"\n", "\n",
"## En demandant à la lib maths\n", "## En demandant à la lib maths\n",
"\n", "Mon ordinateur m’indique que $\\pi$ vaut *approximative*"
"Mon ordinateur m’indique que $\\pi$ vaut approximative"
] ]
}, },
{ {
...@@ -26,7 +25,7 @@ ...@@ -26,7 +25,7 @@
], ],
"source": [ "source": [
"from math import *\n", "from math import *\n",
"print(pi)\n" "print(pi)"
] ]
}, },
{ {
...@@ -34,13 +33,12 @@ ...@@ -34,13 +33,12 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
"## En utilisant la méthode des aiguilles de Buffon\n", "## En utilisant la méthode des aiguilles de Buffon\n",
"\n",
"Mais calculé avec la **méthode** des [aiguilles de Buffon](https://fr.wikipedia.org/wiki/Aiguille_de_Buffon), on obtiendrait comme **approximation** :\n" "Mais calculé avec la **méthode** des [aiguilles de Buffon](https://fr.wikipedia.org/wiki/Aiguille_de_Buffon), on obtiendrait comme **approximation** :\n"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 21,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -49,7 +47,7 @@ ...@@ -49,7 +47,7 @@
"3.128911138923655" "3.128911138923655"
] ]
}, },
"execution_count": 12, "execution_count": 21,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
...@@ -100,7 +98,7 @@ ...@@ -100,7 +98,7 @@
"N = 1000\n", "N = 1000\n",
"x = np.random.uniform(size=N, low=0, high=1)\n", "x = np.random.uniform(size=N, low=0, high=1)\n",
"y = np.random.uniform(size=N, low=0, high=1)\n", "y = np.random.uniform(size=N, low=0, high=1)\n",
"1\n", "\n",
"accept = (x*x+y*y) <= 1\n", "accept = (x*x+y*y) <= 1\n",
"reject = np.logical_not(accept)\n", "reject = np.logical_not(accept)\n",
"fig, ax = plt.subplots(1)\n", "fig, ax = plt.subplots(1)\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment