Matrices Lecture 1 PDF
Matrices Lecture 1 PDF
Matrices Lecture 1 PDF
Matrix Operations
What is a Matrix?
• A matrix is a rectangular array of numbers
1 4 3
2 5 1
1 2 5 6 1+5=𝟔 2+6=𝟖
+ =
3 4 7 −8 3+7=𝟏𝟎 4+ −8 = − 𝟒
1 −2 2∗1 = 𝟐 2∗ − 2 = −𝟒
2 =
0 4 2∗0 = 𝟎 2∗4 = 𝟖
2 0 1 2 𝟐 𝟒
=
1 2 3 4 𝟕 𝟏𝟎
Identity Matrix
• The "Identity Matrix" is the matrix equivalent of
the number "1":
2x2 Identity matrix 3x3 Identity matrix
𝟏 0 0
𝟏 0
0 𝟏 0
0 𝟏
0 0 𝟏
• ×A=A
1 2 1 0 1x1+2x0 = 𝟏 1x0+2x1 = 𝟐
=
3 4 0 1 3x1+4x0 = 𝟑 3x0+4x1 = 𝟒
1 0 1 2 1x1+3x0 = 𝟏 1x2+0x4 = 𝟐
=
0 1 3 4 0x1+1x3 = 𝟑 0x2+1x4 = 𝟒
Determinant of a Matrix
• The determinant of a matrix is a number that
tells us things about the matrix that are useful
in systems of linear equations, helps us find
the inverse of a matrix, is useful in calculus
and more.
• The symbol for determinant is two vertical
lines either side.
Example:
|A| means the determinant of the matrix A
Determinant of a 2x2 matrix
• In order to calculate the determinant of a matrix, the
matrix must be square (i.e. have the same number of rows
as columns)
• For a 2×2 matrix A (2 rows and 2 columns):
𝑎 𝑏
A=
𝑐 𝑑
the determinant is:
|A| = ad - bc
• The determinant of A = a * d minus b * c
𝑎 𝑏
𝑐 𝑑
Example
• What is the determinant of the matrix
4 6
B=
3 8
4 6
𝐵 = = 4*8 – 6*3
3 8
=32– 18 = 14
Determinant of a 3x3 matrix
• For a 3×3 matrix (3 rows and 3 columns):
𝑎 𝑏 𝑐
A= 𝑑 𝑒 𝑓
𝑔 ℎ 𝑖
the determinant is:
|A| = a|ei – fh| – b|di – fg| + c|dh – eg|
2 1 1
• Given P = 3 5 2 , find |P|
4 3 3
__ __ __
2 1 1 2 1
3 5 2 3 5
4 3 3 4 3
+ + +
|P| = 2*5*3 + 1*2*4 + 1*3*3 – 4*5*1 – 3*2*2 –
3*3*1
• = 30 + 8 + 9 – 20 – 12 – 9
• = 6
Transposing a Matrix
• To "transpose" a matrix, swap the rows and columns. We
put a "T" in the top right-hand corner to mean transpose:
𝑻
1 4 3 1 2 3 𝑇 1 2
2 5 1 = 4 5 6 1 4 3
= 4 5
3 6 7 2 5 1
3 1 7 3 1
• The transpose is essentially formed by writing the columns
of the original matrix as rows in the new matrix (or rows of
the original matrix as columns in the new matrix).
• Note that the diagonal remains fixed. So, the transpose
can also be created by simply swapping the elements
across the diagonal.
• The transpose of an a x b matrix is a b x a matrix. For
example, in our 2nd example, the transpose of a 2x3 matrix
is a 3x2 matrix.
Matrix Division
• We don’t really divide matrices. Instead, we
multiply by an Inverse.
A/B = A * (1/B) = A B-1
where B-1 means the "inverse" of B.
Inverse of a Matrix
• The Inverse of a Matrix is the same idea as
the reciprocal of a number:
•
1 0
= We end up with the Identity Matrix! So it must be right.
0 1
Requirements for Inverse to Exist
• First of all, to have an Inverse, the Matrix must
be "Square" (same number of rows and
columns).
• Also the determinant cannot be zero (or you
would end up dividing by zero).