diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 8af954aea19776a3429fe13190183c37d7739e52..ecd82d81bc17121879caeeb2407b950d5b41246b 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