0% found this document useful (0 votes)
35 views

W2 Lesson 2 - Matrices - Module

1) Matrices are used to represent systems of linear equations and their solutions. 2) Operations like addition, subtraction, and multiplication can be performed on matrices to solve problems. 3) Matrices have many applications in fields like engineering, physics, economics, and statistics.

Uploaded by

Montez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

W2 Lesson 2 - Matrices - Module

1) Matrices are used to represent systems of linear equations and their solutions. 2) Operations like addition, subtraction, and multiplication can be performed on matrices to solve problems. 3) Matrices have many applications in fields like engineering, physics, economics, and statistics.

Uploaded by

Montez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Numerical Methods

1
Matrices

Module 02 Matrices

Matrices are typically used to represent systems of linear equations. The


solution to these equations can be achieved through various methods one the
few steps to do this finding the determinant of the matrix. The properties of
the matrices must be understood to be able to perform the operations fitted
to find the solution.
At the end of this module, you will be able to:
1. Understand the concept of matrix notation.
2. Perform arithmetic of matrices such as addition, subtraction,
multiplication by a constant and multiplication of two matrices and
inverse of a matrix.
3. Identify the determinants of matrices.
There are a lot of applications where knowledge in matrix is of use. Matrix
notation and algebra are useful because they provide a concise way to
represent and manipulate linear algebraic equations. Matrices can be used to
represent dimension of images therefore, alterations using operations
performed by computer programs can be done. Also, linear systems
represented by linear equations can also be represented by matrix notation
and could allow finding a solution for particular problems.

Matrix
A matrix is a rectangular array of elements (either numbers or symbols), which are
arranged in rows and columns. Figure 1 shows an example of a matrix.

Column 1

𝑎11 𝑎12 … 𝑎1𝑛


𝑎21 𝑎22 ⋱ 𝑎2𝑛 Row 2
A=[ ⋮ ⋱ ⋱ ⋮ ]
𝑎𝑚1 𝑎𝑚2 … 𝑎𝑚𝑛
Figure 1. A matrix

A matrix is denoted by an uppercase letter. The entries inside the bracket are called
the elements, in this example, denoted by the lowercase letter. Each element has a
unique address, in this example denoted by its letter and subscript aij (for i = 1, 2, …
m and j = 1, 2, …n) . The element a21 (simply read as “a two-one”), is located at row 2,
column 1The order of the subscript is described by row first then column address.
The size of the matrix is determined by the dimension of the matrix. In this example,
A is an m by n or (m x n) matrix.
Course Module
A matrix that has the same number of columns as rows is called a square matrix. In
this case where m = n, all the elements in a11, a22, a33 up amn is called the main
diagonal.
Example
3 0.5 2
B=[ 2 1 0.75]
−1 0 1.5
1. B is a 3 by 3 matrix.
2. B is a square matrix.
3. The element at row 2 column 3 (or simply “two-three”) is 0.75.

Matrices have wide applications in engineering, physics, economics, and


statistics as well as in various branches of mathematics. Historically, it was
not the matrix but a certain number associated with a square array of
numbers called the determinant that was first recognized. Only gradually did
the idea of the matrix as an algebraic entity emerge. The term matrix was
introduced by the 19th-century English mathematician James Sylvester, but
it was his friend the mathematician Arthur Cayley who developed the
algebraic aspect of matrices in two papers in the 1850s. Cayley first applied
them to the study of systems of linear equations, where they are still very
useful.

Types of Matrices
Below are the types of matrices that could represent values .
1. Row vector is a special type of matrix which has only one row. A row vector is a
1 x n matrix. It is denoted by a boldface lowercase letter.

Example
f = fi = [ f1 f2 f3]

Row vector f is a 1 x 3 matrix.

2. Column vector is another special type of matrix which has only one column. A
column vector is a n x 1 matrix. It is also denoted by a boldface lowercase letter.

Example
𝑔1
𝑔2
g = gj = [𝑔 ]
3
𝑔4

Column vector g is a 4 x 1 matrix.

3. Square matrix, as mentioned above is a matrix where m = n. It is denoted by an


uppercase letter
Numerical Methods
3
Matrices

Example

𝑎11 𝑎12
H = [𝑎 𝑎22 ]
21

H is a 2 x 2 square matrix.

4. Diagonal matrix is a square matrix with all elements equal to zero except the
elements in the main diagonal.

Example

𝑎11 0 0
K=[ 0 𝑎22 0 ]
0 0 𝑎33
K is a diagonal matrix.
5. Identity matrix is a matrix whose diagonal elements are equal to 1 and the rest
equal to 0.

Example
1 0 0 0
0 1 0 0
I=[ ]
0 0 1 0
0 0 0 1

6. Triangular matrix is a square matrix in which all of the elements on one side of
the main diagonal are zero. The remaining elements may be zero or not. If the
elements below the main diagonal are all zero, the matrix is called the upper
triangular matrix. If the elements above the main diagonal matrix are all zero,
the matrix is called the lower triangular matrix.
Example
𝑎11 𝑎12 𝑎13 𝑎14
0 𝑎22 𝑎23 𝑎24
U= [ 0 0 𝑎33 𝑎34 ]
0 0 0 𝑎44

U is a 4 x 4 upper triangular matrix.


𝑎11 0 0 0
𝑎21 𝑎22 0 0
L=[ ]
𝑎31 𝑎32 𝑎33 0
𝑎41 𝑎42 𝑎43 𝑎44
L is a 4x4 lower triangular matrix.
7. A banded matrix has all elements equal to zero, with the exception of a band
centered on the main diagonal
Course Module
𝑎11 𝑎12 0 0
𝑎 𝑎22 𝑎23 0
T = [ 21 ]
0 𝑎32 𝑎33 𝑎34
0 0 𝑎43 𝑎44
The above matrix has a bandwidth of 3 and is given a special name—the tridiagonal
matrix.

Arithmetic of Matrices
Arithmetic of matrices involves operations such as matrix addition, subtraction and
multiplication. An operation called the inverse of a matrix is used in place of the
matrix division since division of matrices is not defined.

Matrix Addition and Subtraction


An important note when trying to add or subtract the matrices, the matrices should
be of the same size or dimension. Those matrices which do not have the same size
cannot be added nor subtracted. Associative property of addition also applies for
matrices.
Matrix addition can be best described by the example below.
Example
Find A + B.
2 1 3 0 −3 2
A=[ ]; B=[ ]
−1 2 4 2 1 4
Addition and subtraction of matrices should be done according to the address of the
element. For example, element a11 of matrix A should be added to a11 of matrix B.
Again, the subscript which corresponds to the row-column address of the element
should be considered. So the element at row 2 column 2 of matrix A, should be added
to the element of the same column and row in to matrix B, that is row 2 column 2
also. The sum of the two matrices given above is:

2 −2 5
A+B=[ ]
1 3 4

Subtraction of matrices is just as easy, just check on the signs (positive or negative)
to avoid human error.

Example
Find A - B.
2 4 1
A-B=[ ]
−3 1 0

Matrix Multiplication
Numerical Methods
5
Matrices

Multiplication of a matrix by a constant.


It is simply done by multiplying each element of the matrix to the constant.

Example
Find 3A.

2 1 3
A=[ ]
−1 2 4
The answer is just a scaled version of A which is simply 3 multiplied by each
element of A.
6 3 9
3A = [ ]
−3 6 12

Multiplication of matrices
The first thing that must be checked when trying to multiply two matrices is that,
the number of column of the first matrix should be equal to the number of the rows
of the second matrix.
Example
Find AB.

1 2
2 1
A = [1.5 0] ; B = [ ]
0.5 −1
−1 3

Again, check if the number of columns of the first matrix, is the same as the numbers
of rows in the second. Since A is a 3 x 2 matrix and B is a 2 x 2 matrix, therefore,
matrix multiplication may proceed. Each element of the column will be multiplied to
the corresponding row then added. Matrix multiplication would be demonstrated
below.
The resulting dimension of the product of the two matrices is the product of the row
and column of the first and second matrices, respectively which is illustrated in
Figure 2 below.

This two should have the


same values for matrix
multiplication to proceed

Course Module
3x2 2x2

The result is a 3 x 2 matrix for this example.

Figure 2. Illustration of matrix multiplication requirement and result.

1 3
2 1
A = [1.5 0] ; B = [ ]
0.5 −1
−1 3
(1 ∗ 2) + (3 ∗ 0.5) (1 ∗ 1) + (3 ∗ (−1))
AB = [(1.5 ∗ 2) + (0 ∗ 0.5) (1.5 ∗ 1) + (0 ∗ −1) ]
(−1 ∗ 2) + (3 ∗ 0.5) (−1 ∗ 1) + (3 ∗ −1)

The result product of A and B is


3.5 −2
AB = [ 3 1.5]
−0.5 −4

Additive and distributive property is applicable to matrices but generally not


the commutative property.
Matrix multiplication is not generally commutative meaning, matrix A
multiplied by B may not be equal to B multiplied by A. This might be the first
time that commutative property is not applicable in multiplication.
Say for example, 4 multiplied by 2 is the same as 2 multiplied by 4. But for
matrices, a 2 x 4 matrix multiplied by a 3 x 2 matrix is not acceptable even if
it is rearranged as 3 x 2 and 2 x 4

Inverse of a Matrix
Suppose a matrix A is given as
𝑎11 𝑎12
A =[𝑎 𝑎22 ]
21

The inverse of a two-dimensional square matrix can be represented simply by

𝑎22 −𝑎12
A -1= [−𝑎 𝑎11 ]
21

The multiplication of a matrix by the inverse is analogous to division, in the sense


that a number divided by itself is equal to 1. Multiplication of a matrix by its inverse
leads to the identity matrix.
Numerical Methods
7
Matrices

It is important to note the requirements for the size of the matrix to perform
certain operations. In matrix addition and subtraction, the dimension of the
matrices should be the same; otherwise, the operations cannot be performed.
Multiplying matrices, the columns and rows must be checked first before
trying to proceed with element by element multiplication, otherwise, the
operations cannot be performed

Determinants of a Matrix
Determinants are mathematical objects that are very useful in the analysis and
solution of systems of linear equations. Determinants are defined only for square
matrices.
The determinant can be illustrated for a set of three linear equations given as
𝑎11 𝑥 + 𝑎12 𝑦 + 𝑎13 𝑧 = 0
𝑎21 𝑥 + 𝑎22 𝑦 + 𝑎23 𝑧 = 0
𝑎31 𝑥 + 𝑎32 𝑦 + 𝑎33 𝑧 = 0

These equations can be translated into a coefficient matrix.


𝑎11 𝑎12 𝑎13
[A]=[𝑎21 𝑎22 𝑎23 ]
𝑎31 𝑎32 𝑎33

The determinant D of this system is formed from the coefficients of the equation, as in
𝑎11 𝑎12 𝑎13
D = |𝑎21 𝑎22 𝑎23 |
𝑎31 𝑎32 𝑎33
Notice that the notation uses as symbol | | which is also similar to the symbol of absolute
value. Although the elements of both the coefficient matrix and determinant are the same,
the mathematical concept of the two is different.

For example the determinant of a 2 x 2 matrix is

𝑎11 𝑎12
D = |𝑎 𝑎22 |
21

is computed by
D = 𝑎11 𝑎22 - 𝑎12 𝑎12
Course Module
For the third-order case, or a 3 x 3 matrix,
𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
D =𝑎11 |𝑎 | - 𝑎12 | | + 𝑎13 | 𝑎32 |
32 𝑎33 𝑎31 𝑎33 𝑎31

There is a pattern for this

For a 2 x 2 matrix
𝑎11 𝑎12
D = |𝑎 𝑎22 |
21

The blue arrow which starts from a11 going downward right to a22 is positive and the red
arrow which starts from a12 going downward left to a22 is negative giving,
D = 𝑎11 𝑎22 - 𝑎12 𝑎12

For a 3 x 3 matrix
𝑎11 𝑎12 𝑎13
D = |𝑎21 𝑎22 𝑎23 |
𝑎31 𝑎32 𝑎33

Again blue arrows signify the positive and red ones negative.
𝑎11 𝑎12 𝑎13
D=| 𝑎22 𝑎23 | - |𝑎 21 𝑎23 | + |𝑎21 𝑎22 |
𝑎32 𝑎33 𝑎31 𝑎33 𝑎31 𝑎32

Which will give us this


𝑎22 𝑎23 𝑎21 𝑎23 𝑎21 𝑎22
D =𝑎11 |𝑎 𝑎33 | - 𝑎12 | 𝑎31 𝑎33 | + 𝑎13 |𝑎31 𝑎32 |
32

Distribute the value of a11, a12 and a13 for their respective matrices and perform the usual
operation for finding the determinant of a 2 x2 matrix as denoted by the | | sign.
Notice that those elements in the row and column of a11. The same goes to a12 and a13. The
operation between the matrices also takes an alternate sign of positive and negative. The
pattern will continue to any square matrix.

Example
2 −1 3
D = |6 1 4|
5 2 1
Numerical Methods
9
Matrices

Solution
1 4 6 4 6 1
D =2 | | - (−1) | | + 3| |
2 1 5 1 5 2

D = (2) (1 -8) – (-1) (6-20) + (3) (12 – 5)


= (2) (-7) – (-1) (-14) + (3) (7)
= (-14) – (14) + 21
D = -7

In getting the determinant of a matrix to systems of linear equations, the


following should be performed:
1. In finding the determinant of a matrix, it must be a square matrix. That is,
the number of rows must be equal to number of columns
2. Translate into coefficient matrix
3. Write in the form of determinants matrix. Although the they look the
same, the matrix is enclosed in a bracket [ ]while the determinant in a
two parallel lines | | to distinguish their mathematical value.
4. Perform the operation in finding the determinant.

References and Supplementary Materials


Books and Journals
Cheney, E Ward (2013). Numerical Mathematics and Computing Cengage Learning; 7th
ed.
Gilat, A. (2011). Numerical methods : An Introduction with Applications using MATLAB.
Wiley.Publishing Inc. Indianapolis, Indiana

Online Supplementary Reading Materials


Stapel, Elizabeth. "Matrix Multiplication Defined." Purplemath. Available from
http://www.purplemath.com/modules/mtrxmult2.htm. Accessed 05 August 2017
Weisstein, Eric W. "Determinant." From MathWorld--A Wolfram Web Resource.
http://mathworld.wolfram.com/Determinant.html. Accessed 05 August 2017

Course Module
The Editors of Encyclopædia Britannica. Matrix. Encyclopædia Britannica. Encyclopædia
Britannica, inc. January 16, 2017. https://www.britannica.com/topic/matrix-
mathematics. 05 August 2017
Matrices and Arrays.https://www.mathworks.com/help/matlab/learn_matlab/matrices-
and-arrays.html. Date accessed: September 27, 2017

Online Instructional Videos


Finding the determinant of a 2x2 matrix | Matrices | Precalculus | Khan Academy.
https://www.youtube.com/watch?v=OU9sWHk_dlw. Date accessed: September 27, 2017
3 x 3 determinant | Matrix transformations | Linear Algebra | Khan Academy.
https://www.youtube.com/watch?v=0c7dt2SQfLw. Date accessed: September 27, 2017
MATLAB Tutorial 2 - Creating Matrices and Matrix Math.
https://www.youtube.com/watch?v=3HnyHcy7Dnc. Date accessed: September 27, 2017

You might also like