You are on page 1of 13

Soran University

Faculty of Engineering
Department of Civil Engineering

Matrices
Prepared by
Halgurd Sulaiman

Email: Halgurd.hussein@soran.edu.iq

2020-2021
Matrices
Definitions
A matrix is a rectangular array of numbers of the form

• We usually use capital letters (for example, 𝐴, 𝐵, 𝐶, …) for the names of matrices,
and we usually use lowercase letters (for example, 𝑎, 𝑏, 𝑐, …) to represent the numbers
inside of a matrix.
• The numbers inside a matrix are called the elements or entries of the matrix.
• The sequence of all entries on a horizontal line is called a row, and the sequence of
all entries on a vertical line is called a column. We number the rows from top to
bottom, and the columns from left to right.
• The entry in the 𝑘th row and 𝑙th column of a matrix A is denoted by 𝑎𝑘𝑙 .
• A matrix with m rows and n columns is called an 𝑚 × 𝑛 matrix, or a matrix of
order 𝑚 × 𝑛.

Example 1:
2 −3 4 5
(a) 𝐴 = [6 7 4 3] is a 3 × 4 matrix since it has 3 rows and 4 columns.
3 1 2 4
The entry in the 2nd row and 4th column of 𝐴 is 3, and so we write 𝑎24 = 3.
Definition: If a matrix has order n×n (that is, if the number of rows equals the number
of columns) then the matrix is called square.

Definition: The main diagonal of a square matrix consists of the entries on the
diagonal from the top left corner of the matrix down to the bottom right corner of the
matrix.
Definition: A diagonal matrix is a square matrix in which all of the entries which are
not on the main diagonal must equal zero.
Definition: A triangular matrix is a square matrix in which
 All the entries which lie below the main diagonal are zero, or
 All the entries which lie above the main diagonal are zero.

Matrix Operations
Matrix equality. Two matrices are equal if they have the same order and their
corresponding entries are equal.
𝑎 𝑏 𝑒 𝑓
Let 𝐴 = [ ] and 𝐵 = [ ]. Then 𝐴 = 𝐵 if and only if 𝑎 = 𝑒, 𝑏 = 𝑓, 𝑐 =
𝑐 𝑑 𝑔 ℎ
𝑔 and 𝑑 = ℎ.
Matrix addition. Two matrices can be added if they have the same size. We add two
such matrices by adding the corresponding entries.
𝑎 𝑏 𝑒 𝑓 𝑎 𝑏 𝑒 𝑓
If 𝐴 = [ ] and 𝐵 = [ ], then 𝐴 + 𝐵 = [ ]+[ ]
𝑐 𝑑 𝑔 ℎ 𝑐 𝑑 𝑔 ℎ
𝑎+𝑒 𝑏+𝑓
=[ ]
𝑐+𝑔 𝑑+ℎ
For example,
1 3 4 0 1+4 3+0 5 3
[ ]+[ ]=[ ]=[ ]
2 −1 −1 −3 2 + (−1) −1 + (−3) 1 −4
Scalar multiplication. Any matrix can be multiplied by a single number (scalar). We
do this by multiplying all the entries of the matrix by that number.
𝑎 𝑏 𝑎 𝑏 𝑘𝑎 𝑘𝑏
If 𝐴 = [ ] and 𝑘 is scalar, then 𝑘𝐴 = 𝑘 [ ]=[ ]
𝑐 𝑑 𝑐 𝑑 𝑘𝑐 𝑘𝑑
For example,
𝟏 𝟑 𝟒 𝟏𝟐
𝟒[ ]=[ ]
𝟐 −𝟏 𝟖 −𝟒
Matrix multiplication. The product 𝐴𝐵 of two matrices 𝐴 and 𝐵 is defined if and
only if the number of columns of 𝐴 is equal to the number of rows of 𝐵.

To calculate the entry in the (𝑖, 𝑗) position (that is, in the 𝑖 𝑡ℎ row and 𝑗𝑡ℎ column) of
𝐴𝐵, we multiply the 𝑖 𝑡ℎ row of A by the 𝑗𝑡ℎ column of B.
𝑎 𝑏 𝑒 𝑓 𝑎 𝑏 𝑒 𝑓
i-e If 𝐴 = [ ] and 𝐵 = [ ], then 𝐴 × 𝐵 = [ ] × [𝑔 ]
𝑐 𝑑 𝑔 ℎ 𝑐 𝑑 ℎ
𝑎𝑒 + 𝑏𝑔 𝑎𝑓 + 𝑏ℎ
=[ ]
𝑐𝑒 + 𝑑𝑔 𝑐𝑓 + 𝑑ℎ

Note: If A has order 𝑚 × 𝑛 and B has order 𝑛 × 𝑝 then AB has order 𝑚 × 𝑝


Transpose. The transpose 𝐴𝑇 of a matrix A is obtained by putting the 𝑖th row of A
into the 𝑖th column of 𝐴𝑇 . If A has order 𝑚 × 𝑛 then 𝐴𝑇 has order 𝑛 × 𝑚.
𝑎 𝑏 𝑎 𝑐
If 𝐴 = [ ], then 𝐴𝑇 = [ ]
𝑐 𝑑 𝑏 𝑑

For example,

Properties of Matrix Operations


Addition Properties
𝐴 + 𝐵 = 𝐵 + 𝐴
𝐴 + (𝐵 + 𝐶) = (𝐴 + 𝐵) + 𝐶
𝐴 + 𝑂 = 𝐴 = 𝑂 + 𝐴
𝐴 + −𝐴 = 𝑂 = −𝐴 + 𝐴
The matrix 𝑂 is called the zero matrix, and −𝐴 is called the negative of 𝐴.
In the above properties, 𝐴, 𝐵, 𝐶, 𝑂 and −𝐴 all have the same order.
For example

Multiplication Properties
Provided that each of the following matrix products exists, we have
𝐴(𝐵 + 𝐶) = 𝐴𝐵 + 𝐴𝐶
(𝐵 + 𝐶)𝐴 = 𝐵𝐴 + 𝐶𝐴
𝐴(𝐵𝐶) = (𝐴𝐵)𝐶
However, usually 𝐴𝐵 ≠ 𝐵𝐴
For a square matrix 𝐴, we have:
𝐴𝑂 = 𝑂 = 𝑂𝐴
and 𝐴𝐼 = 𝐴 = 𝐼𝐴
where 𝐼 is a diagonal matrix with ones on the main diagonal and zeros elsewhere.
The matrix I is called the identity matrix, and must have the same order as 𝐴.

Note: It is important to realize that, if we choose any two matrices A and B, then
usually 𝐴𝐵 ≠ 𝐵𝐴
For example, consider the matrices A and B given below:
The matrix determinant
Definition: A value called the determinant of 𝐴, that we denote by
det(𝑎) or |𝐴|,
corresponds to every square matrix𝐴. We will avoid the formal definition of the
determinant (that implies notions of permutations) for now and we will concentrate
instead on its calculation.

Calculation of the determinant for a 𝟐 × 𝟐 matrix


Let us consider the matrix 𝐴 of dimension 2 × 2:
𝑎11 𝑎12
[𝑎 ]
21 𝑎22

The determinant of the matrix 𝐴 is defined by the relation


𝑎11 𝑎12
det(𝐴) = |𝑎 | = 𝑎11 𝑎22 − 𝑎21 𝑎12
21 𝑎22

The result is obtained by multiplying opposite elements and by calculating the


difference between these two products…. a recipe that you will need to remember!

For example;
Given the matrix
2 5
𝐴=[ ]
3 4
The determinant of 𝐴 is
2 5
det(𝐴) = | | = 2 × 4 − 5 × 3 = −7
3 4

Finding the Determinant of a 3×3 Matrix

The determinant of a matrix is a value associated with a matrix. You can only find the
determinant of a square matrix (2 rows and 2 columns, 3 rows and 3 columns, etc.).
The determinant of the matrix can be used to solve systems of equations, but first we
need to discuss how to find the determinant of a matrix. Here we will be learning how
to find the determinant of a 3×3 matrix.
There are a few different ways to find the determinant of a 3 × 3 matrix. I have chosen
to show this technique because it seems a lot easier for me to remember. I do not have
to worry about things like minors and cofactors. If you know another way to find the
determinant of a 3 × 3 matrix consider giving this technique a try.

Here are the steps we follow to find the determinant of a 3×3 matrix:

The steps are a lot easier to understand when you look at some examples, so here we
go.
𝑎 𝑏 𝑐 𝑎 𝑏 𝑐 𝑎 𝑏
If 𝐴 = [𝑑 𝑒 𝑓], then det(𝐴) = |𝑑 𝑒 𝑓| 𝑑 𝑒
𝑔 ℎ 𝑖 𝑔 ℎ 𝑖 𝑔 ℎ
= (𝑎𝑒𝑖 + 𝑏𝑓𝑔 + 𝑐𝑑ℎ) − (𝑐𝑒𝑔 + 𝑎𝑓ℎ + 𝑏𝑑𝑖)
Cramer’s Rule
Cramer’s rule is a method for solving linear simultaneous equations. It makes use of
determinants and so a knowledge of these is necessary before proceeding.
|𝐴𝑖 |
𝑋𝑖 =
|𝐴|

where 𝑋𝑖 is the 𝑖 𝑡ℎ endogenous variable in a system of equations,| 𝐴| is the


determinant of the original 𝐴 matrix as discussed in the previous section, and |𝐴𝑖 | is
the determinant a special matrix formed as part of Cramer's rule.
To use Cramer's rule, two (or more) linear equations are arranged in the matrix form
𝐴 𝑋 = 𝑑. For a two equation model:
𝑎11 𝑥1 + 𝑎12 𝑥2 = 𝑑1
𝑎21 𝑥1 + 𝑎22 𝑥2 = 𝑑2

A is the matrix corresponding to the number of equations in a system (here, two


equations), and the number of endogenous variables in the system (here 2 variables).
Remember that the matrix must be square, so the number of equations must equal the
same number of endogenous variables. Position x has one column and corresponds to
the number of endogenous variables in the system. Finally, position d contains the
exogenous terms of each linear equation.
Note: The determinant for a matrix must not equal 0 (|𝐴| ≠ 0). If |𝐴| = 0 then there
is no solution, or there are infinite solutions (from dividing by zero). Therefore, |𝐴| ≠
|𝐴| ≠ 0. When|𝐴| ≠ 0, then a unique solution exists.

Applying Cramer’s Rule in a 2x2 example


Example: Using Cramer's rule to solve for the unknowns in the following linear
equations:
|𝐴𝑖 |
We need to construct 𝑋𝑖 = |𝐴|
, for i=1 and for i=2.

The first special determinant 𝐴1 is found by replacing the first column of the primary
matrix with the constant 𝑑 column. The new special matrix 𝐴1 now appears as:

Likewise, the same procedure is done to find the second special determinant 𝐴2 ,
Using:
|𝐴𝑖 |
𝑋𝑖 =
|𝐴|
We get,

Applying Cramer’s Rule in a 𝟑 × 𝟑 example


Example: Using Cramer's Rule to solve for the unknowns in three linear equations:

Solution:

You might also like