diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index cdfb2a348560a867cda6d847665c86f31eea1802..c5998b32028c1c80da42f7eb40f279cacd731609 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -111,6 +111,22 @@ "ax.scatter(x[reject], y[reject], c='r', alpha=0.2, edgecolor=None)\n", "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": {