Version2

parent ff86b0fd
......@@ -4,11 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Toy _ notebook _ fr\n",
" \n",
"March 28, 2019\n",
"\n",
"# A propos du calcul de π\n",
"# A propos du calcul de π"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## En demandant à la lib maths\n",
"Mon ordinateur m'indique que π vaut _aproximativement_ "
]
......@@ -27,7 +29,7 @@
}
],
"source": [
"In [1]: from math import *\n",
"from math import *\n",
"print(pi)"
]
},
......@@ -36,7 +38,7 @@
"metadata": {},
"source": [
" ## 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 @@
}
],
"source": [
"In [2]: import numpy as np\n",
"import numpy as np\n",
"np.random.seed(seed=42)\n",
"N = 10000\n",
"x = np.random.uniform(size=N, low=0, high=1)\n",
......@@ -91,7 +93,7 @@
}
],
"source": [
"In [3]: %matplotlib inline\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"np.random.seed(seed=42)\n",
"N = 1000\n",
......@@ -130,7 +132,7 @@
}
],
"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