(1JV734 Combined Matrices Lecture
(1JV734 Combined Matrices Lecture
Matrices I
Outline of Lecture
2
Matrices
For the matrix A give the third row, second column and entries
a33, a21 & a12.
Since we count from top-to-bottom for rows, the third row is the
2 45 −1 5
one highlighted, and can be described by: 0.7 5 −26 0
𝐴=# /
[14 1 1 14 1 1 0
0]
𝑒 23 32 −31
The second column is the second-from-left, and so is the one
highlighted, and can be described by:
45
5
! '
1
23
Example
Some specific values of m and n lead to particular types of 𝑎11 𝑎12 𝑎13 𝑎14
matrices: 𝐴 = #𝑎21 𝑎22 𝑎23 𝑎24 )
𝑎31 𝑎32 𝑎33 𝑎34
A row matrix is a matrix with exactly one row (m = 1).
0 0 0
𝑂2,3 = & (
0 0 0
Matrix Arithmetic
Two matrices P & Q are only equal if all, for all i & j: pij = qij.
2 0 8
𝐴=# *
In other words, two matrices are only equal if all corresponding −1 4 −2
entries are real. Matrices of different dimensions can never be 6 1 −2
equal. 𝐵=# *
4 0 0
Therefore, none of the four matrices shown are equal. However, 6 −2
we can say that (-2)A = D. 𝐶 = #4 0 *
4 3
−4 0 −16
𝐷=# +
2 −8 4
Example
Calculate 3A – B.
1 −4
1 −4 −4 10 𝐴=# )
3𝐴 − 𝐵 = 3 & *−& * 3 5
3 5 0 3
−4 10
𝐵=# )
3 −12 −4 10 0 3
=" (−" (
12 15 0 3
5 𝑥
𝐶=# (
7 −22 3 2
=" '
12 12
Example
𝑥 = −14
Row Operations
2 0 4
𝑅2 → 𝑅2 + 0.5𝑅1 ) ,
2 −5 4
2 −5 4
𝑅1 ↔ 𝑅2 % *
2 0 4
Row Operations
One use of Type 3 ERO is to ‘clear’ a column. That is, to turn all
values except one in the column to 0.
∗ 𝑎12 ∗ ∗
Say in matrix A we want to turn all entries in the second column 𝐴 = #∗ 𝑎22 ∗ ∗)
except a12 to 0, we can use the following operation: ∗ 𝑎32 ∗ ∗
∗ 𝑎12 ∗ ∗
𝑎22 𝑎22 ∗ 𝑎12 ∗ ∗
𝑅2 → 𝑅2 − 𝑅 𝐴 = #∗ 𝑎22 − 𝑎 ∗ ∗ * = +∗ 0 ∗ ∗-
𝑎12 1 𝑎12 12 ∗ 𝑎32 ∗ ∗
∗ 𝑎32 ∗ ∗
For the matrix A, clear the third column except for the top row.
3 2 −4
𝐴 = #−2 −3 2 *
1 0 −2
3 2 −4 3 2 −4
2 2×3 2×2 2 × (−4) −1
𝑅2 → 𝑅2 − 𝐴
𝑅1 = #−2 − −3 − 2− - = # −2 0 -
−4 −4 −4 −4 2
1 0 −2 1 0 −2
3 2 −4 3 2 −4
⎡ −1 ⎤ ⎡−1 ⎤
−2 ⎢ −2 0 ⎥ ⎢ −2 0 ⎥
𝑅3 → 𝑅3 − 𝑅1 ⎢ 2 =
⎥ ⎢ 2 ⎥
−4 2 × 3 2 × 2 2 × (−4) −1
⎢ ⎥ ⎢ ⎥
⎣1 − 0 − −2 − ⎦ ⎣2 −1 0 ⎦
4 4 4
Systems of Linear Equations
𝑦 = 3𝑥 − 19
𝑎+𝑏 =7−𝑐
𝑎𝑥1 + 𝑏𝑥2 + 𝑐𝑥3 = 𝑑 (𝑎, 𝑏, 𝑐, 𝑑 ∈ ℝ)
are all valid linear equations. Any linear equation can be
expressed in the general format:
𝑎1 𝑥1 + 𝑎2 𝑥2 + 𝑎3 𝑥3 + ⋯ + 𝑎𝑛 𝑥𝑛 = 𝑏 (𝑎𝑖 , 𝑏𝑖 ∈ ℝ)
Systems of Linear Equations
𝑥 + 2𝑦 − 2𝑧 = 10
2𝑥 + 𝑧 = 4
is a system of linear equations. We can generalise any system of
linear equations in the following way:
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎21 𝑥1 + 𝑎22 𝑥2 + 𝑎23 𝑥3 + ⋯ + 𝑎2𝑛 𝑥𝑛 = 𝑏2
𝑎11 𝑥1 + 𝑎12 𝑥2 + 𝑎13 𝑥3 + ⋯ + 𝑎1𝑛 𝑥𝑛 = 𝑏1
𝑎𝑚1 𝑥1 + 𝑎𝑚2 𝑥2 + 𝑎𝑚3 𝑥3 + ⋯ + 𝑎𝑚𝑛 𝑥𝑛 = 𝑏𝑚 (𝑎𝑖𝑗 , 𝑏𝑖 ∈ ℝ)
Systems of Linear Equations
2 −3 1 7
𝑅2 → 𝑅2 − 3𝑅1 !0 11 −5 −18*
𝑅3 → 𝑅3 − 2𝑅1 0 15 −2 −10
2 −3 1 7
15
𝑅3 → 𝑅3 − 𝑅2 = 0 11 −5 −18
11 0 0 53/11 160/11
Echelon Matrices
In order for the scalar product to be defined, both vectors need 𝑏11 𝑏12
to have the same number of elements. Therefore, matrix
multiplication is only defined between two matrices AB when the 𝐵 = #𝑏21 𝑏22 (
number of columns in A is the same as the number of rows in B. 𝑏31 𝑏32
The dimensions of C will be given by the number of rows in A by
the number of columns in B.
Give the general form of all matrices that commute with the 2 1
𝐴=# '
matrix A. 1 0
We only need to consider matrices of the dimensions 2 x 2. We 𝑎 𝑏
will use the general form shown by the matrix B.
𝐵=# (
𝑐 𝑑
𝐴𝐵 = 𝐵𝐴
2𝑎 + 𝑐 2𝑏 + 𝑑 2𝑎 + 𝑏 𝑎
! (=! (
𝑎 𝑏 2𝑐 + 𝑑2𝑎 2𝑎
+𝑐 𝑐+=𝑐 2𝑎 +𝑏
= 2𝑎 + 𝑏
2𝑎 + 𝑐 = 2𝑎 +𝑏
We can now equate individual entries:
2𝑎2𝑏 𝑐+=𝑑+2𝑎
+ 2𝑏 = 𝑎+ 𝑏
𝑑=𝑎
From this we can say that c = b and a = 2b
+ d, and give the general form as:
2𝑏 𝑎+=𝑑 2𝑐
= 𝑎+ 𝑑
2𝑏 𝑎+= 𝑑 2𝑐
= 𝑎+ 𝑑
2𝑏 + 𝑑 𝑏
𝑎 = 2𝑐 +
= 𝑑𝑐+ 𝑑 𝐵=# (
𝑎 =𝑏 2𝑐
𝑏=𝑐
𝑏 𝑑
𝑏=𝑐
𝑏=𝑐
Algebra of Matrices
The index law that states ApBp = (AB)p does not hold for non-
commuting matrices. We can see this for p = 2 by multiplying out:
𝐴𝑝 𝐵𝑝 = 𝐴𝐴𝐵𝐵
(𝐴𝐵)𝑝 = 𝐴𝐵𝐴𝐵
Algebra of Matrices
𝑎 𝑏
𝐴 = #−𝑎2 (
−𝑎
𝑏
More generally, if AB = 0, this does not mean that either A or B
are 0.
Algebra of Matrices
𝐴𝐵 𝐴𝐵
= 𝐴𝐶
= 𝐴𝐶
𝐴𝐵 −
𝐴𝐵𝐴𝐶
−=𝐴𝐶0= 0
𝐴(𝐵𝐴−(𝐵𝐶−
) =𝐶 )0= 0
In standard algebra, we would be able to infer that B – C = 0, but
this no longer holds as both A and (B – C) may be non-zero.
Inverses of Matrices
𝑑 −𝑏
For a 2 x 2 matrix, we find that the multiplication AB (where B is 𝐵=# )
the matrix shown) gives us: −𝑐 𝑎
𝑎𝑑 − 𝑏𝑐 0 1 0
𝐴𝐵 = $ + = 𝑎𝑑 − 𝑏𝑐 $ +
𝑎𝑑 − 𝑏𝑐 0 0 𝑎𝑑1− 𝑏𝑐
0 0 1
𝐴𝐵 = $ + = 𝑎𝑑 − 𝑏𝑐 $ +
0 the inverse
Therefore, 𝑎𝑑 −of𝑏𝑐
A is given by: 0
1 1 𝑑 −𝑏
−1 $ +
𝐴 =
1 𝑑 −𝑏 𝑎𝑑 − 𝑏𝑐 −𝑐 𝑎
𝐴−1 = $ +
𝑎𝑑 − 𝑏𝑐 −𝑐 𝑎
Inverses of Matrices
• Step 1: Determine all nine cofactors and form them into a matrix
• Step 2: Calculate the determinant Det(A)
• Step 3: Transpose the cofactor matrix. That is , write the columns as rows. Then divide by Det(A):
44
Properties of Nonsingular Matrices
Recall that we had been able to express a system of linear 𝑎11 𝑎12 … 𝑎1𝑛
equations in the form AX = H. We can use the inverse to find a 𝑎21 𝑎22 … 𝑎2𝑛
𝐴𝑋 𝐴=# ⋮ ⋮ ,
solution for all variables𝐴𝑋
in the
𝐴𝑋 = 𝐻 𝐻= 𝐻
=equation: ⋮ ⋱
𝐴𝑋
−1 ( = )𝐻= 𝐴−1 𝐻 𝑎𝑚1 𝑎𝑚2 … 𝑎𝑚𝑛
−1𝐴( )𝐴𝑋 −1
𝐴 −1 ( 𝐴𝑋 =
𝐴 −1 𝐴𝑋) = 𝐴 −1𝐻 𝐴−1 𝐻
𝐴 (𝐴 (𝐴𝑋
−1 ) = 𝐴 𝐻
𝐴)𝑋 = −1
−1 −1𝐴 𝐻 𝑥1 𝑏1
(𝐴−1 𝐴)𝑋
(𝐴 𝐴)𝑋 = =𝐴 𝐴−1 𝐻𝐻
−1 −1 𝑥2
(𝐴 𝐴)𝑋 𝑋 = = 𝐴−1 𝐻 𝑏
−1𝐴 𝐻 𝑋=# ⋮ ) 𝐻 = # 2)
𝑋=
𝑋 =𝐴 𝐴−1 𝐻 𝐻 ⋮
−1
Therefore, as long as our𝑋coefficient
= 𝐴 𝐻matrix A is nonsingular, we 𝑥𝑛 𝑏𝑚
can find the value of each variable by using the equation above.
𝐴𝑋 = 𝐻
Example
𝐴−1 (𝐴𝑋) = 𝐴−1 𝐻
Using the formula−1
X = A-1H, find the
−1 solutions to the equations
shown. (𝐴 𝐴)𝑋 = 𝐴 𝐻 3𝑥 + 2𝑦 = 16
𝑋 = 𝐴−1 𝐻 5𝑥 + 4𝑦 = 26
𝑥 1 4 −2 16
!𝑦𝑥$ = 1! 4 −2$ ! 16$
!𝑦$ =2 −5! 3 $ 26
! $
2 −5 3 26
𝑥 1 12 6
!𝑦𝑥$ = 1! 12$ = ! 6$
!𝑦$ =2 −2! $ = −1
! $
2 −2 −1
Therefore, x = 6 and y = -1.
Elementary Matrices
1 0 0 3 −1 2 3 −1 2
!0 0 1$ !4 3 1$ = !2 −5 9$
0 1 0 2 −5 9 4 3 1
Elementary Matrices
2 0 0 3 −1 2 6 −2 4
!0 1 0% !4 3 1% = !4 3 1%
0 0 1 2 −5 9 2 −5 9
Elementary Matrices
For Type 3 EROs (Rp → Rp + λRq) we once again apply this ERO to
the identity matrix. 3 −1 2
𝐴 = #4 3 1+
For example, say we wanted to add 3 lots of row 1 to row 2 in 2 −5 9
matrix A (R2 → R2 + 3R1)
1 0 0 3 −1 2 3 −1 2
!3 1 0% !4 3 1% = !13 0 7%
0 0 1 2 −5 9 2 −5 9
Elementary Matrices
Each horizontal line of entries is known as a row. 𝑎11 𝑎12 𝑎13 𝑎14
𝐴 = #𝑎21 𝑎22 𝑎23 𝑎24 )
Each vertical line of entries is known as a column.
𝑎31 𝑎32 𝑎33 𝑎34
Each entry is denoted by aij, where i is the row of the entry and j
is the column.
lxm mxn
lxn
Summary
The identity matrix is a matrix that is all 0s, except for the main
diagonal where each value is 1.
−1
1 𝑑 −𝑏
𝐴 = ( -
det 𝐴 −𝑐 𝑎