From d186dbecf76cfc531a2af3bcedcfd9ae41bb7238 Mon Sep 17 00:00:00 2001 From: 248111c51d3bcbf9b09cc4dac4fd3399 <248111c51d3bcbf9b09cc4dac4fd3399@app-learninglab.inria.fr> Date: Tue, 20 Apr 2021 09:56:49 +0000 Subject: [PATCH] queues corrections --- module2/exo1/toy_notebook_fr.ipynb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index ddee0aa..54f6454 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -18,7 +18,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## A propos du calcul de π" + "## A propos du calcul de $\\pi$" ] }, { @@ -32,7 +32,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Mon ordinateur m'indique que π vaut _approximativement_" + "Mon ordinateur m'indique que $\\pi$ vaut _approximativement_" ] }, { @@ -128,12 +128,15 @@ "source": [ "%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", + "\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", @@ -144,8 +147,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Il est alors aisé d’obtenir une approximation (pas terrible) de _π_ en comptant combien de fois,\n", - "en moyenne, X2 + Y2 est inférieur à 1 :" + "Il est alors aisé d’obtenir une approximation (pas terrible) de $\\pi$ en comptant combien de fois,\n", + "en moyenne, $X^2 + $Y^2 est inférieur à 1 :" ] }, { -- 2.18.1