Lecture 4 Matrices
Lecture 4 Matrices
Matrix Dimensions
The dimensions of a matrix tell its size: the number of rows and columns of the
matrix, in that order.
Since matrix A has two rows and three columns, we write its dimensions as 2 x 3,
pronounced “two by three”.
The element is the entry in the second row and the first column.
In this case = 18
Two matrices are EQUAL if all three of the following conditions are met:
Each matrix has the same number of rows
Each matrix has the same number of columns
Corresponding elements within each matrix are equal
Special Types of Matrices
A matrix may be classified by types. It is possible for a matrix to belong to more than
one type.
A zero matrix or a null matrix is a matrix that has all its elements zero.
Example: O is a zero matrix of order 2 × 3
A diagonal matrix is a square matrix that has all its elements zero except for those in
the diagonal from top left to bottom right; which is known as the leading diagonal of the
matrix.
Example: B is a diagonal matrix.
A scalar matrix is a diagonal matrix where all the diagonal elements are equal.
Example:
An upper triangular matrix is a square matrix where all the elements located below the
diagonals are zeros.
Example:
A lower triangular matrix is a square matrix where all the elements located above the
diagonal are zeros.
Example:
A unit matrix is a diagonal matrix whose elements in the diagonal are all ones.
Example: P is a unit matrix.
Representing A Linear System With Matrices
A system of equations can be represented by an augmented matrix.
System of Equations:
Augmented matrix:
In an augmented matrix, each row represents one equation in the system and each
column represents a variable or the constant terms.
In this way, we can see that augmented matrices are a shorthand way of writing
systems of equations. The organization of the numbers into the matrix makes it
unnecessary to write various symbols like x, y, and =, yet all of the information is still
there!
Example
Write the following system of equations as an augmented matrix.
Solution
To make things easier, let's rewrite the system to show each of the coefficients clearly.
If a variable term is not written in an equation, it means that the coefficient is 0.
In general, before converting a system into an augmented matrix, be sure that the
variables appear in the same order in each equation, and that the constant terms are
isolated on one side.
Solution
means to interchange row 1 and row 2.
Sometimes you will see the following notation used to indicate this change.
Notice how row 1 replaces row 2 and row 2 replaces row 1. The third row is not
changed.
Multiply A Row By A Nonzero Constant
Example
Perform the row operation on the following matrix.
Solution
means to replace the 2nd row with 3 times itself.
Notice here three times the second row replaces the second row. The other rows
remain the same.
Add One Row to Another
Example
Solution
+ means to replace the 2nd row with the sum of the 1st and 2nd
rows.
Notice how the sum of row 1 and 2 replaces row 2. The other row remains the same.
Systems of Equations and Matrix Row Operations
Recall that in an augmented matrix, each row represents one equation in the system
and each column represents a variable or the constant terms.
For example, the system on the left corresponds to the augmented matrix on the right.
When working with augmented matrices, we can perform any of the matrix row
operations to create a new augmented matrix that produces an equivalent system of
equations.
The two systems in the above table are equivalent, because the order of the equations
doesn't matter. This means that when using an augmented matrix to solve a system, we
can interchange any two rows.
Multiply a Row by a Nonzero Constant
We can multiply both sides of an equation by the same nonzero constant to obtain an
equivalent equation.
This means that when using an augmented matrix to solve a system, we can multiply
any row by a nonzero constant.
So when using an augmented matrix to solve a system, we can add one row to another.
Operations of Matrices
Adding
To add two matrices: add the numbers in the matching positions:
The two matrices must be the same size, i.e. the rows must match in size, and
the columns must match in size.
Negative
The negative of a matrix is also simple:
Subtracting
To work out the answer for the 1st row and 1st column:
Here it is for the 1st row and 2nd column:
We can do the same thing for the 2nd row and 1st column:
And we get:
Properties of Matrix Addition
Let A, B and C be matrices. Then, the following properties hold.
Commutative Law of Addition – A+B = B+A
Associative Law of Addition - (A+B)+C = A+( B+C )
Existence of an Additive Identity – ( There exists a zero matrix 0 such that
A+0 = A )
Existence of an Additive Inverse – (There exists a matrix −A such that
A+(−A) = 0
Determinant of a Matrix
The determinant is a special number that can be calculated from a matrix. The matrix
has to be square (same number of rows and columns) like this one:
Calculating the Determinant
First of all the matrix must be square (i.e. have the same number of rows as columns).
2×2 Matrix
For a 2×2 matrix (2 rows and 2 columns):
ICI=4x8-6x3
= 32 – 18
= 14
3×3 Matrix
For a 3×3 matrix (3 rows and 3 columns):
The determinant is:
Multiply a by the determinant of the 2×2 matrix that is not in a's row or column.
Likewise for b, and for c
Sum them up, but remember the minus in front of the b
Example:
As a formula:
The cofactor of the element ais obtained by multiplying the minor with (-1) to the power
of the position value row and column of element a.
The minor and cofactor of a matrix are simple numeric values, which are obtained after
taking the determinant of the remaining elements of the given matrix.
Example
Finding the minor and cofactor of 7 in the matrix
Solution
Example
Find the cofactor matrix for the matrix
Solution:
Inverse of Matrices
Identity Matrix
We just mentioned the "Identity Matrix". It is the matrix equivalent of the number "1":
The Identity Matrix can be 2×2 in size, or 3×3, 4×4, etc ...
Definition
Inverse 2 x 2 Matrix
Swap the positions of a and d, put negatives in front of b and c, and divide everything
by ad−bc.
Note: ad−bc is called the determinant.
Example
Solution
a. The submatrices are:
b. , ,
Cramer’s Rule
Is another method to compute the determinant of a matrix.
Example
Use Cramer’s Rule to solve the linear system where
Solution
First compute the determinant of A to see if we can apply Cramer’s Rule.
Therefore
Example
Use Cramer’s Rule to solve the linear system where
Solution
The determinant of A is −2 , so we can apply Cramer’s Rule.
Therefore
and
Gauss Elimination
Gauss elimination method is used to solve a system of linear equations.
It consists of a sequence of operations performed on the corresponding matrix of
coefficients.
Example
Solve a system of linear equations using the Gaussian elimination method:
The goal of the Gaussian elimination method is to make the numbers below the main
diagonal 0. So, we have to transform the red numbers to 0:
For example, the number -1, which is the first element in the second row, is the negative
of 1, the first element in the first row. So if we add the first row to the second row, the -1
will be eliminated:
Now we have to convert the -8 to 0. To do this, we multiply the third row by 3 and add
the second row multiplied by 8:
As you can see, with all these transformations we have made all the numbers below the
main diagonal 0. That is, the matrix is in row echelon form (or triangular form).
Now we must transform the matrix into a system of equations with unknowns. For this,
remember that the first column of the matrix corresponds to the unknown x, the second
column to the unknown y, the third column to the unknown z, and the last column are
the constants of the equations:
And finally, to solve the system we have to find the values of the unknowns from the
bottom up. Since the last equation only has one unknown, and therefore, we can easily
find its value:
And we do the same with the first equation of the system: we back-substitute the values
of the other unknowns and solve for x:
Thus, the solution of the system of equations is:
Gauss-Jordan Elimination
Example
Solve the system shown below using the Gauss Jordan Elimination method:
Solution
The first step is to write the augmented matrix of the system. We show this below:
Now, our task is to reduce the matrix into the reduced row echelon form (RREF) by
performing the 3 elementary row operations.
Step 1:
We can multiply the first row by - 1 to make the leading entry 1. Shown below:
Step 2:
We can now multiply the first row by 3 and subtract it from the second row. Shown
below:
Step 3:
To make the second entry of the second row 1, we can multiply the second row by .
Shown below:
Step 4:
The second entry of the first row should be 0. In order to do that, we multiply the second
row by 2 and add it to the first row. Shown below:
This is the reduced row echelon form. From the augmented matrix, we can write two
equations (solutions):
b. 5x – 6y – 7z = 7
6x – 4y +10z = -34
2x + 4y – 3z = 29
a. 0 -4 3 1 4
6 7 2 9 -3
b. 0 -4 3
6 7 2
8 10 3
1 9 0
c. 0 1 2 3
3. Perform the operation of matrices.
a. 2 4 3 2 1 3
3 1 + 1 1 + 2 3
4 5 5 3 4 6
b. 2 -1 1 0
1 3 + 2 -1
c. 1 -3 -2 2 1
2 0 1 X -2 -1
3 0
d. 2 -1 1 3
3 2 -- 2 3
7 5 4 6
a. 3 4
0 0
b. 2 -3
4 5
c. 3 1 2
4 8 5
-1 0 -3
a. 2 -3
4 5
b. 2 -3
4 5
2 -3 5
6 0 4
1 5 -7
2 -2 3
1 4 5
2 1 -3
8. For the given matrix, construct the submatrices used to compute the minors
3 1 2
4 8 5
-1 0 -3
1 1 -1 6
A= 3 -2 1 and b -5
1 3 -2 1
A= 12 3 and b 15
2 -3 13