-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add general feedback for individual coursework. (#390)
- Loading branch information
1 parent
1bf8d39
commit 83a202c
Showing
4 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
_posts/2025-01-13-general-feedback-for-individual-coursework.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
layout: post | ||
title: "Individual Coursework Feedback" | ||
tags: | ||
- about-the-course | ||
- assessment | ||
--- | ||
|
||
Thanks all for your efforts in doing the individual coursework! | ||
|
||
You can find the solution [here]({{site.baseurl}}/assets/assessment/2024-2025/ind/solution.ipynb). | ||
|
||
The performance was really good, below are some summary statistics of your | ||
marks: | ||
|
||
- mean: 77.55 | ||
- standard deviation: 13.6 | ||
- min: 2.00 | ||
- 25th percentile: 71.00 | ||
- 50th percentile: 78.00 | ||
- 75th percentile: 85.00 | ||
- max: 100.00 | ||
|
||
Here is a plot of the distribution of the marks: | ||
|
||
 | ||
|
||
Here is a detailed summary of the various things I checked for for each question | ||
as well as the percentage of students who were correct: | ||
|
||
- Q1a correct value: 96.31 % | ||
- Q1 a use st correlation: 99.08 % | ||
- Q1b correct value: 96.31 % | ||
- Q1 b use st correlation: 99.08 % | ||
- Q1 c correct value: 96.31 % | ||
- Q1 c use st correlation: 99.08 % | ||
- Q1 d correct value: 96.31 % | ||
- Q1 d use st correlation: 99.08 % | ||
- Q1 e correct value: 96.31 % | ||
- Q1 e use st correlation: 99.08 % | ||
- Q2 a use integrate: 96.77 % | ||
- Q2 a correct value: 77.42 % | ||
- Q2 a correct derivative: 83.87 % | ||
- Q2 b use integrate: 97.24 % | ||
- Q2 b correct value: 77.88 % | ||
- Q2 b correct derivative: 83.87 % | ||
- Q3 a correct approach: 82.49 % | ||
- Q3 a correct answer: 41.94 % | ||
- Q3 b correct approach: 80.65 % | ||
- Q3 b correct answer: 100.00 % | ||
- Q4 a create equations: 96.77 % | ||
- Q4 a use dsolve: 90.78 % | ||
- Q4 a correct solution to system of differential equations: 35.02 % | ||
- Q4 b correct use of ics: 94.01 % | ||
- Q4 b correct solution to system of differential equations: 9.68 % | ||
- Q4 c correct value of t: 5.99 % | ||
- Q4 c correct value of winner: 37.33 % | ||
|
||
Overall performance was good and the main area of difficulty was question 4. A | ||
number of students did not use exact numbers for the constants | ||
which implied that the equations were not exact solutions to the differential | ||
equation. This question was marked generously and a lot of partial credit | ||
given. | ||
|
||
A less common mistake but one that happened more than once in question 3 was to | ||
compute permutations instead of combinations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"cells": [{"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Computing for Mathematics - 2024/2025 individual coursework\n\n**Important** Do not delete the cells containing: \n\n```\n### BEGIN SOLUTION\n\n\n### END SOLUTION\n```\n\nwrite your solution attempts in those cells.\n\nTo submit this notebook:\n\n- Change the name of the notebook from `main` to: `<student_number>`. For example, if your student number is `c1234567` then change the name of the notebook to `c1234567`.\n- **Write all your solution attempts in the correct locations**;\n- **Do not delete** any code that is already in the cells;\n- Save the notebook (`File>Save As`);\n- Follow the instructions given to submit."}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "#### Question 1 (30 marks)\n\n(__Hint__: This question is similar to [this section of the python for mathematics text](https://vknight.org/pfm/tools-for-mathematics/08-statistics/how/main.html#calculate-the-pearson-correlation-coefficient).)\n\nFor each of the following pairs of data $x$ and $y$ compute the Pearson correlation coefficient.\n\na. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 1, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-a"]}, "outputs": [], "source": "import statistics as st\nx = (1, 2, 3, 4, 5, 6, 7, 8, 9)\ny = (20, 10, 40, 30, 60, 50, 2, -1, -5)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b.\n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 3, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-b"]}, "outputs": [], "source": "x = (1, 7, -1, 5, 10, -4)\ny = (20, 10, 40, 30, 60, 50)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "c. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 5, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-c"]}, "outputs": [], "source": "x = (1, 7, 21)\ny = (1 / 3, 1, 3)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "d. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 7, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-d"]}, "outputs": [], "source": "x = (1, 2, 3, 4, 5)\ny = (-1, 1, -1, 1, -1)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "e.\n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 9, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-e"]}, "outputs": [], "source": "x = (1, 2, 3, 4, 5)\ny = (0, 0, 0, 0, -1)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Question 2 (18 marks)\n\n\n(__Hint__: This question is similar to the [third exercise of the Calculus chapter of Python for mathematics](https://vknight.org/pfm/tools-for-mathematics/03-calculus/solutions/main.html#question-3))\n\nConsider the second derivative $f''(x)=7\\cos(x) + x ^ 2 - \\ln(x)$\n\na. Create a variable `first_derivative` which has value $f'(x)$ (you can assume a constant of integration 0).\n\navailable marks: 12"}, {"cell_type": "code", "execution_count": 11, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q2-a"]}, "outputs": [], "source": "import sympy as sym\n\nx = sym.Symbol(\"x\")\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Create a variable `expression` that has value $f(x)$ (you can assume a constant of integration 0):\n\navailable marks: 6"}, {"cell_type": "code", "execution_count": 13, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q2-b"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Question 3 (16 marks)\n\n(__Hint__: This question is similar to the [second exercise of the Combinatorics chapter of Python for mathematics](https://vknight.org/pfm/tools-for-mathematics/05-combinations-permutations/solutions/main.html#question-2))\n\na. Create a variable `number_of_combinations` that gives the number of combinations of the letters of the alphabet of size 3. Do this by generating and counting them.\n\n_available marks: 8_"}, {"cell_type": "code", "execution_count": 15, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q3-a"]}, "outputs": [], "source": "import itertools\n\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Create a variable `number_of_combinations_by_direct_computation` that gives the number of combinations of the letters of the alphabet of size 3. Do this by computing them directly.\n\n_available marks: 8_"}, {"cell_type": "code", "execution_count": 17, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q3-b"]}, "outputs": [], "source": "import scipy.special\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Question 4 (36 marks)\n\n(__Hint__: This question is similar to the [approach describe in the Further information section of the Python for Mathematics chapter on differential equations](https://vknight.org/pfm/tools-for-mathematics/09-differential-equations/why/main.html#how-to-solve-a-system-of-differential-equations).)\n\nConsider the [Lanchaster battle equations](https://en.wikipedia.org/wiki/Lanchester%27s_laws) which can be used to model the size of two armies in battle.\n\n$$\n\\begin{cases}\n\\frac{dX(t)}{dt} = \\alpha Y(t)\\\\\n\\frac{dY(t)}{dt} = \\beta X(t)\n\\end{cases}\n$$\n\na. Obtain the general solution to this equation. Do this by:\n\n- creating a variable `X` and assigning it value the equation with right hand side the size of the army $X(t)$.\n- creating a variable `Y` and assigning it value the equation with right hand side the size of the army $Y(t)$.\n\n_Available marks: 10_"}, {"cell_type": "code", "execution_count": 19, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-a"]}, "outputs": [], "source": "x = sym.Function(\"x\")\ny = sym.Function(\"y\")\nt = sym.Symbol(\"t\")\n\nalpha = sym.Symbol(\"alpha\")\nbeta = sym.Symbol(\"beta\")\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Consider the initial sizes of the armies: $x(0) = 1000$ and $y(0) = 500$ and the fact that $\\alpha=-4/5$ and $\\beta=-11/10$. Output the particular solutions (in the same format as for question a.):\n\n_Available marks: 12_"}, {"cell_type": "code", "execution_count": 21, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-b"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "c. Create the 2 following variables:\n\n1. `end_t_value`: the value of $t$ at which the battle ends.\n2. `does_X_win`: the boolean saying if the $X$ army wins or not.\n\n_Available marks: 14_"}, {"cell_type": "code", "execution_count": 23, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-c"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}], "metadata": {"celltoolbar": "Tags", "kernelspec": {"display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.0"}}, "nbformat": 4, "nbformat_minor": 4} | ||
{"cells": [{"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Computing for Mathematics - 2024/2025 individual coursework\n\n**Important** Do not delete the cells containing: \n\n```\n### BEGIN SOLUTION\n\n\n### END SOLUTION\n```\n\nwrite your solution attempts in those cells.\n\nTo submit this notebook:\n\n- Change the name of the notebook from `main` to: `<student_number>`. For example, if your student number is `c1234567` then change the name of the notebook to `c1234567`.\n- **Write all your solution attempts in the correct locations**;\n- **Do not delete** any code that is already in the cells;\n- Save the notebook (`File>Save As`);\n- Follow the instructions given to submit."}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "#### Question 1 (30 marks)\n\n(__Hint__: This question is similar to [this section of the python for mathematics text](https://vknight.org/pfm/tools-for-mathematics/08-statistics/how/main.html#calculate-the-pearson-correlation-coefficient).)\n\nFor each of the following pairs of data $x$ and $y$ compute the Pearson correlation coefficient.\n\na. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 1, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-a"]}, "outputs": [], "source": "import statistics as st\nx = (1, 2, 3, 4, 5, 6, 7, 8, 9)\ny = (20, 10, 40, 30, 60, 50, 2, -1, -5)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b.\n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 4, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-b"]}, "outputs": [], "source": "x = (1, 7, -1, 5, 10, -4)\ny = (20, 10, 40, 30, 60, 50)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "c. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 7, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-c"]}, "outputs": [], "source": "x = (1, 7, 21)\ny = (1 / 3, 1, 3)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "d. \n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 10, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-d"]}, "outputs": [], "source": "x = (1, 2, 3, 4, 5)\ny = (-1, 1, -1, 1, -1)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "e.\n\nAvailable marks: 6"}, {"cell_type": "code", "execution_count": 13, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q1-e"]}, "outputs": [], "source": "x = (1, 2, 3, 4, 5)\ny = (0, 0, 0, 0, -1)\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Question 2 (18 marks)\n\n\n(__Hint__: This question is similar to the [third exercise of the Calculus chapter of Python for mathematics](https://vknight.org/pfm/tools-for-mathematics/03-calculus/solutions/main.html#question-3))\n\nConsider the second derivative $f''(x)=7\\cos(x) + x ^ 2 - \\ln(x)$\n\na. Create a variable `first_derivative` which has value $f'(x)$ (you can assume a constant of integration 0).\n\navailable marks: 12"}, {"cell_type": "code", "execution_count": 16, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q2-a"]}, "outputs": [], "source": "import sympy as sym\n\nx = sym.Symbol(\"x\")\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Create a variable `expression` that has value $f(x)$ (you can assume a constant of integration 0):\n\navailable marks: 6"}, {"cell_type": "code", "execution_count": 20, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q2-b"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "### Question 3 (16 marks)\n\n(__Hint__: This question is similar to the [second exercise of the Combinatorics chapter of Python for mathematics](https://vknight.org/pfm/tools-for-mathematics/05-combinations-permutations/solutions/main.html#question-2))\n\na. Create a variable `number_of_combinations` that gives the number of combinations of the letters of the alphabet of size 3. Do this by generating and counting them.\n\n_available marks: 8_"}, {"cell_type": "code", "execution_count": 24, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q3-a"]}, "outputs": [], "source": "import itertools\n\nalphabet = \"abcdefghijklmnopqrstuvwxyz\"\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Create a variable `number_of_combinations_by_direct_computation` that gives the number of combinations of the letters of the alphabet of size 3. Do this by computing them directly.\n\n_available marks: 8_"}, {"cell_type": "code", "execution_count": 27, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q3-b"]}, "outputs": [], "source": "import scipy.special\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "code", "execution_count": 29, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "outputs": [], "source": "feedback_string = \"The output is not the expected expression.\"\n\nnbchkr.check_variable_has_expected_property(\n variable_string=\"number_of_combinations_by_direct_computation\",\n feedback_string=feedback_string,\n property_check=check_answer_is_exactly_correct,\n expected_value=2600.0\n)"}, {"cell_type": "code", "execution_count": 30, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-a"]}, "outputs": [], "source": "x = sym.Function(\"x\")\ny = sym.Function(\"y\")\nt = sym.Symbol(\"t\")\n\nalpha = sym.Symbol(\"alpha\")\nbeta = sym.Symbol(\"beta\")\n\n### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "b. Consider the initial sizes of the armies: $x(0) = 1000$ and $y(0) = 500$ and the fact that $\\alpha=-4/5$ and $\\beta=-11/10$. Output the particular solutions (in the same format as for question a.):\n\n_Available marks: 12_"}, {"cell_type": "code", "execution_count": 32, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-b"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}, {"cell_type": "markdown", "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": []}, "source": "c. Create the 2 following variables:\n\n1. `end_t_value`: the value of $t$ at which the battle ends.\n2. `does_X_win`: the boolean saying if the $X$ army wins or not.\n\n_Available marks: 14_"}, {"cell_type": "code", "execution_count": 34, "metadata": {"editable": true, "slideshow": {"slide_type": ""}, "tags": ["answer:q4-c"]}, "outputs": [], "source": "### BEGIN SOLUTION\n\n\n### END SOLUTION"}], "metadata": {"celltoolbar": "Tags", "kernelspec": {"display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.0"}}, "nbformat": 4, "nbformat_minor": 4} |
Oops, something went wrong.