From 8070f7736e42b3ab7c8d90c5d289320e6fd87a9d Mon Sep 17 00:00:00 2001 From: 40493573b996e2fab2c46954594abefe <40493573b996e2fab2c46954594abefe@app-learninglab.inria.fr> Date: Fri, 12 Mar 2021 21:52:45 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 457dab8..8c1bc4f 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -37,7 +37,9 @@ df = data.frame(X = runif(N), Y = runif(N)) 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 combien de fois, en moyenne, $X^2 + Y^2$ est inférieur à 1 : ```{r} -- 2.18.1