document complet

parent 33eeec1f
...@@ -111,6 +111,22 @@ ...@@ -111,6 +111,22 @@
"ax.scatter(x[reject], y[reject], c='r', alpha=0.2, edgecolor=None)\n", "ax.scatter(x[reject], y[reject], c='r', alpha=0.2, edgecolor=None)\n",
"ax.set_aspect('equal')" "ax.set_aspect('equal')"
] ]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Il est alors aisé d’obtenir une approximation (pas terrible) de $\\pi$ en comptant combien de fois, en moyenne, $X^2+Y^2$ est inférieur à 1 :"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"4*np.mean(accept)"
]
} }
], ],
"metadata": { "metadata": {
......
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