Matrices

DEFINITION:A matrix is defined as an ordered rectangular array of numbers. They can be used to represent systems of linear equations, as will be explained below.

A Matrix is an array of numbers:


A Matrix
(This one has 2 Rows and 3 Columns)

We talk about onematrix, or severalmatrices.

There are many things we can do with them...

Types of Matrices

Row Matrix

A row matrix is formed by a single row.

Column Matrix

A column matrix is formed by a single column.

Rectangular Matrix

A rectangular matrix is formed by a different number of rows and columns, and its dimension is noted as:mxn.

Square Matrix

A square matrix is formed by the same number of rows and columns.

The elements of the formaiiconstitute the principal diagonal.

The secondary diagonal is formed by the elements withi+j = n+1.

Zero Matrix

In a zero matrix, all the elements are zeros.

Upper Triangular Matrix

In an upper triangular matrix, the elements located below the diagonal are zeros.

Lower Triangular Matrix

In a lower triangular matrix, the elements above the diagonal are zeros.

Diagonal Matrix

In a diagonal matrix, all the elements above and below the diagonal are zeros.

Scalar Matrix

A scalar matrix is a diagonal matrix in which the diagonal elements are equal.

Identity Matrix

An identity matrix is a diagonal matrix in which the diagonal elements are equal to 1.

Transpose Matrix

Given matrix A, the transpose of matrix A is another matrix where the elements in the columns and rows have switched. In other words, the rows become the columns and the columns become the rows.

(At)t= A

(A + B)t= At+ Bt

(α·A)t= α · At

(A ·B)t= Bt· At

Regular Matrix

A regular matrix is a square matrix that has an inverse.

Singular Matrix

A singular matrix is a square matrix that has no inverse.

Idempotent Matrix

The matrix A is idempotent if:A2= A.

Involutive Matrix

The matrix A is involutive if:A2= I.

Symmetric Matrix

A symmetric matrix is a square matrix that verifies:

A = At.

Anti-symmetric Matrix

An anti-symmetric matrix is a square matrix that verifies:A = −At.

Orthogonal Matrix

A matrix is orthogonal if it verifies that:A · At= I.

Matrix Addition and Subtraction

DEFINITION:Two matrices A and B can be added or subtracted if and only if their dimensions are the same (i.e. both matrices have the same number of rows and columns. Take:

Addition

If A and B above are matrices of the same type then the sum is found by adding the corresponding elementsaij+bij.

Here is an example of adding A and B together.

Subtraction

If A and B are matrices of the same type then the subtraction is found by subtracting the corresponding elementsaij−bij.

Adding

To add two matrices: add the numbers in the matching positions:

These are the calculations:

3+4=7 / 8+0=8
4+1=5 / 6-9=-3

The two matrices must be the same size, i.e. the rows must match in size, and the columns must match in size.

Example: a matrix with3 rowsand5 columnscan be added to another matrix of3 rowsand5 columns.

But it could not be added to a matrix with3 rowsand4 columns(the columns don't match in size)

Negative

The negative of a matrix is also simple:

These are the calculations:

-(2)=-2 / -(-4)=+4
-(7)=-7 / -(10)=-10

Subtracting

To subtract two matrices: subtract the numbers in the matching positions:

These are the calculations:

3-4=-1 / 8-0=8
4-1=3 / 6-(-9)=15

Note: subtracting is actually defined as theadditionof a negative matrix: A + (-B)

Matrix Multiplication

DEFINITION:When the number of columns of the first matrix is the same as the number of rows in the second matrix then matrix multiplication can be performed.

Multiply by a Constant

We can multiply a matrix by some value:

These are the calculations:

2×4=8 / 2×0=0
2×1=2 / 2×-9=-18

We call the constant ascalar, so officially this is called"scalar multiplication".

Multiplying a Matrix by another Matrix

But to multiply a matrixby another matrixwe need to do the "dot product" of rows and columns ... what does that mean? Let us see with an example:

To work out the answer for the1st rowand1st column:

The "Dot Product" is where wemultiply matching members, then sum up:

(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58

We match the 1st members (1 and 7), multiply them, likewise for the 2nd members (2 and 9) and the 3rd members (3 and 11), and finally sum them up.

Want to see another example? Here it is for the 1st row and2nd column:

(1, 2, 3) • (8, 10, 12) = 1×8 + 2×10 + 3×12 = 64

We can do the same thing for the2nd rowand1st column:

(4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139

And for the2nd rowand2nd column:

(4, 5, 6) • (8, 10, 12) = 4×8 + 5×10 + 6×12 = 154

And we get:

Order of Multiplication

In arithmetic we are used to:

3 × 5 = 5 × 3
(TheCommutative Lawof Multiplication)

But this isnotgenerally true for matrices (matrix multiplication isnot commutative):

AB ≠ BA

When we change the order of multiplication, the answer is (usually)different.

Example:

See how changing the order affects this multiplication:

Identity Matrix

The "Identity Matrix" is the matrix equivalent of the number "1":


A 3x3 Identity Matrix

  • It is "square" (has same number of rows as columns),
  • It has1s on the diagonal and0s everywhere else.
  • Its symbol is the capital letterI.

It is aspecial matrix, because when we multiply by it, the original is unchanged:

A × I = A

I × A = A

Transpose of Matrices

DEFINITION:The transpose of a matrix is found by exchanging rows for columns i.e. Matrix A = (aij) and the transpose of A is:

AT= (aji) where j is the column number and i is the row number of matrix A.

For example, the transpose of a matrix would be:

In the case of a square matrix (m = n), the transpose can be used to check if a matrix is symmetric. For a symmetric matrix A = AT.

Now try an example

Transposing

To "transpose" a matrix, swap the rows and columns. We put a "T" in the top right-hand corner to mean transpose:

The Determinant of a Matrix

DEFINITION:Determinants play an important role in finding the inverse of a matrix and also in solving systems of linear equations. In the following we assume we have a square matrix (m = n). The determinant of a matrix A will be denoted by det(A) or |A|. Firstly the determinant of a 2×2 and 3×3 matrix will be introduced, then the n×n case will be shown.

Determinant of a 2×2 matrix

Assuming A is an arbitrary 2×2 matrix A, where the elements are given by:

then the determinant of a this matrix is as follows:

Now try an example of finding the determinant of a 2×2 matrix yourself.

Determinant of a 3×3 matrix

The determinant of a 3×3 matrix is a little more tricky and is found as follows (for this case assume A is an arbitrary 3×3 matrix A, where the elements are given below).

then the determinant of a this matrix is as follows:

Now try an example of finding the determinant of a 3×3 matrix yourself.

The Inverse of a Matrix

DEFINITION:Assuming we have a square matrix A, which is non-singular (i.e. det(A) does not equal zero), then there exists an n×n matrix A-1which is called the inverse of A, such that this property holds:

AA-1= A-1A = I, where I is the identity matrix.

The inverse of a 2×2 matrix

Take for example aarbitury 2×2 Matrix A whose determinant (ad − bc) is not equal to zero.

wherea,b,c,d are numbers, The inverse is:

Now try finding the inverse of your own 2×2 matrices.

Solving Systems of Equations using Matrices

DEFINITION:A system of linear equations is a set of equations with n equations and n unknowns, is of the form of

The unknowns are denoted by x1, x2, ...,xnand the coefficients (a and b above) are assumed to be given. In matrix form the system of equations above can be written as:

A simplified way of writing above is like this:Ax =b

Now, try putting your own equations into matrix form.

After looking at this we will now look at two methods used to solve matrices. These are:

  • Inverse Matrix Method
  • Cramer's Rule

Inverse Matrix Method

DEFINITION:The inverse matrix method uses the inverse of a matrix to help solve a system of equations, such like the aboveAx =b. By pre-multiplying both sides of this equation by A-1gives:

or alternatively

So by calculating the inverse of the matrix and multiplying this by the vector b we can find the solution to the system of equations directly. And from earlier we found that the inverse is given by

From the above it is clear that the existence of a solution depends on the value of the determinant of A. There are three cases:

  1. If the det(A) does not equal zero then solutions exist using
  2. If the det(A) is zero and b=0 then the solution will be not be unique or does not exist.
  3. If the det(A) is zero and b=0 then the solution can be x = 0 but as with 2. is not unique or does not exist.

Looking at two equations we might have that

Written in matrix form would look like

and by rearranging we would get that the solution would look like

Now try solving your own two equations with two unknowns.

Similarly for three simultaneous equations we would have:

Written in matrix form would look like

and by rearranging we would get that the solution would look like

Now try solving your own three equations with three unknowns.

Cramer's Rule

DEFINITION:Cramer's rule uses a method of determinants to solve systems of equations. Starting with equation below,

The first term x1above can be found by replacing the first column of A by. Doing this we obtain:

Similarly for the general case for solving xrwe replace the rthcolumn of A byand expand the determinant. This method of using determinants can be applied to solve systems of linear equations. We will illustrate this for solving two simultaneous equations in x and y and three equations with 3 unknowns x, y and z.

Two simultaneous equations in x and y

To solve use the following:

or simplified:

Now try solving two of your own equations.

Three simultaneous equations in x, y and z

ax + by + cz = p
dx + ey + fz = q
gx + hy + iz = r

To solve use the following:

Now try solving your own three equations.