Professional Documents
Culture Documents
Lect 04 Matrix
Lect 04 Matrix
Reminder
matrices, operations on matrices.
Matrix
In mathematics, a matrix (plural matrices) is a rectangular array of numbers, arranged in rows and columns.
The matrix A is “n-by-m” matrix (nxm) if a matrix has n-rows and m-columns. This is the matrix size.
An element of a matrix could be denoted by aij an element with two subscripts.
The first subscript is the row number: 1 ≤ i ≤ n.
The second subscript is the column number: 1 ≤ j ≤ n.
Examples
2 3 7
𝐵= [ ] B is 2x3 matrix.
4 1 5
8 1
𝐶 = [4 3] C is 3x2 matrix
2 5
D = [2 9 4] D is 1x3 matrix
2
𝐸 = [4] E is 3x1 matrix
6
Vector
Vector – column vector is an nx1 matrix.
Example vector E.
Matrix addition
If two matrices A, B have the same size we can define matrix A+B their sum:
a11 a12 a1m b11 b12 b1m a11 + b11 a12 + b12 a1m + b1m
a a a2 m b21 b22 b2 m a21 + b21 a22 + b22 a2 m + b2 m
A + B = 21 22 + =
an1 an 2 anm bn1 bn 2 bnm an1 + bn1 an 2 + bn 2 anm + bnm
Example
2 3 1 6 3 9
[4 1] + [ 3 5] = [ 7 6]
7 5 2 2 9 7
Comment
If we can add matrices A, B then:
A+B=B+A
Example
7 2
1 2 5
[ ] + [3 3] = ? ? ?
3 4 7
1 4
Scalar multiplication
kA = Ak
is the matrix:
Zero matrix
0 0 0
0 0 0
0= = [0]1i n;1 j m
0 0 0
• A+B=B+A
• A+0=A
• -A = (-1)A
• A + (-A) = 0
• k(A + B) = kA +kB
• (k + p)A = kA + pA
• (kp)A = k(pA)
Transposed matrix
Example of transposition:
1 3
1 2 5𝑇
[ ] = [2 4]
3 4 7
5 7
Matrix multiplication
If A is nxm matrix and B is mxk matrix then we define matrix C their product as:
AB = C
C = [cik]1≤i≤n;1≤k≤w
where
𝑚
Multiplication of matrices A and B is possible only if the number of columns in matrix A is equal to the number
of rows in matrix B.
Notice
If the number of columns in matrix A is not equal to the number of rows in matrix B, then the product AB is not
defined.
2 1 5 3 2 = 32 30
3 4 7 6 1 61 45
4 5
3 2 2 1 5 = 12 11 29
6 1 3 4 7 15 10 37
4 5 23 24 55
2 1 5 3 = 32
3 4 7 6 61
4
3 2 1 5 = not exist!
6 3 4 7
4
• (AB)C = A(BC)
• A(B+C) = AB + AC
• k(AB) = (kA)B = A(kB)
Square matrix
If the number of rows and columns are equal, we say matrix is square matrix.
Matrix nxn is said to be square matrix of order n or n-square matrix.
Diagonal
The main diagonal or simply diagonal of n-square matrix A= [aij] consists of the elements a11, a22, … , ann.
Unit matrix
The square matrix with 1’s along the main diagonal 0’s elsewhere is called unit matrix and is denoted by I.
Notice
Unit matrix plays the same role in matrix multiplication as 1 in number multiplication:
IA = AI = A
A, I – n-square matrices.
Determinants
Determinant of n-square matrix A is the number denoted |A| or det(A) recursively defined as follows:
Minor Mij of n-square matrix A is the determinant of the (n-1) square submatrix of A formed from A by deleting
i-th row and j-th column from matrix A.
𝑛 𝑛
(𝑖0 +𝑗)
det(𝐴) = ∑(−1) 𝑎𝑖0𝑗 𝑀𝑖0 𝑗 = ∑(−1)(𝑖+𝑗0 ) 𝑎𝑖𝑗0 𝑀𝑖𝑗0
𝑗=1 𝑖=1
For n = 2 we have
𝑎 𝑐
𝐴=[ ] ; det(A) = ad – bc .
𝑏 𝑑
For n = 3 we have
𝑎 𝑑 𝑔
𝐴 = [𝑏 𝑒 ℎ]
𝑐 𝑓 𝑖
a d g a d
b e h b e
c f i c f
Example
2 3
A= 5 7
Example
2 3 6
A= 5 7 5
2 3 4
Invertible matrices
A square matrix A is said to be invertible if there exists a matrix B such that
AB = BA = I
If such matrix B exist is unique is called the inverse of matrix A and is denoted A-1.
Theorem
If det(A) ≠ 0 for square matrix A than A-1 exists.
Inverse matrix
A is n-square matrix such that det(A) ≠ 0. Than
1 1 𝑇
𝐴−1 = [(−1)(𝑖+𝑗) 𝑀𝑗𝑖 ]𝑖𝑗 = [(−1)(𝑖+𝑗) 𝑀𝑖𝑗 ]𝑖𝑗
det (𝐴) det (𝐴)
4 2
A= 5 3
4 5 3/2 -2/2
AT = 2 3 A-1 = -5/2 4/2
We can check:
AA-1 = A-1A = I
0 1 2
A= 1 2 1
2 1 0
det(A) = –4 .
We can check:
AA-1 = A-1A = I