From 1e56f40544f3531ad335455edc00c4027f718fe5 Mon Sep 17 00:00:00 2001 From: 8f7726592c23135ae5b65a064228781a <8f7726592c23135ae5b65a064228781a@app-learninglab.inria.fr> Date: Thu, 5 Aug 2021 14:53:44 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 2 -- 1 file changed, 2 deletions(-) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index d685ca2..908fa71 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -33,7 +33,6 @@ si $X\sim U(0,1)$ et $Y\sim U(0,1)$ alors $P [X^2+Y^2\leq 1] = \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 : - ```{r} set.seed(42) N = 1000 @@ -42,7 +41,6 @@ df$Accept = (df$X**2 + df$Y**2 <=1) library(ggplot2) ggplot(df, aes(x=X,y=Y,color=Accept)) + geom_point(alpha=.2) + coord_fixed() + theme_bw() ``` - Il est alors aisé d'obtenir une approximation (pas terrible) de $\pi$ en comptant com bien de fois, en moyenne, $X^2 + Y^2$ est inférieur à 1 : -- 2.18.1