diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index d3ae9004cca7a895946de17ffa45cf8efbb5f48d..e15b1d241ecf2de4b41d77e0454ec2d0c234412b 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -38,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, on obtiendrait comme approximation :" + "Mais calculé avec la __méthode__ des aiguilles de Buffon, on obtiendrait comme __approximation__ :" ] }, { @@ -93,15 +93,17 @@ } ], "source": [ - "%matplotlib inline\n", + "%matplotlib inline \n", "import matplotlib.pyplot as plt\n", + "\n", "np.random.seed(seed=42)\n", "N = 1000\n", "x = 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", "reject = np.logical_not(accept)\n", + "\n", "fig, ax = plt.subplots(1)\n", "ax.scatter(x[accept], y[accept], c='b', alpha=0.2, edgecolor=None)\n", "ax.scatter(x[reject], y[reject], c='r', alpha=0.2, edgecolor=None)\n", @@ -112,7 +114,7 @@ "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 :" + "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 :" ] }, {