From 30387a26658e53eee82d7faaf04de6ee710c5a7a Mon Sep 17 00:00:00 2001 From: da377e3b0960a14b082c0f46b9a54abd Date: Fri, 9 Jun 2023 15:37:59 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 6b052b9..3360a06 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -37,7 +37,13 @@ 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} +4*mean(df$Accept) +``` ## Quelques explications -- 2.18.1