diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 67c42acc5c4d1f088c1e808baa03aacaed04948a..63cec435f1d86b041f9d67fb9e781a3028e434e0 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -63,16 +63,7 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [], - "source": [ - "import numpy as np" - ] - }, - { - "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -81,12 +72,13 @@ "3.128911138923655" ] }, - "execution_count": 12, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "import numpy as np\n", "np.random.seed(seed=42)\n", "N = 10000\n", "x = np.random.uniform(size=N, low=0, high=1)\n", @@ -111,12 +103,20 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", - "import matplotlib.pyplot as plt" + "import matplotlib.pyplot as plt\n", + "\n", + "np.random.seed(seed=42)\n", + "N = 1000\n", + "x = np.random.uniform(size=N, low=0, high=1)\n", + "y = np.random.uniform(size=N, low=0, high=1)\n", + "\n", + "accept = (x*x+y*y) <= 1\n", + "reject = np.logical_not(accept)\n" ] }, {