## Maths for Apps lecture 1

23rd September 2002

These notes are for Dr Daniel Richardson’s course “Mathematics for Applications I” at the University of Bath.The required text book is “Linear Algebra with Applications” by G. Williams, published by Jones and Bartlett

### Linear Equations

An equation such as:

x + 3y = 9

is called a linear equation.

The solution is the collection of pairs of real numbers x and y for which that equation is true. The graph of the solution is a straight line on the xy plane.

Consider a system of two equations in x and y, for example:

x + 3y = 9

-2x + y = -4

A pair (x, y) satisfying *both* equations is a solution of the system. Typically, there will be a single solution where the two graphs intersect.

For systems of 2 equations in 2 unknowns there are three possibilities:

- The two lines intersect, giving one solution
- The two lines are parallel, giving no solution
- The two lines are identical, giving many solutions

So, for two equations with two unknowns you can not have any result that is not covered by the above scenarios.

#### 3 dimensional case

The solution of one equation, 3 unknowns:

ax + by + cz = d

a, b, c and d are constants

The solution is a plane in xyz space.

Now try a system of 3 equations in 3 unknowns:

a_{11}x + a_{12}y + a_{13}z = b_{1}

a_{21}x + a_{22}y + a_{23}z = b_{2}

a_{31}x + a_{32}y + a_{33}z = b_{3}

This typically has a single unique solution, as there are 3 intersecting planes in xyz space. This can be imagined by visualising two intersecting planes (which intersect along a line) and then visualising the third plane intersecting that line at a point. Again we can have one solution, no solutions (for parallel planes) or many solutions. The many solutions case has several possibilities, including:

- Two planes intersect to form a line, the other plane is parallel to and intersects that line
- All planes are the same

This one, many or none model works no matter how many equations or unknowns are involved.

In general, we will study systems of n linear equations in m unknowns using the following notation:

a_{11}x_{1} + a_{12}x_{2} + ... + a_{1m}x_{m} = b_{1}

.

.

.

a_{n1}x_{1} + a_{n2}x_{2} + ... + a_{nm}x_{m} = b_{n}

So a_{ij} is the coefficient of x_{j} in equation i.

We will represent such systems using matrices.

### Matrices

A matrix us a rectangular array of numbers. The numbers in the array are caled elements.

#### Example:

(columns) C1 C2 C3 [2 1 5] R1 (rows) A = [3 4 6] R2

A[i, j] = the element in row i, column j e.g A[2, 3] = 6 in the above example.

A submatrix is a matrix obtained by delting some rows and/or columns from a matrix.

#### Terminology:

- Square Matrix
- A matrix with the same number of rows and columns
- Identity Matrix
Square matrix with 1s on the diagonal (top-left to bottom-right) and 0s elsewhere, i.e:

{ 1 if i == j I[i, j] = { 0 if i != j

- Row matrix
- One row, [a
_{1}... a_{m}] - Column matrix:
- One column

We can use matrices to describe systems of equations:

3x + 2y + z = 1 [ 3 2 1 ] x - y + z = 0 has matrix of coefficients [ 1 -1 1 ] 2x + y - z = 3 [ 2 1 -1 ]

This can be extended to create the augmented matrix for the system, which adds an extra column showing the equation results:

[ 3 2 1 1 ] [ 1 -1 1 0 ] [ 2 1 -1 3 ]

Elementary transformations are used to change a system of equations in to another simpler system with the same solution. These correspond to *elementary row operations* on matrices.

The elementary row operations are things you can do to the augmented matrix that will not change the solution. They are:

- Interchange two rows (obviously has no effect)
- Multiply a row by a
*non-zero*constant - Subtract a multiple of one row from another

The third ELO will alter the goemetry of the system (as visualised in xyz space) but it will not change the solution of the system.

#### Notation

A => B means A can be changed to B by one ELO.

A =>* B means A can be changed to B by a sequence of ELOs.

A =>* B is reversible, as each of the ELOs can be easily reversed.

## More recent articles

- Weeknotes: a staging environment, a Datasette alpha and a bunch of new LLMs - 6th August 2024
- Datasette 1.0a14: The annotated release notes - 5th August 2024
- Weeknotes: GPT-4o mini, LLM 0.15, sqlite-utils 3.37 and building a staging environment - 19th July 2024