diff --git a/module2/exo1/toy_notebook_en.ipynb b/module2/exo1/toy_notebook_en.ipynb index 742c9d4434e23779b9a04e7436b136bacc941026..83d04260b32303f38a07ada701c90067329fdf03 100644 --- a/module2/exo1/toy_notebook_en.ipynb +++ b/module2/exo1/toy_notebook_en.ipynb @@ -12,7 +12,7 @@ "metadata": {}, "source": [ "## Asking the maths library\n", - "My computer tells me that $\\pi$ is approximatively" + "My computer tells me that $\\pi$ is *approximatively*" ] }, { @@ -37,13 +37,13 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Buffalo's needle\n", + "## Buffon's needle\n", "Applying the method of [Buffon’s needle](https://en.wikipedia.org/wiki/Buffon%27s_needle_problem), we get the __approximation__" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -52,7 +52,7 @@ "3.128911138923655" ] }, - "execution_count": 9, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -63,21 +63,21 @@ "N = 10000\n", "x = np.random.uniform(size=N, low=0, high=1)\n", "theta = np.random.uniform(size=N, low=0, high=pi/2)\n", - "2/(sum((x+np.sin(theta))>1)/N)\n" + "2/(sum((x+np.sin(theta))>1)/N)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## 1.3 Using a surface fraction argument" + "## Using a surface fraction argument" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "A method that is easier to understand and does not make use of the sin function is based on the fact that if $X\\sim U(0, 1)$ and $Y\\sim U(0, 1)$, then $P[X^2+Y^2\\leq 1] = \\pi/4$ (see [\"Monte Carlo method\" on Wikipedia](https://en.wikipedia.org/wiki/Monte_Carlo_method)). The following code uses this approach:" + "A method that is easier to understand and does not make use of the sin function is based on the fact that if $X\\sim U(0,1)$ and $Y\\sim U(0,1)$, then $P[X^2+Y^2\\leq 1] = \\pi/4$ (see [\"Monte Carlo method\" on Wikipedia](https://en.wikipedia.org/wiki/Monte_Carlo_method)). The following code uses this approach:" ] }, { @@ -99,7 +99,7 @@ } ], "source": [ - "%matplotlib inline\n", + "%matplotlib inline \n", "import matplotlib.pyplot as plt\n", "\n", "np.random.seed(seed=42)\n",