From a26e430369daa0c85655fd97bf8a60c0f38a71ba Mon Sep 17 00:00:00 2001 From: 26409e76addd01285a23d94b61746792 <26409e76addd01285a23d94b61746792@app-learninglab.inria.fr> Date: Sat, 29 May 2021 13:34:31 +0000 Subject: [PATCH] Update toy_document_fr.Rmd --- module2/exo1/toy_document_fr.Rmd | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index df78516..9518f7e 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -10,13 +10,22 @@ knitr::opts_chunk$set(echo = TRUE) ``` ## En demandant à la lib maths - Mon ordinateur m'indique que $\pi$ vaut *approximativement* ```{r cars} pi ``` +## En utilisant la méthode des aiguilles de Buffon + +Mais calculé avec la **méthode** , on obtiendrait comme **approximation** : +```{r cars} +set.seed(42) +N = 100000 +x = runif(N) +theta = pi/2*runif(N) +2/(mean(x+sin(theta)>1)) +``` ## Quelques explications -- 2.18.1