diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5b6a0652566d10360493952aec6d4a4febc77083 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/module2/exo1/toy_document_fr.Rmd b/module2/exo1/toy_document_fr.Rmd index 5ab10163e4438c64e65d1d1d2ecc0b34b83265db..67cb72f55b1114c0285b36c4214056344eca3aa5 100644 --- a/module2/exo1/toy_document_fr.Rmd +++ b/module2/exo1/toy_document_fr.Rmd @@ -5,6 +5,25 @@ date: "30 aout 2022" output: html_document --- +# En demandant à la lib maths +Mon ordinateur m’indique que π vaut approximativement + +```{r} +pi +``` + +#En utilisant la méthode des aiguilles de Buffon +Mais calculé avec [la méthode des aiguilles de Buffon] (https://fr.wikipedia.org/wiki/Aiguille_de_Buffon) , on obtiendrait comme approximation : + +```{r} +set.seed(42) +N = 100000 +x = runif(N) +theta = pi/2*runif(N) +2/(mean(x+sin(theta)>1)) +``` + + ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) diff --git a/mooc-rr.Rproj b/mooc-rr.Rproj new file mode 100644 index 0000000000000000000000000000000000000000..8e3c2ebc99e2e337f7d69948b93529a437590b27 --- /dev/null +++ b/mooc-rr.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX