From 5e6bc859b2e9bf4528b51c913c0698e724b8a17b Mon Sep 17 00:00:00 2001 From: a6b043a967b7461961cf4321689a5db1 Date: Tue, 19 Nov 2024 11:56:09 +0000 Subject: [PATCH] Corrections typos et code --- module2/exo1/toy_notebook_fr.ipynb | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 259f624..b7e0a5c 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -4,9 +4,15 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# À propos du calcul de $\\pi$\n", + "# À propos du calcul de $\\pi$\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "## En demandant à la lib maths\n", - "Mon ordinateur m'indique que $\\pi$ vaut *approximativement*" + "Mon ordinateur m'indique que $\\pi$ vaut _approximativement_" ] }, { @@ -32,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__ :" ] }, { @@ -43,7 +49,7 @@ { "data": { "text/plain": [ - "3.128911138923655e-08" + "3.128911138923655" ] }, "execution_count": 2, @@ -57,7 +63,7 @@ "N = 10000\n", "x = np.random.uniform(size=N, low=0, high=1)\n", "theta = np.random.uniform(size=N, low=0, high=pi/2)\n", - "2/sum((x+np.sin(theta))>1)/N" + "2/(sum((x+np.sin(theta))>1)/N)" ] }, { @@ -107,7 +113,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 : " ] }, { -- 2.18.1