Commit 496f580a authored by Dorinel Bastide's avatar Dorinel Bastide

Final minor changes, managed to obtained indeed solution results as per questions

parent 362372f2
......@@ -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
......
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