From 3feb6c7e10d00930889bb2bebe826a4e9a467ceb Mon Sep 17 00:00:00 2001 From: Kees van Kempen Date: Thu, 20 Oct 2022 12:18:26 +0200 Subject: [PATCH] 07: Draft what I did in the practical session modulo what I did on paper for the first one --- Exercise sheet 7/exercise_sheet_07.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Exercise sheet 7/exercise_sheet_07.ipynb b/Exercise sheet 7/exercise_sheet_07.ipynb index 15caf5d..f1e7f66 100644 --- a/Exercise sheet 7/exercise_sheet_07.ipynb +++ b/Exercise sheet 7/exercise_sheet_07.ipynb @@ -20,12 +20,12 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "id": "8ce67703", "metadata": {}, "outputs": [], "source": [ - "NAME = \"\"\n", + "NAME = \"Kees van Kempen\"\n", "NAMES_OF_COLLABORATORS = \"\"" ] }, @@ -62,7 +62,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "id": "d10dcc0d", "metadata": { "deletable": false, @@ -259,8 +259,8 @@ "source": [ "def sample_Y(s,lamb,c):\n", " '''Sample Y width density f_Y(y).'''\n", - " # YOUR CODE HERE\n", - " raise NotImplementedError()" + " f_Y = lambda y: np.sqrt(c/np.pi)*np.exp(-c*(y - s/c)**2) # \\aprox np.sqrt(c/np.pi)*np.exp(2*c)*rng.normal(s/c, 0)\n", + " f_Z = lambda z: rng.normal()" ] }, { @@ -577,7 +577,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" },