Update toy_document_orgmode_python_fr.org

parent 64bbab68
......@@ -5,15 +5,13 @@
#+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://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/readtheorg/js/readtheorg.js"></script>
#+PROPERTY: header-args :session :exports both
* 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
from math import *
......@@ -30,7 +28,7 @@ comme *approximation* :
#+begin_src python :results value :session *python* :exports both
import numpy as np
np.random.seed(seed=42)
N = 100000
N = 10000
x = np.random.uniform(size=N, low=0, high=1)
theta = np.random.uniform(size=N, low=0, high=pi/2)
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
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*
import matplotlib.pyplot as plt
np.random.seed(seed=42)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment