Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some course notes and fix about page #354

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions _assessment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ tag: assessment

A series of 6 individual tests:

- Test 1: [Algebra]({{ site.baseurl }}/topics/algebra.html) and [Calculus]({{ site.baseurl }}/topics/calculus.html)
- Test 2: [Combinatorics]({{ site.baseurl }}/topics/combinatorics.html) and [Probability]({{ site.baseurl }}/topics/probability.html)
- Test 3: [Matrices]({{ site.baseurl }}/topics/matrices.html) and [Sequences]({{ site.baseurl }}/topics/sequences.html)
- Test 4: [Statistics]({{ site.baseurl }}/topics/statistics.html) and [Differential Equations]({{ site.baseurl }}/topics/differential-equations.html)
- Test 1: [Algebra]({{ site.baseurl }}/topics/algebra.html) and [Calculus]({{ site.baseurl }}/topics/calculus.html) (released Week 3 of Autumn Semester)
- Test 2: [Combinatorics]({{ site.baseurl }}/topics/combinatorics.html) and [Probability]({{ site.baseurl }}/topics/probability.html) (released Week 5 of Autumn Semester).
- Test 3: [Matrices]({{ site.baseurl }}/topics/matrices.html) and [Sequences]({{ site.baseurl }}/topics/sequences.html) (released Week 7 of Autumn Semester).
- Test 4: [Statistics]({{ site.baseurl }}/topics/statistics.html) and [Differential Equations]({{ site.baseurl }}/topics/differential-equations.html) (released Week 9 of Autumn Semester).
- Test 5: [Variables, conditional statements and while loops]({{ site.baseurl }}/topics/variables-conditional-statements-and-while-loops.html) and [Functions and
data structures]({{ site.baseurl }}/topics/functions-and-data-structures.html)
data structures]({{ site.baseurl }}/topics/functions-and-data-structures.html) (released Week 2 of Spring Semester).
- Test 6: [Object Oriented Programming]({{ site.baseurl }}/topics/object-oriented-programming.html) and [Using a terminal and an
editor]({{ site.baseurl }}/topics/using-a-terminal-and-an-editor.html).
editor]({{ site.baseurl }}/topics/using-a-terminal-and-an-editor.html) (released Week 4 of Spring Semester).

You can complete each test when it is released. The deadline for completing all
of them is at the end of the Spring Semester.
Expand Down
105 changes: 105 additions & 0 deletions _class-notes/about-the-course.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
layout: class-notes
title: "About the course"
tags: about
---

## First meeting

After this meeting students should:

- Know me a bit
- Understand how and why programming can be used to study mathematics.
- Know where all class resources are
- Know what they need to do to prepare for their first class

### Introduce myself

- Pick 4 or 5 pictures of my family and I to introduce myself.
- Mathematician (where/what I studied)
- Trustee of the UK Python association https://uk.python.org
- Conference and workshop organiser
- Editor for JOSS
- Fellow of the sustainable software institute
- Maintainer of a number of open source scientific research packages

There are slide for this [here]{{site.baseurl}}/assets/about/main.key).

### Programming

---

1. Class exercise: get a class word cloud association for the word "programming". (Using mentimeter.com).
2. Class exercises: get a class word cloud association "What are uses for programming
in Mathematics?"

- Proving theorems;
- Obtaining conjectures;
- Implementing tools.

### Location of class resources

- Show site: https://vknight.org/cfm/
- Show recordings
- Discuss discord

### Office hours

Discuss office hours with students

Direct students at my teaching philosophy page: <https://vknight.org/tch-phi/>

### Course materials

Discuss the philosophy of the main text, specifically discussing this
<https://vknight.org/pfm/overview/introduction/main.html#fig-knowledge-vs-technique>

Discuss structure of the book.

- Timetable:

- Discuss the actual timetable.

Discuss this diagram: :download:`Week structure </_static/week_structure/main.pdf>`

Discuss this diagram: :download:`Understanding </_static/understanding/main.pdf>`

- Assessment.

- For first lab session: work through chapter 1. Give a brief demo.

## After class email

Send the following email after class::

Hi all,

A recording of today's class is available at <>.

In this class we discussed multiple things about the class itself:

- Course documents available here: https://vknight.org/cfm/
- We agreed that office hours will be: <>
- Here is an invite to the discord if you have not already joined it:
- You can find my teaching philosophy here: https://vknight.org/tch-phi/

In preparation for your tutorial tomorrow please work through the first
chapter of the Python for mathematics book:
https://vknight.org/pfm/tools-for-mathematics/01-using-notebooks/introduction/main.html

Please get in touch if I can assist with anything,
Vince

## Second meeting

- Give brief review of the contents of the chapter. Do this by browsing
through: https://vknight.org/pfm/tools-for-mathematics/01-using-notebooks/how/main.html
- Ask if anyone has any questions/comments/feedback.
- Remind everyone about the resources available to them (videos both on youtube
and LC, chapters, plan, discord etc...).
- Explain that the following things seemed to be the main ones to come up:
1. Finding files on computer.
2. Difference between markdown and code cell.
3. Using brackets when doing computations.

For each of those do a small walk-through showing the concepts again.
169 changes: 169 additions & 0 deletions _class-notes/algebra.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
---
layout: class-notes
title: "Algebra"
tags: algebra
---

## First meeting

After this meeting students should:

- Understand how to use the Sympy library to carry out basic Algebraic
tasks.
- Know what they need to do to prepare for their second tutorial.

### Problem

Explain to students that we will be solving the following problem:

1. Rationalise the following expression: $\frac{1}{\sqrt{3} + 1}$.

2. Consider the quadratic $f(x) = -x ^ 2 + 8 x - 18$.

> 1. Calculate the discriminant of the quadratic equation $f(x)=0$.
> What does this tell us about the graph of $f(x)$.
> 2. By completing the square, confirm that $(4, -2)$ is the
> maximum of point of $f(x)$.

### Solution

Group exercise (breakout rooms of 3): ask students to spend 5 minutes
writing a plan to tackle that problem (not necessarily carrying out each
step).

Clearly write down these steps:

1. For first question: multiply by $\sqrt{3} - 1$.
2. Calculate discriminant: compare to 0. If negative: no roots.
3. Complete the square to make $f(x) = a (x - b ) ^2 + c$. Do this by
expending that formula and comparing coefficients.

Now show how to get code to do this:

>>> import sympy
>>> expression = 1 / (sympy.sqrt(3) + 1)
>>> expression
1/(1 + sqrt(3))
>>> sympy.simplify(expression)
-1/2 + sqrt(3)/2

Discuss here how this differs if we used `math.sqrt`. Explain that
`sympy.simplify` is essentially acting as a black box here.

Now to carry out the rest of the problem:

>>> x = sympy.Symbol("x")
>>> expression = - x ** 2 + 8 * x - 18
>>> expression
-x**2 + 8*x - 18
>>> sympy.discriminant(expression)
-8

Confirm results by hand.

Discuss what this implies:

- Quadratic equation has no real roots.
- Graph does not intersect the $y=0$ line.
- Concave parabola (sign of leading coefficient of quadratic).

Confirm by solving the quadratic equation:

>>> equation = sympy.Eq(lhs=expression, rhs=0)
>>> equation
Eq(-x**2 + 8*x - 18, 0)

>>> sympy.solveset(expression, x)
{4 - sqrt(2)*I, 4 + sqrt(2)*I}

Now to move on to next part of the problem: completing the square:

>>> a, b, c = sympy.Symbol("a"), sympy.Symbol("b"), sympy.Symbol("c")
>>> completed_square = a * (x - b) ** 2 + c
>>> completed_square
a*(-b + x)**2 + c

Let us expand and compare the coefficients:

>>> sympy.expand(completed_square)
a*b**2 - 2*a*b*x + a*x**2 + c

We see that $a$ is $-1$. Let us substitute this value in to the
expression:

>>> completed_square.subs({a: -1})
c - (-b + x)**2

We can in fact overwrite the expression:

>>> completed_square = completed_square.subs({a: -1})
>>> completed_square
c - (-b + x)**2

If we now expand again and compare coefficients:

>>> sympy.expand(completed_square)
-b**2 + 2*b*x + c - x**2

We see that $2b=8$. Despite the fact that this equation is relatively
straightforward, let us solve it using `sympy`:

>>> equation = sympy.Eq(lhs=2 * b, rhs=8)
>>> sympy.solveset(equation, b)
{4}

We will substitute this value for $b$ back in to the completed square,
and expand again:

>>> completed_square = completed_square.subs({b: 4})
>>> completed_square
c - (x - 4)**2
>>> sympy.expand(completed_square)
c - x**2 + 8*x - 16

We see that $c - 16=-18$. Let us again solve that equation using
$sympy$:

>>> equation = sympy.Eq(lhs=c - 16, rhs= -18)
>>> sympy.solveset(equation, c)
{-2}

We will substitute this value back in:

>>> completed_square = completed_square.subs({c: -2})
>>> completed_square
-(x - 4)**2 - 2
>>> sympy.expand(completed_square)
-x**2 + 8*x - 18

Ask students to break out in to groups of 3 and do the following:

1. Confirm that this answers the question.
2. Explain to each other what we did using code.

Come back: with time take any questions.

Point at resources.

## After class email

Send the following email after class:

Hi all,

A recording of today's class is available at <>.

In this class I went over a demonstration of using Python to solve an
algebraic problem. I did the following mathematical techniques:

- Simplifying an exact numerical expression.
- Calculating the discriminant of a quadratic.
- Solving a symbolic equation.
- Substitute values in to a symbolic expression.

In preparation for your tutorial tomorrow please work through the second
chapter of the Python for mathematics book:
https://vknight.org/pfm/tools-for-mathematics/02-algebra/introduction/main.html

Please get in touch if I can assist with anything,
Vince
Loading
Loading