From dc49aece508aabf36e7ed9c69b2288cd507cea43 Mon Sep 17 00:00:00 2001 From: 6f892419cc99326ee525ed439d8ff5df <6f892419cc99326ee525ed439d8ff5df@app-learninglab.inria.fr> Date: Sat, 27 Feb 2021 20:36:57 +0000 Subject: [PATCH] 6 --- module2/exo1/toy_notebook_fr.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 3d074f8..7c2b201 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -10,7 +10,7 @@ "Mon ordinateur m'indique que $\\pi$ vaut *approximativement*\n", "\n", "\n", - "In [1]:\n", + "In \\[1]:\n", "from math import *\n", "print (pi)\n", " \n", @@ -22,7 +22,7 @@ "obtiendrait comme **approximation** :\n", "\n", "\n", - "In [2]:\n", + "In \\[2]:\n", "import numpy as np\n", "np.random.seed(seed=42)\n", "N = 10000\n", @@ -36,7 +36,7 @@ "Sinon, une méthode plus simple à comprendre et ne faisant pas intervenir d'appel à la fonction sinus se base sur le fait que si $X\\sim U(0,1)$ et $Y\\sim U(0,1)$ alors $P[X^2+Y^2\\leq1] = \\pi/4$ (voir [méthode de Monte Carlo sur Wikipedia](https://fr.wikipedia.org/wiki/M%C3%A9thode_de_Monte-Carlo#D%C3%A9termination_de_la_valeur_de_%CF%80)). Le code suivant illustre ce fait :\n", "\n", "\n", - "In [3]:\n", + "In \\[3]:\n", "\n", "%matplotlib inline\n", "import matplotlib.pyplot as plt\n", @@ -57,7 +57,7 @@ "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 :\n", "\n", "\n", - "In [4]:\n", + "In \\[4]:\n", "\n", "4*np.mean(accept)\n", "3.1120000000000001\n", -- 2.18.1