From d9b9e3b70c002b567cb4359b5145acfba15f0d59 Mon Sep 17 00:00:00 2001 From: c7634a79930dd347a380ff9c518b6ce2 Date: Tue, 15 Feb 2022 09:13:26 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 7f2074d..bcfee6f 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -37,9 +37,10 @@ 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: +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} 4*mean(df$Accept) -- 2.18.1