diff --git a/module2/exo1/toy_document_orgmode_python_en.org b/module2/exo1/toy_document_orgmode_python_en.org index 5e6d2aea1b1f741b1f01f475326c346a50beeb7f..841c4e9ced342e7b58515d79f752d0ca7d050271 100644 --- a/module2/exo1/toy_document_orgmode_python_en.org +++ b/module2/exo1/toy_document_orgmode_python_en.org @@ -44,6 +44,7 @@ A method that is easier to understand and does not make use of the $\sin$ functi import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt + np.random.seed(seed=42) N = 1000 x = np.random.uniform(size=N, low=0, high=1) @@ -69,7 +70,6 @@ C:/Users/Utilisateur/mooc-rr/module2/exo1/PictureRes.png]] It is then straightforward to obtain a (not really good) approximation to $\pi$ by counting how many times, on average, $X^2 + Y^2$ is smaller than 1: #+begin_src python :results output :session *python* :exports both -import numpy as np 4*np.mean(accept) #+end_src