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
55c671948c2c802a48ec3ed371eaabea
mooc-rr
Commits
6f1132be
Commit
6f1132be
authored
Apr 30, 2020
by
55c671948c2c802a48ec3ed371eaabea
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update toy_document_orgmode_python_fr.org
parent
64bbab68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
5 deletions
+2
-5
toy_document_orgmode_python_fr.org
module2/exo1/toy_document_orgmode_python_fr.org
+2
-5
No files found.
module2/exo1/toy_document_orgmode_python_fr.org
View file @
6f1132be
...
@@ -5,15 +5,13 @@
...
@@ -5,15 +5,13 @@
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
#+HTML_HEAD: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
#+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
#+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
#+PROPERTY: header-args :session :exports both
#+PROPERTY: header-args :session :exports both
* En demandant à la lib maths
* En demandant à la lib maths
Mon ordinateur m'indique que $\pi$ vaut /approximativement/
Mon ordinateur m'indique que $\pi$ vaut /approximativement/
:
#+begin_src python :results value :session *python* :exports both
#+begin_src python :results value :session *python* :exports both
from math import *
from math import *
...
@@ -30,7 +28,7 @@ comme *approximation* :
...
@@ -30,7 +28,7 @@ comme *approximation* :
#+begin_src python :results value :session *python* :exports both
#+begin_src python :results value :session *python* :exports both
import numpy as np
import numpy as np
np.random.seed(seed=42)
np.random.seed(seed=42)
N = 10000
0
N = 10000
x = np.random.uniform(size=N, low=0, high=1)
x = np.random.uniform(size=N, low=0, high=1)
theta = np.random.uniform(size=N, low=0, high=pi/2)
theta = np.random.uniform(size=N, low=0, high=pi/2)
2/(sum((x+np.sin(theta))>1)/N)
2/(sum((x+np.sin(theta))>1)/N)
...
@@ -46,7 +44,6 @@ U(0,1)$ et $Y\sim U(0,1)$ alors $P[X^2+Y^2\leq 1] = \pi/4$ (voir [[https://fr.wi
...
@@ -46,7 +44,6 @@ U(0,1)$ et $Y\sim U(0,1)$ alors $P[X^2+Y^2\leq 1] = \pi/4$ (voir [[https://fr.wi
Monte Carlo sur Wikipedia]]). Le code suivant illustre ce fait :
Monte Carlo sur Wikipedia]]). Le code suivant illustre ce fait :
#+begin_src python :results output file :var matplot_lib_filename="figure_pi_mc2.png" :exports both :session *python*
#+begin_src python :results output file :var matplot_lib_filename="figure_pi_mc2.png" :exports both :session *python*
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
np.random.seed(seed=42)
np.random.seed(seed=42)
...
...
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