From a2df192c7e0cc4cf48bcee89536964d923070c5e Mon Sep 17 00:00:00 2001 From: fafdde0bd36da02e2d1f6f08e69cce5a Date: Fri, 29 Sep 2023 13:34:13 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 8af954a..ecd82d8 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -30,4 +30,8 @@ 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 es alors aisé d'obtenir une approximation (pas terrible) de π en comptant combien de fois, en moyenne, __X²+Y²__ est inférieur à 1: +```{r} +4*mean(df$Accept) ``` \ No newline at end of file -- 2.18.1