Unit 9 MATRIX
Unit 9 MATRIX
There are rules for adding, subtracting and "multiplying" matrices together, but the rules
are different than for numbers. As an example, does not always give the same
result as , which is the case for the multiplication of ordinary numbers. A matrix
can have more than 2 dimensions, such as a 3D matrix. Also, a matrix can be one-
dimensional, as a single row or column.
Many natural sciences use matrices quite a lot. In many universities, courses about
matrices (usually called linear algebra) are taught very early, sometimes even in the first
year of studies. Matrices are also very common in computer science.
The horizontal lines in a matrix are called rows and the vertical lines are called columns.
A matrix with m rows and n columns is called an m-by-n matrix (or m×n matrix) and m
and n are called its dimensions.
The places in the matrix where the numbers are, are called entries. The entry of a matrix
A that lies in the row number i and column number j is called the i,j entry of A. This is
written as A[i,j] or aij.
Example
The matrix
Addition
The sum of two matrices is the matrix, which (i,j)-th entry is equal to the sum of the (i,j)-
th entries of two matrices:
So with Numbers:
1. two matrices can be multiplied with each other even if they have different
dimensions, as long as the number of columns in the first matrix is equal to the
number of rows in the second matrix.
2. the result of the multiplication, called the product, is another matrix with the same
number of rows as the first matrix and the same number of columns as the second
matrix.
3. the multiplication of matrices is not commutative, this means, in general that
Square matrix
Identity matrix
Every square dimension set of a matrix has a special counterpart called an "identity
matrix". The identity matrix has nothing but zeroes except on the main diagonal, where
there are all ones. For example:
is an identity matrix. There is exactly one identity matrix for each square dimension set.
An identity matrix is special because when multiplying any matrix by the identity matrix,
the result is always the original matrix with no change.
Inverse matrix
An inverse matrix is a matrix that, when multiplied by another matrix, equals the identity
matrix. For example:
is the inverse of .
A matrix, that has many rows, but only one column, is called a column vector.
Transpose of a Matrix
The transpose of an m-by-n matrix A is the n-by-m matrix AT formed by turning rows into
Self-Assessment Exercise(s) 1
3.2 Determinants
The determinant takes a square matrix and returns a number. To understand what the
number means, take each column of the matrix and draw it as a vector. The parallelogram
drawn by those vectors has an area, which is the determinant. For all 2x2 matrices, the
formula is very simple:
𝑎1 𝑏1 𝑐1
det ([𝑎2 𝑏2 𝑐2 ]) = 𝑎1 (𝑏2 𝑐3 − 𝑐2 𝑏3 ) − 𝑏1 (𝑎2 𝑐3 − 𝑎3 𝑐2 ) + 𝑐1 (𝑎2 𝑏3 − 𝑎3 𝑏2 )
𝑎3 𝑏3 𝑐3
There are no simple formulas for the determinants of larger matrices, and many computer
programmers study how to get computers to quickly find large determinants.
Properties of determinants
There are three rules that all determinants follow. These are:
The elementary row operations that reduced this matrix are as follows:
3 2 1 : 0 1 -1 3 : 0
1 - 1 3 : 0 3
( 2 1 : 0 )
2 - 2 : 0 2 3 -2 : 0
3
𝑅2 → 𝑅2 − 3𝑅1
𝑅3 → 𝑅3 − 2𝑅1 𝑅3 → 𝑅3 − 𝑅2
1 -1 3 : 0 1 -1 3 : 0
(0 5 -8 : 0 ) (0 5 -8 : 0 )
0 5 -8 : 0 0 0 0 : 0
1
𝑅1 → 𝑅1 + 𝑅2
5
1
𝑅2 → 𝑅2
5
7
1 0 : 0
5
8
0 1 - : 0
5
(0 0 0 : 0 )
This implies the system is equivalent to
7
𝑥+ 𝑧=0
5
8
𝑦− 𝑧=0
5
It is thus possible to solve for x and y in terms of the unknown z. thus, if we let z =1, we
get
7
𝑥 −
5
(𝑦 ) = 8
𝑧 5
(1 )
The denominator of x
−13 3 2
|𝐴𝑥 | = |32 -6 3| = −13(6 + 12) − 3(−32 − 36) + 2(−128 + 72)
12 -4 -1
= −234 + 204-112 = -142
The denominator of y
1 -13 2
|𝐴𝑦 | = |2 32 3 | = 1(−32 − 36) − (−13)(−2 − 9) + 2(24 − 96)
3 12 -1
= -68-143-144 = -355
The denominator of z
1 3 − 13
|𝐴𝑧 | = |2 -6 32| = 1(−72 + 128) − 3(24 − 96) + (−13)(−8 + 18)
3 -4 12
= 56 + 216-130 = 142
Then
|𝐴𝑥 | 142
𝑥= =− = −2
|𝐴| 71
|𝐴𝑦 | 355
𝑦= =− = −5
|𝐴| 71
|𝐴𝑧 | 142
𝑧= = =2
|𝐴| 71
Self-Assessment Exercise(s) 2
−2 −1 0
1. Find the determinant of the matrices A = [−3 5 −2]
0 8 −1
2. Example: Use Cramer's rule for a 3 by 3 system of linear equations to
solve the following system
2x - y + 3z = -3
-x - y + 3z = -6
x - 2y - z = -2
4.0 Conclusion
In this unit you have studied matrices, determinant, basic operations of matrices and
determinant. We also studied the solutions of systems of linear equations using
determinant.
5.0 Summary
In this unit you studied:
1. Addition and subtraction of matrices.
2. Multiplication of matrices.
3. Transpose of a matrices 𝐴 = 𝐴𝑇
4. Inverse of a matrices is equal to identity matrix.
5. A square matrix has the same number of rows as columns, so m=n.
6. The determinant takes a square matrix and returns a number.
7. For all 2x2 matrices, the formula is very simple:
𝑎1 𝑏1 𝑐1
𝑎
det ([ 2 𝑏2 𝑐2 ]) = 𝑎1 (𝑏2 𝑐3 − 𝑐2 𝑏3 ) − 𝑏1 (𝑎2 𝑐3 − 𝑎3 𝑐2 ) + 𝑐1 (𝑎2 𝑏3 − 𝑎3 𝑏2 )
𝑎3 𝑏3 𝑐3
3 4 -1 -4 2 -1
2. Let 𝐴 = [7 -8 2 ] and 𝐵 = [3 -1 8 ] . Determine 𝐴 − 𝐵.
9 -1 3 4 9 0
1 0
1 -1 3 0
0 -3
3. Compute AB if 𝐴 = [0 6 4 1 ] and 𝐵 = [ ].
2 1
3 4 -2 1
-1 4
2 3 -1
4. Let 𝐴 = [ ] Compute A𝑇 .
5 1 0
1 3 4
5. Evaluate |2 4 3|
0 0 0
6. Solve the systems of equations
𝑥 + 𝑦 + 𝑧 = −2
2𝑥 + 6𝑦 − 𝑧 = 3
3𝑥 + 2𝑦 + 3𝑧 = −4