Version2

parent ff86b0fd
...@@ -4,11 +4,13 @@ ...@@ -4,11 +4,13 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Toy _ notebook _ fr\n", "# A propos du calcul de π"
" \n", ]
"March 28, 2019\n", },
"\n", {
"# A propos du calcul de π\n", "cell_type": "markdown",
"metadata": {},
"source": [
"## En demandant à la lib maths\n", "## En demandant à la lib maths\n",
"Mon ordinateur m'indique que π vaut _aproximativement_ " "Mon ordinateur m'indique que π vaut _aproximativement_ "
] ]
...@@ -27,7 +29,7 @@ ...@@ -27,7 +29,7 @@
} }
], ],
"source": [ "source": [
"In [1]: from math import *\n", "from math import *\n",
"print(pi)" "print(pi)"
] ]
}, },
...@@ -36,7 +38,7 @@ ...@@ -36,7 +38,7 @@
"metadata": {}, "metadata": {},
"source": [ "source": [
" ## En utilisant la méthode des aiguilles de Buffon\n", " ## En utilisant la méthode des aiguilles de Buffon\n",
" Mais calculé avec la **méthode** des [aiguilles de Buffon](https://fr.wikipedia.org/wiki/Aiguille_de_Buffon), on obtiendrait comme **approximation**:" "Mais calculé avec la __méthode__ des [aiguilles de Buffon](https://fr.wikipedia.org/wiki/Aiguille_de_Buffon), on obtiendrait comme __approximation__:"
] ]
}, },
{ {
...@@ -56,7 +58,7 @@ ...@@ -56,7 +58,7 @@
} }
], ],
"source": [ "source": [
"In [2]: import numpy as np\n", "import numpy as np\n",
"np.random.seed(seed=42)\n", "np.random.seed(seed=42)\n",
"N = 10000\n", "N = 10000\n",
"x = np.random.uniform(size=N, low=0, high=1)\n", "x = np.random.uniform(size=N, low=0, high=1)\n",
...@@ -91,7 +93,7 @@ ...@@ -91,7 +93,7 @@
} }
], ],
"source": [ "source": [
"In [3]: %matplotlib inline\n", "%matplotlib inline\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
"np.random.seed(seed=42)\n", "np.random.seed(seed=42)\n",
"N = 1000\n", "N = 1000\n",
...@@ -130,7 +132,7 @@ ...@@ -130,7 +132,7 @@
} }
], ],
"source": [ "source": [
"In [4]: 4*np.mean(accept)" "4*np.mean(accept)"
] ]
}, },
{ {
......
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