Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
42eaffb07ab321885c173115fa1a5bf9
mooc-rr
Commits
4d07461f
Commit
4d07461f
authored
Oct 20, 2022
by
42eaffb07ab321885c173115fa1a5bf9
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modifications mineures de toy_document_orgmode_R_fr.org
parent
79256fef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
toy_document_orgmode_R_fr.org
module2/exo1/toy_document_orgmode_R_fr.org
+9
-9
No files found.
module2/exo1/toy_document_orgmode_R_fr.org
View file @
4d07461f
#+TITLE: À propos du calcul de
\pi
#+TITLE: À propos du calcul de
$\pi$
#+AUTHOR: Lionel Sicot
#+DATE: 20/10/2022
#+LANGUAGE: fr
#
#+PROPERTY: header-args :eval never-export
#
+PROPERTY: header-args :session :exports both
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
...
...
@@ -12,9 +12,9 @@
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
* En demandant à la lib maths
Mon ordinateur m'indique que
\pi
vaut /approximativement/
Mon ordinateur m'indique que
$\pi$
vaut /approximativement/
#+begin_src R :results output :exports both
#+begin_src R :
session *R* :
results output :exports both
pi
#+end_src
...
...
@@ -24,7 +24,7 @@ pi
* En utilisant la méthode des aiguilles de Buffon
Mais calculé avec la *méthode* des [[https://fr.wikipedia.org/wiki/Aiguille_de_Buffon][aiguilles de Buffon]], on obtiendrait comme *approximation* :
#+begin_src R :results output :exports both
#+begin_src R :
session *R* :
results output :exports both
set.seed(42)
N = 100000
x = runif(N)
...
...
@@ -50,7 +50,7 @@ ggplot(df, aes(x=X,y=Y,color=Accept)) + geom_point(alpha=.2) + coord_fixed() + t
#+RESULTS:
[[file:MonteCarlo.png]]
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 :
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 :
#+begin_src R :session *R* :results output :exports both
4*mean(df$Accept)
#+end_src
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment