From 6e0e9de1b2be87898e322d583404fe12dfe814c8 Mon Sep 17 00:00:00 2001 From: 616ee2c01a4332904a27d4bdd2018cb5 <616ee2c01a4332904a27d4bdd2018cb5@app-learninglab.inria.fr> Date: Sat, 30 Dec 2023 16:47:58 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 1 + 1 file changed, 1 insertion(+) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index e7f10e4..c1157c8 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -37,6 +37,7 @@ 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: -- 2.18.1