From 3a5e8576748088393d992f4eb884010e5a1852ff Mon Sep 17 00:00:00 2001 From: 521adc37f04e8509ebf5ce131815aa0a <521adc37f04e8509ebf5ce131815aa0a@app-learninglab.inria.fr> Date: Mon, 1 Feb 2021 07:50:11 +0000 Subject: [PATCH] mean_np --- module2/exo1/toy_notebook_fr.ipynb | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index b9f2099..f104b14 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -137,12 +137,33 @@ "ax.set_aspect('equal')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Il est alors aisé d’obtenir une approximation (pas terrible) de $π$ en comptant combien de fois, en moyenne, $X^2 + Y^2$\n", + "est inférieur à 1 :" + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/plain": [ + "3.112" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "4*np.mean(accept)" + ] } ], "metadata": { -- 2.18.1