Unit 2 Matrices
Unit 2 Matrices
Rank of Matrix:
The number 𝑟 is called the rank of matrix 𝐴 if,
1) There exist at-least one minor of order r which is non zero
2) Every minor of order 𝑟 + 1 of matrix A is zero.
Note:
1) The rank of matrix 𝐴 is denoted by 𝜌(𝐴)
2) Rank of null matrix is zero.
3) If 𝐴 = [𝑎𝑖𝑗 ]𝑚×𝑛 then 𝜌(𝐴) ≤ 𝑚𝑖𝑛(𝑚, 𝑛)
4) 𝜌(𝐼𝑛 ) = 𝑛
Page 1 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 2 3
∴ |4 5 6| = 1[−3] − 2[−6] + 3[−3]
7 8 9
1 2 3
∴ |4 5 6| = −3 + 12 − 9
7 8 9
1 2 3
∴ |4 5 6| = 0
7 8 9
∴ 𝜌(𝐴) ≠ 3
Consider any minor of A of order 2.
4 5
| | = 32 − 35 = −3 ≠ 0
7 8
∴ 𝝆(𝑨) = 𝟐
𝟏 𝟐 𝟑
2. Find the rank of the matrix 𝑨 = [𝟐 𝟒 𝟕 ] [W-23] 2M
𝟑 𝟔 𝟏𝟎
1 2 3
Sol: Given 𝐴 = [2 4 7 ]
3 6 10
1 2 3
4 7 2 7 2 4
∴ |2 4 7 | = (1) | | − (2) | | + (3) | |
6 10 3 10 3 6
3 6 10
1 2 3
∴ |2 4 7 | = 1. [40 − 42] − 2. [20 − 21] + 3. [12 − 12]
3 6 10
1 2 3
∴ |2 4 7 | = 1. [−2] − 2. [−1] + 3. [0]
3 6 10
1 2 3
∴ |2 4 7 | = −2 + 2 + 0 = 0
3 6 10
∴ 𝜌(𝐴) ≠ 3
Consider any minor of A of order 2.
4 7
| | = 40 − 42 = −2 ≠ 0
6 10
∴ 𝝆(𝑨) = 𝟐
Homework:
𝟐 𝟒 𝟏
1. Find the rank of the matrix 𝑨 = [𝟑 𝟔 𝟐]
𝟒 𝟖 𝟑
Page 2 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (20 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix (Echelon Form); Normal form of a
matrix; Consistency of non- homogeneous and homogeneous system of linear equations; Eigen
values and Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs); Cayley-
Hamilton‘s theorem (without proof) and its applications.
MR SUDHIR S DESAI
Echelon Form:
Using the row elementary operations, we can transform a given non-zero matrix to a simplified form called
a Row-echelon form. In a row-echelon form, we may have rows all of whose entries are zero. Such rows are
called zero rows. A non-zero row is one in which at least one of the entries is not zero. For instance, in the
6 0 −1
matrix, [0 0 1]
0 0 0
R1 and R2 are non-zero rows and R3 is a zero row.
Step 1
Inspect the first row. If the first row is a zero row, then the row is interchanged with a non-zero row below the
first row. If a11 is not equal to 0, then go to step 2. Otherwise, interchange the first row R1 with any other row
below the first row which has a non-zero element in the first column; if no row below the first row has non-
zero entry in the first column, then consider a12 . If a12 is not equal to 0, then go to step 2. Otherwise,
interchange the first row R1 with any other row below the first row which has a non-zero element in the second
column; if no row below the first row has non-zero entry in the second column, then consider a13. Proceed in
the same way till we get a non-zero entry in the first row. This is called pivoting and the first non-zero element
in the first row is called the pivot of the first row.
Step 2
Use the first row and elementary row operations to transform all elements under the pivot to become zeroes.
Step 3
Consider the next row as first row and perform steps 1 and 2 with the rows below this row only.
Repeat the step until all rows are exhausted.
Rank of Matrix:
The rank of a matrix in row echelon form is the number of non-zero rows in it.
Page 3 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
The elementary row operations include:
Swapping two rows.
Multiplying a row by a non-zero scalar.
Adding or subtracting the multiple of one row from another row.
Examples:
𝟏 𝟏 𝟐
1. Reduce the given matrix to echelon form 𝑨 = [𝟏 𝟐 𝟐] and find its rank. [S-24 4M]
𝟐 𝟐 𝟑
1 1 2
Sol: Given 𝐴 = [1 2 2]
2 2 3
𝑹𝟐 → 𝑹𝟐 − 𝑹𝟏
𝑹𝟐 − 𝑹𝟏
𝟏−𝟏=𝟎
𝟐−𝟏=𝟏
𝟐−𝟐=𝟎
1 1 2
∴ 𝐴 = [0 1 0]
2 2 3
𝑹𝟑 → 𝑹𝟑 − 𝟐 × 𝑹𝟏
𝑹𝟑 − 𝟐 × 𝑹𝟏
𝟐−𝟐×𝟏=𝟎
𝟐−𝟐×𝟏=𝟎
𝟑 − 𝟐 × 𝟐 = −𝟏
1 1 2
∴ 𝐴 = [𝟎 1 0 ]
𝟎 𝟎 −1
This is echelon form.
Number of non-zero rows are 3
Page 4 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 1 2
∴ 𝐴 = [0 1 1]
3 4 5
𝑹𝟑 → 𝑹𝟑 − 𝟑 × 𝑹𝟏
𝑹𝟑 − 𝟑 × 𝑹𝟏
𝟑−𝟑×𝟏=𝟎
𝟒−𝟑×𝟏=𝟏
𝟓 − 𝟑 × 𝟐 = −𝟏
1 1 2
∴ 𝐴 = [0 1 1]
0 1 −1
𝑹𝟑 → 𝑹𝟑 − 𝑹𝟐
𝑹𝟑 − 𝑹𝟐
𝟎−𝟎 =𝟎
𝟏−𝟏 =𝟎
−𝟏 − 𝟏 = −𝟐
1 1 2
∴ 𝐴 = [𝟎 1 1 ]
𝟎 𝟎 −2
This is echelon form.
Number of non-zero rows are 3
The rank of matrix A is 𝝆(𝑨) = 𝟑
𝟏 𝟐 𝟑
3. Reduce the given matrix to ECHELON form 𝑨 = [𝟐 𝟏 𝟒] and find its rank
𝟑 𝟎 𝟓
1 2 3
Sol: Given 𝐴 = [2 1 4]
3 0 5
𝑹𝟐 → 𝑹𝟐 − 𝟐 × 𝑹𝟏
𝑹𝟐 − 𝟐 × 𝑹𝟏
𝟐−𝟐×𝟏 =𝟎
𝟏 − 𝟐 × 𝟐 = −𝟑
𝟒 − 𝟐 × 𝟑 = −𝟐
1 2 3
∴ 𝐴 = [0 −3 −2]
3 0 5
𝑹𝟑 → 𝑹𝟑 − 𝟑 × 𝑹𝟏
𝑹𝟑 − 𝟑 × 𝑹𝟏
𝟑−𝟑×𝟏=𝟎
𝟎 − 𝟑 × 𝟐 = −𝟔
𝟓 − 𝟑 × 𝟑 = −𝟒
Page 5 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 2 3
∴ 𝐴 = [0 −3 −2]
0 −6 −4
𝑹𝟑 → 𝑹𝟑 − 𝟐 × 𝑹𝟐
𝑹𝟑 − 𝟐 × 𝑹𝟐
𝟎−𝟐×𝟎=𝟎
−𝟔 − 𝟐 × −𝟑 = 𝟎
−𝟒 − 𝟐 × −𝟐 = 𝟎
1 2 3
∴ 𝐴 = [𝟎 −3 −2]
𝟎 𝟎 0
This is echelon form.
Number of non-zero rows are 2
Homework:
Reduce the given matrix to ECHELON form and find its rank
𝟏 𝟐𝟑
1. 𝑨 = [𝟒 𝟓𝟔]
𝟕 𝟖𝟗
𝟏 𝟐𝟑
2. 𝑨 = [𝟐 𝟑𝟒]
𝟑 𝟒𝟓
𝟏 𝟑 𝟐
3. 𝑨=[ 𝟐 𝟔 𝟒]
−𝟏 −𝟑 −𝟐
𝟒 𝟏 𝟐
4. 𝑨 = [𝟏 𝟑 𝟒 ]
𝟐 𝟒 𝟑
𝟐 −𝟑 𝟓
5. 𝑨 = [𝟔 −𝟗 𝟏𝟓]
𝟖 −𝟏𝟐 𝟐𝟎
Page 6 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (20 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix (Normal Form); Normal form of a
matrix; Consistency of non- homogeneous and homogeneous system of linear equations; Eigen
values and Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs); Cayley-
Hamilton‘s theorem (without proof) and its applications.
MR SUDHIR S DESAI
Normal Form:
Any non-zero matrix 𝐴 can be reduced to following four forms,
Examples:
4. Reduce the following matrix to normal form and hence find its rank.
𝟏 𝟑 𝟐
𝑨 = [𝟐 𝟒] [S-23 4M]
𝟑
𝟑 𝟓 𝟒
1 2 3
Sol: Given 𝐴 = [2 3 4]
3 4 5
𝑹𝟐 → 𝑹𝟐 − 𝟐 × 𝑹𝟏 𝑹𝟑 → 𝑹𝟑 − 𝟑 × 𝑹𝟏
Page 7 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝑹𝟐 − 𝟐 × 𝑹𝟏 𝑹𝟑 − 𝟑 × 𝑹𝟏
2−2×1=0 3−3×1=0
3 − 2 × 2 = −1 4 − 3 × 2 = −2
4 − 2 × 3 = −2 5 − 3 × 3 = −4
1 2 3
∴ 𝐴 = [0 −1 −2]
0 −2 −4
𝑪𝟐 → 𝑪𝟐 − 𝟐 × 𝑪𝟏 𝑪𝟑 → 𝑪𝟑 − 𝟑 × 𝑪𝟏
𝑪𝟐 − 𝟐 × 𝑪 𝟏 𝑪𝟑 − 𝟑 × 𝑪 𝟏
2−2×1=0 3−3×1=0
−1 − 2 × 0 = −1 −2 − 3 × 0 = −2
−2 − 2 × 0 = −2 −4 − 3 × 0 = −4
1 0 0
∴ 𝐴 = [0 −1 −2]
0 −2 −4
𝟏
𝑹𝟐 → −𝟏 × 𝑹𝟐 , 𝑹𝟑 → − × 𝑹𝟑
𝟐
1 0 0
∴ 𝐴 = [0 1 2]
0 1 2
𝑹𝟑 → 𝑹𝟑 − 𝑹𝟐
𝑹𝟑 − 𝑹𝟐
0−0=0
1−1=0
2−2=0
1 0 0
∴ 𝐴 = [0 1 2]
0 0 0
𝑪𝟑 → 𝑪𝟑 − 𝟐 × 𝑪 𝟐
𝑪𝟑 − 𝟐 × 𝑪 𝟐
0−2×0=0
2−2×1=0
0−2×0=0
𝟏 𝟎 0
𝐼 0
∴ 𝐴 = [𝟎 𝟏 0] = [ 2 ]
0 0
0 0 0
This is normal form.
Number of non-zero rows are 2
Page 8 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝟏 𝟐 𝟑
5. Reduce the given matrix to normal form 𝑨 = [𝟐 𝟏 𝟒] and find its rank
𝟑 𝟎 𝟓
1 2 3
Sol: Given 𝐴 = [2 1 4]
3 0 5
𝑹𝟐 → 𝑹𝟐 − 𝟐 × 𝑹𝟏 𝑹𝟑 → 𝑹𝟑 − 𝟑 × 𝑹𝟏
𝑹𝟐 − 𝟐 × 𝑹𝟏 𝑹𝟑 − 𝟑 × 𝑹𝟏
2−2×1=0 3−3×1=0
1 − 2 × 2 = −3 0 − 3 × 2 = −6
4 − 2 × 3 = −2 5 − 3 × 3 = −4
1 2 3
∴ 𝐴 = [0 −3 −2]
0 −6 −4
𝑪𝟐 → 𝑪𝟐 − 𝟐 × 𝑪𝟏 𝑪𝟑 → 𝑪𝟑 − 𝟑 × 𝑪𝟏
𝑪𝟐 − 𝟐 × 𝑪 𝟏 𝑪𝟑 − 𝟑 × 𝑪 𝟏
2−2×1=0 3−3×1=0
−3 − 2 × 0 = −3 −2 − 3 × 0 = −2
−6 − 2 × 0 = −6 −4 − 3 × 0 = −4
1 0 0
∴ 𝐴 = [0 −3 −2]
0 −6 −4
𝟏
𝑹𝟐 → −𝟏 × 𝑹𝟐 , 𝑹𝟑 → − × 𝑹𝟑
𝟐
1 0 0
∴ 𝐴 = [0 3 2]
0 3 2
𝟏
𝑪𝟐 → 𝟑 × 𝑪𝟐
1 0 0
∴ 𝐴 = [0 1 2]
0 1 2
𝑹𝟑 → 𝑹𝟑 − 𝑹𝟐
𝑹𝟑 − 𝑹𝟐
0−0=0
1−1=0
2−2=0
1 0 0
∴ 𝐴 = [0 1 2]
0 0 0
𝑪𝟑 → 𝑪𝟑 − 𝟐 × 𝑪 𝟐
𝑪𝟑 − 𝟐 × 𝑪 𝟐
0−2×0=0
2−2×1=0
0−2×0=0
Page 9 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝟏 𝟎 0
𝐼 0
∴ 𝐴 = [𝟎 𝟏 0] = [ 2 ]
0 0
0 0 0
This is normal form.
Number of non-zero rows are 2
𝟐 −𝟑 𝟓
6. Reduce the given matrix to normal form 𝑨 = [𝟔 −𝟗 𝟏𝟓] and find its rank
𝟖 −𝟏𝟐 𝟐𝟎
2 −3 5
Sol: Given 𝐴 = [6 −9 15]
8 −12 20
𝑪𝟏 → 𝑪𝟑 − 𝟐 × 𝑪 𝟏
𝑪𝟑 − 𝟐 × 𝑪 𝟏
5−2×2=1
15 − 2 × 6 = 3
20 − 2 × 8 = 4
1 −3 5
∴ 𝐴 = [3 −9 15]
4 −12 20
𝑹𝟐 → 𝑹𝟐 − 𝟑 × 𝑹𝟏 𝑹𝟑 → 𝑹𝟑 − 𝟒 × 𝑹𝟏
𝑹𝟐 − 𝟑 × 𝑹𝟏 𝑹𝟑 − 𝟒 × 𝑹𝟏
3−3×1=0 4−4×1=0
−9 − 3 × −3 = 0 −12 − 4 × −3 = 0
15 − 3 × 5 = 0 20 − 4 × 5 = 0
1 −3 5
∴ 𝐴 = [ 0 0 0]
0 0 0
𝑪𝟐 → 𝑪𝟐 + 𝟑 × 𝑪𝟏 𝑪𝟑 → 𝑪𝟑 − 𝟓 × 𝑪𝟏
𝑪𝟐 + 𝟑 × 𝑪 𝟏 𝑪𝟑 − 𝟓 × 𝑪 𝟏
−3 + 3 × 1 = 0 5−5×1=0
0+3×0=0 0−5×0=0
0+3×0=0 0−5×0=0
1 0 0
∴ 𝐴 = [0 0 0]
0 0 0
This is normal form.
Number of non-zero rows are 1
Page 10 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
Homework:
Reduce the given matrix to Normal form and find its rank
𝟏𝟑 𝟐
6. 𝑨 = [𝟒 𝟔] 𝟓
𝟕 𝟗 𝟖
𝟏 𝟐 𝟏
7. 𝑨 = [𝟏 𝟑] 𝟐
𝟑 𝟓 𝟒
𝟏 𝟑 𝟐
8. 𝑨 = [ 𝟐 𝟔 𝟒]
−𝟏 −𝟑 −𝟐
𝟒 𝟏 𝟐
9. 𝑨 = [𝟏 𝟑 𝟒]
𝟐 𝟒 𝟑
Page 11 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (12 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix; Normal form of a matrix;
Consistency of non- homogeneous and homogeneous system of linear equations; Eigen values and
Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs); Cayley-Hamilton‘s
theorem (without proof) and its applications. MR SUDHIR S DESAI
EXAMPLE:
𝟑 −𝟑 𝟒
1. Solve by using Gauss Jordan method Find inverse of matrix 𝑨 = [𝟐 −𝟑 𝟒] [W-23 4M]
𝟎 −𝟏 𝟏
Sol: Write the matrix in the form. 𝐴. 𝐴−1 = 𝐼
3 −3 4 1 0 0
∴ [2 −3 4] . 𝐴−1 = [0 1 0]
0 −1 1 0 0 1
𝑅1 → 𝑅1 − 𝑅2
1 0 0 1 −1 0
∴ [2 −3 4] . 𝐴−1 = [0 1 0]
0 −1 1 0 0 1
𝑅2 → 𝑅2 − 2 ∗ 𝑅1
1 0 0 1 −1 0
∴ [0 −3 4] . 𝐴−1 = [−2 3 0]
0 −1 1 0 0 1
𝑅2 ↔ 𝑅3
1 0 0 1 −1 0
∴ [0 −1 1] . 𝐴−1 = [ 0 0 1]
0 −3 4 −2 3 0
𝑅2 → −𝑅2
1 0 0 1 −1 0
∴ [0 1 −1] . 𝐴−1 = [ 0 0 −1]
0 −3 4 −2 3 0
Page 12 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝑅3 → 𝑅3 + 3 ∗ 𝑅2
1 0 0 1 −1 0
∴ [0 1 −1] . 𝐴−1 = [ 0 0 −1]
0 0 1 −2 3 −3
𝑅2 → 𝑅2 + 𝑅3
1 0 0 1 −1 0
∴ [0 1 0] . 𝐴−1 = [−2 3 −4]
0 0 1 −2 3 −3
1 −1 0
∴ 𝐼. 𝐴−1 = [−2 3 −4]
−2 3 −3
𝟏 −𝟏 𝟎
∴ 𝑨−𝟏 = [−𝟐 𝟑 −𝟒]
−𝟐 𝟑 −𝟑
𝟐 𝟏 −𝟏
2. Use Gauss Jordan method to Find inverse of matrix 𝑨 = [𝟎 𝟐 −𝟏] (Dec-2018)
𝟓 𝟐 −𝟑
Sol: Write the matrix in the form. 𝐴. 𝐴−1 = 𝐼
2 1 −1 1 0 0
∴ [0 2 −1] . 𝐴−1 = [0 1 0]
5 2 −3 0 0 1
𝑅1
𝑅1 →
2
1 −1 1
1 0 0
∴[ 2 2 ] . 𝐴−1 = [2 ]
0 2 −1 0 1 0
5 2 −3 0 0 1
𝑅3 → 𝑅3 − 5 ∗ 𝑅1
1 −1 1
1 0 0
2 2 2
−1
∴ 0 2 −1 . 𝐴 = 0 1 0
1 −1 −5
[0 − 2 2 ] [ 2
0 1]
𝑅2
𝑅2 →
2
1 −1 1
1 0 0
2 2 2
−1 1
∴ 0 1 . 𝐴−1 = 0 0
2 2
1 −1 −5
[0 − 2 2 ] [ 2
0 1]
𝑅1 → 𝑅1 + 𝑅3
1 0
−1 −2 0 1
−1 1
0 1 −1 0 0
∴ 2 .𝐴 = 2
1 −1 −5
[0 − 2 2 ] [ 2 0 1]
1
𝑅3 → 𝑅3 + ∗ 𝑅2
2
Page 13 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 0 −1 −2 0 1
−1 1
0 1 −1 0 0
∴ 2 .𝐴 = 2
−3 −5 1
[0 0 [ 2 4 1]
4]
−4
𝑅3 → ∗ 𝑅3
3
−2 0 1
1 0 −1 1
−1 0 0
∴ [0 1 ] . 𝐴−1 = 2
2 10 −1 −4
0 0 1
[3 3 3]
𝑅1 → 𝑅1 + 𝑅3
4−1 −1
1 0 0 33 3
−1 1
∴ [0 1 ] . 𝐴−1 = 0 0
2 2
0 0 1 10 −1 −4
[3 3 3]
1
𝑅2 → 𝑅2 + ∗ 𝑅3
2
4 −1 −1
3 3 3
1 0 0 5 1 −2
−1
∴ [ 0 1 0] . 𝐴 =
0 0 1 3 3 3
10 −1 −4
[3 3 3]
4 −1 −1
3 3 3
5 1 −2
∴ 𝐼. 𝐴−1 =
3 3 3
10 −1 −4
[3 3 3]
𝟒 −𝟏 −𝟏
𝟑 𝟑 𝟑
𝟓 𝟏 −𝟐
∴ 𝑨−𝟏 =
𝟑 𝟑 𝟑
𝟏𝟎 −𝟏 −𝟒
[𝟑 𝟑 𝟑]
𝟐 𝟎 −𝟏
3. Use Gauss Jordan method to Find inverse of matrix 𝑨 = [𝟓 𝟏 𝟎 ]
𝟎 𝟏 𝟑
Sol: Write the matrix in the form. 𝐴. 𝐴−1 = 𝐼
2 0 −1 1 0 0
−1
∴ [ 5 1 0 ] . 𝐴 = [ 0 1 0]
0 1 3 0 0 1
𝑅1
𝑅1 →
2
Page 14 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
−1 1
1 0 0 0
∴[ 2 ] . 𝐴−1 = [2 ]
5 1 0 0 1 0
0 1 3 0 0 1
𝑅2 → 𝑅2 − 5 ∗ 𝑅1
−1 1
1 0 0 0
2 2
−1
∴ 5 . 𝐴 = −5
0 1 1 0
2 2
[0 1 3 ] [0 0 1]
𝑅3 → 𝑅3 − 𝑅2
−1 1
1 0 0 0
2 2
5 −5
∴ 0 1 . 𝐴−1 = 1 0
2 2
1 5
[0 0 2 ] [ 2 −1 1]
𝑅3 → 2 ∗ 𝑅3
−1 1
1 0 0 0
2 2
∴ 5 . 𝐴−1 = −5
0 1 1 0
2 2
[0 0 1 ] [5 −2 2]
1
𝑅1 → 𝑅1 + ∗ 𝑅3
2
1 0 0 3 −1 1
5 −5
∴ [0 1 ] . 𝐴−1 = [ 1 0]
2 2
0 0 1 5 −2 2
5
𝑅2 → 𝑅2 − ∗ 𝑅3
2
1 0 0 3 −1 1
∴ [0 1 0] . 𝐴−1 = [−15 6 −5]
0 0 1 5 −2 2
3 −1 1
∴ 𝐼. 𝐴−1 = [−15 6 −5]
5 −2 2
𝟑 −𝟏 𝟏
∴ 𝑨−𝟏 = [−𝟏𝟓 𝟔 −𝟓]
𝟓 −𝟐 𝟐
𝟏 𝟐 −𝟐
4. Use Gauss Jordan method to Find inverse of matrix 𝑨 = [ 𝟎 −𝟐 𝟏 ] [S-24, 4M]
−𝟏 𝟑 𝟎
Sol: Write the matrix in the form. 𝐴. 𝐴−1 = 𝐼
1 2 −2 1 0 0
∴ [ 0 −2 1 ] . 𝐴−1 = [0 1 0]
−1 3 0 0 0 1
𝑅3 → 𝑅3 + 𝑅1
Page 15 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 2 −2 1 0 0
∴ [0 −2 1 ] . 𝐴−1 = [0 1 0]
0 5 −2 1 0 1
𝑅2 → 2 ∗ 𝑅2 + 𝑅3
1 2 −2 1 0 0
∴ [0 1 0 ] . 𝐴−1 = [1 2 1]
0 5 −2 1 0 1
𝑅1 → 𝑅1 − 2 ∗ 𝑅2 , 𝑅3 → 𝑅3 − 5 ∗ 𝑅2
1 0 −2 −1 −4 −2
∴ [0 1 0 ] . 𝐴−1 = [ 1 2 1]
0 0 −2 −4 −10 −4
𝑅3
𝑅3 →
−2
1 0 −2 −1 −4 −2
∴ [0 1 0 ] . 𝐴−1 = [ 1 2 1]
0 0 1 2 5 2
𝑅1 → 𝑅1 + 2 ∗ 𝑅3
1 0 0 3 6 2
∴ [0 1 0] . 𝐴−1 = [1 2 1]
0 0 1 2 5 2
3 6 2
∴ 𝐼. 𝐴−1 = [1 2 1]
2 5 2
𝟑 𝟔 𝟐
∴ 𝑨−𝟏 = [𝟏 𝟐 𝟏]
𝟐 𝟓 𝟐
Page 16 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
Homework:
Use Gauss Jordan method to find the inverse of matrix 𝑨
𝟏 𝟐 𝟑
1. [𝟐 𝟒 𝟓]
𝟑 𝟓 𝟔
𝟏 𝟑 𝟎
2. [−𝟏 𝟐 𝟏]
𝟎 𝟎 𝟐
𝟏 𝟏 𝟑
3. [ 𝟏 𝟑 −𝟑]
−𝟐 −𝟒 −𝟒
𝟐 𝟑 𝟒
4. [𝟒 𝟑 𝟏]
𝟏 𝟐 𝟒
𝟏 𝟐 −𝟐
5. [−𝟏 𝟑 𝟎 ] [S-23 4M]
𝟎 −𝟐 𝟏
Page 17 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (20 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix; Normal form of a matrix;
Consistency of non- homogeneous and homogeneous system of linear equations; Eigen values and
Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs); Cayley-Hamilton‘s
theorem (without proof) and its applications. MR SUDHIR S DESAI
Course Outcome: After completion of this course, students will be able to
CO2: Implement matrix concept to solve real life problems.
To check the consistency (i.e. if the system of equation has at least one solution) we find the rank of
matrices.
𝑎11 𝑎12 𝑎13 … 𝑎1𝑛
𝑎21 𝑎22 𝑎23 … 𝑎2𝑛
𝐴=[ ⋮ ⋮ ⋮ … ⋮ ]
𝑎𝑚1 𝑎𝑚2 𝑎𝑚3 … 𝑎𝑚𝑛
And
𝑎11 𝑎12 𝑎13 … 𝑎1𝑛 𝑏1
𝑎21 𝑎22 𝑎23 … 𝑎2𝑛 𝑏2
𝐾 = [𝐴: 𝐵] = [ ⋮ ⋮ ⋮ … ⋮ | ⋮ ]
𝑎𝑚1 𝑎𝑚2 𝑎𝑚3 … 𝑎𝑚𝑛 𝑏𝑚
Here 𝐴 is called coefficient matrix & 𝐾 is called augmented matrix of equation 1)
We find the rank of matrix A & K by reducing them to triangular form by applying elementary row
transformations.
Page 18 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
Examples:
1. Determine the consistency of set of equations. 𝒙 − 𝟐𝒚 + 𝒛 = −𝟓, 𝒙 + 𝟓𝒚 − 𝟕𝒛 = 𝟐, 𝟑𝒙 + 𝒚 − 𝟓𝒛 = 𝟏.
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
1 −2 1 𝑥 −5
∴ [1 5 −7] [𝑦] = [ 2 ]
3 1 −5 𝑧 1
𝑅2 → 𝑅2 − 𝑅1 , 𝑅3 → 𝑅3 − 3 × 𝑅1
𝑹𝟐 − 𝑹𝟏 𝑹𝟑 − 𝟑 × 𝑹𝟏
1−1=0 3−3×1 = 0
5 − (−2) = 7 1 − 3 × (−2) = 7
−7 − 1 = −8 −5 − 3 × 1 = −8
2 − (−5) = 7 1 − 3 × (−5) = 16
1 −2 1 𝑥 −5
∴ [0 7 −8] [𝑦] = [ 7 ]
0 7 −8 𝑧 16
𝑅3 → 𝑅3 − 𝑅2
𝑹𝟑 − 𝑹𝟐
0−0 = 0
7 − 7 = 7)
−8 − (−8) = 0
16 − 7 = 9
1 −2 1 𝑥 −5
∴ [0 7 −8] [𝑦] = [ 7 ]
0 0 0 𝑧 9
1 −2 1 −5
Here 𝜌(𝐴) = 2 & 𝜌(𝐾) = [0 7 −8| 7 ] = 3.
0 0 0 9
∴ 𝜌(𝐴) = 2 ≠ 𝜌(𝐾) = 3
System is in consistent & has no solution.
2. Test for consistency and solve: 𝟓𝒙 + 𝟑𝒚 + 𝟕𝒛 = 𝟒, 𝟑𝒙 + 𝟐𝟔𝒚 + 𝟐𝒛 = 𝟗, 𝟕𝒙 + 𝟐𝒚 + 𝟏𝟎𝒛 = 𝟓 [S-24 4M]
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
5 3 7 𝑥 4
∴ [3 26 2 ] [𝑦] = [9]
7 2 10 𝑧 5
𝑅2 → 5 × 𝑅2 − 3 × 𝑅1 , 𝑅3 → 5 × 𝑅3 − 7 × 𝑅1
𝟓 × 𝑹𝟐 − 𝟑 × 𝑹𝟏 𝟓 × 𝑹𝟑 − 𝟕 × 𝑹𝟏
5×3−3×5=0 5×7−7×5=0
5 × 26 − 3 × 3 = 121 5 × 2 − 7 × 3 = −11
5 × 2 − 3 × 7 = −11 5 × 10 − 7 × 7 = 1
5 × 9 − 3 × 4 = 33 5 × 5 − 7 × 4 = −3
5 3 7 𝑥 4
∴ [0 121 −11] [𝑦] = [ 33 ]
0 −11 1 𝑧 −3
Page 19 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝑅3 → 11 × 𝑅3 + 𝑅2
𝟏𝟏 × 𝑹𝟑 − 𝑹𝟐
11 × 0 − 0 = 0
11 × −11 + 121 = 0
11 × 1 + (−11) = 0
11 × −3 + 33 = 0
5 3 7 𝑥 4
∴ [0 121 −11] [𝑦] = [33] … … … (1)
0 0 0 𝑧 0
5 3 7 4
Here 𝜌(𝐴) = 2 & 𝜌(𝐾) = [0 121 −11|33] = 2.
0 0 0 0
∴ 𝜌(𝐴) = 2 = 𝜌(𝐾) = 2
This system is consistent.
Assign 𝑛 − 𝑟 = 3 − 2 = 1 parameter.
Consider 𝒛 = 𝒕
From equation 1)
∴ 5𝑥 + 3𝑦 + 7𝑧 = 4 … … … . (2)
∴ 121𝑦 − 11𝑧 = 33 … … … . (3)
Put 𝑧 = 𝑡 in equation 3)
∴ 121𝑦 − 11𝑡 = 33
∴ 121𝑦 = 33 + 11𝑡
Divide by 121
𝟑 𝟏
∴𝒚= + 𝒕
𝟏𝟏 𝟏𝟏
3 1
Put 𝑦 = 11 + 11 𝑡 & 𝑧 = 𝑡 in equation 1)
3 1
∴ 5𝑥 + 3 ( + 𝑡) + 7𝑡 = 4
11 11
9 3
∴ 5𝑥 + + 𝑡 + 7𝑡 = 4
11 11
80 9
∴ 5𝑥 + 𝑡 = 4 −
11 11
80 35
∴ 5𝑥 + 𝑡 =
11 11
35 80
∴ 5𝑥 = − 𝑡
11 11
Divide by 5
𝟕 𝟏𝟔
∴𝒙= − 𝒕
𝟏𝟏 𝟏𝟏
Page 20 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
3. Examine the following linear system of equation for consistency & solve it if consistent.
𝟒𝒙 − 𝟐𝒚 + 𝟔𝒛 = 𝟖, 𝒙 + 𝒚 − 𝟑𝒛 = −𝟏, 𝟏𝟓𝒙 − 𝟑𝒚 + 𝟗𝒛 = 𝟐𝟏 [S-23, W-23 4M]
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
4 −2 6 𝑥 8
∴[1 1 −3] [𝑦] = [−1]
15 −3 9 𝑧 21
𝑅1 ↔ 𝑅2
1 1 −3 𝑥 −1
∴ [ 4 −2 6 ] [𝑦] = [ 8 ]
15 −3 9 𝑧 21
𝑅2 → 𝑅2 − 4 × 𝑅1 , 𝑅3 → 𝑅3 − 15 × 𝑅1
𝑹𝟐 − 𝟒 × 𝑹𝟏 𝑹𝟑 − 𝟏𝟓 × 𝑹𝟏
4−4×1=0 15 − 15 × 1 = 0
−2 − 4 × 1 = −6 −3 − 15 × 1 = −18
6 − 4 × (−3) = 18 9 − 15 × (−3) = 54
8 − 4 × (−1) = 12 21 − 15 × (−1) = 36
1 1 −3 𝑥 −1
∴ [0 −6 18 ] [𝑦] = [ 12 ]
0 −18 54 𝑧 36
𝑅3 → 𝑅3 − 3 × 𝑅2
𝑹𝟑 − 𝟑 × 𝑹𝟐
0−3×0=0
−18 − 3 × −6 = 0
54 − 3 × 15 = 0
36 − 3 × 12 = 0
1 1 −3 𝑥 −1
𝑦
∴ [0 −6 18 ] [ ] = [ 12 ] … … … . (1)
0 0 0 𝑧 0
1 1 −3 −1
Here 𝜌(𝐴) = 2 & 𝜌(𝐾) = [0 −6 18 | 12 ] = 2.
0 0 0 0
∴ 𝜌(𝐴) = 2 = 𝜌(𝐾) = 2
This system is consistent.
Assign 𝑛 − 𝑟 = 3 − 2 = 1 parameter.
Consider 𝒛 = 𝒕
From equation 1)
∴ 𝑥 + 𝑦 − 3𝑧 = −1 … … … . (2)
∴ −6𝑦 + 18𝑧 = 12 … … … . (3)
Put 𝑧 = 𝑡 in equation 3)
∴ −6𝑦 + 18(𝑡) = 12
∴ −6𝑦 = 12 − 18𝑡
Divide by −6
Page 21 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
∴ 𝒚 = −𝟐 + 𝟑𝒕
Put 𝑦 = −2 + 3𝑡, 𝑧 = 𝑡 in equation 1)
∴ 𝑥 + (−2 + 3𝑡) − 3𝑡 = −1
∴ 𝑥 − 2 + 3𝑡 − 3𝑡 = −1
∴ 𝑥 − 2 = −1
∴ 𝑥 = −1 + 2
∴𝒙=𝟏
Page 23 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
0−0=0
−11 − (−11) = 0
17 − 17 = 0
−1 − (−1) = 0
1 4 −6 𝑥 1
[0 −11 17 ] [𝑦] = [−1] … … . .1)
0 0 0 𝑧 0
1 4 −6 1
Here 𝜌(𝐴) = 2 & 𝜌(𝐾) = [0 −11 17 |−1] = 2
0 0 0 0
∴ 𝜌(𝐴) = 2 = 𝜌(𝐾) = 2 < 𝑛 = 3
System is consistent & has infinite solution.
From equation 1), we get.
𝑥 + 4𝑦 − 6𝑧 = 1 … … 2)
−11𝑦 + 17𝑧 = −1 … . .3)
Consider 𝒛 = 𝒕
From equation 3)
∴ −11𝑦 + 17𝑡 = −1
∴ −11𝑦 = −1 − 17𝑡
∴ 11𝑦 = 1 + 17𝑡
𝟏 𝟏𝟕
∴𝒚= + 𝒕
𝟏𝟏 𝟏𝟏
From equation 2)
1 17
𝑥 + 4[ + 𝑡] − 6𝑡 = 1
11 11
4 68
∴𝑥+ + 𝑡 − 6𝑡 = 1
11 11
4 2
∴𝑥+ + 𝑡=1
11 11
4 2
∴𝑥 =1− − 𝑡
11 11
𝟕 𝟐
∴𝒙= − 𝒕
𝟏𝟏 𝟏𝟏
𝟕 𝟐 𝟏 𝟏𝟕
The required solution is (𝟏𝟏 − 𝟏𝟏 𝒕, 𝟏𝟏 + 𝟏𝟏 𝒕, 𝒕)
6. For what value of k is the following system of equations is consistent & hence solve for them
𝒙 + 𝒚 + 𝒛 = 𝟏, 𝒙 + 𝟐𝒚 + 𝟒𝒛 = 𝒌, 𝒙 + 𝟒𝒚 + 𝟏𝟎𝒛 = 𝒌𝟐
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
1 1 1 𝑥 1
[1 2 4 ] [𝑦] = [ 𝑘 ]
1 4 10 𝑧 𝑘2
𝑅2 → 𝑅2 − 𝑅1 , 𝑅3 → 𝑅3 − 𝑅1
Page 24 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝑹𝟐 − 𝑹𝟏 𝑹𝟑 − 𝑹𝟏
1−1=0 1−1=0
2−1=1 4−1=3
4−1=3 10 − 1 = 9
𝑘−1=𝑘−1 𝑘2 − 1 = 𝑘2 − 1
1 1 1 𝑥 1
[0 1 3] [𝑦] = [ 𝑘 − 1 ]
0 3 9 𝑧 𝑘2 − 1
𝑅3 → 𝑅3 − 3 × 𝑅2
𝑹𝟑 − 𝟑 × 𝑹𝟐
0−3×0 = 0
3−3×1 = 0
9−3×3 = 0
𝑘 2 − 1 − 3 × (𝑘 − 1) = 𝑘 2 − 1 − 3𝑘 + 3 = 𝑘 2 − 3𝑘 + 2
1 1 1 𝑥 1
[0 1 3] [𝑦] = [ 𝑘 − 1 ] … . .1)
0 0 0 𝑧 𝑘 2 − 3𝑘 + 2
Here 𝜌(𝐴) = 2
The rank of k also be 2 if 𝑘 2 − 3𝑘 + 2 = 0, on solving we get 𝑘 = 1,2.
The ranks of A & K will be equal for 𝑘 = 1,2.
The given system equation will be consistent for 𝑘 = 1,2.
We get 𝜌(𝐴) = 2 = 𝜌(𝐾) = 2 < 𝑛 = 3
Hence the system have infinite no. of solutions for 𝑘 = 1,2.
For 𝒌 = 𝟏.
Equation 1) becomes;
1 1 1 𝑥 1
[0 1 3] [𝑦] = [ 1−1 ]
𝑧 2
0 0 0 1 − 3(1) + 2
1 1 1 𝑥 1
[0 1 3] [𝑦] = [0]
0 0 0 𝑧 0
𝑥+𝑦+𝑧 =1
𝑦 + 3𝑧 = 0
Put 𝒛 = 𝒕
𝑦 + 3𝑡 = 0 → 𝒚 = −𝟑𝒕
Put 𝑦 = −3𝑡 & 𝑧 = 𝑡
𝑥 + (−3𝑡) + 𝑡 = 1
𝑥 − 2𝑡 = 1 → 𝒙 = 𝟏 + 𝟐𝒕
The required solution is (1 + 2𝑡, −3𝑡, 𝑡)
Page 25 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
For 𝒌 = 𝟐.
Equation 1) becomes;
1 1 1 𝑥 1
[0 1 3] [𝑦] = [ 2−1 ]
𝑧 2
0 0 0 2 − 3(2) + 2
1 1 1 𝑥 1
[0 1 3] [𝑦] = [1]
0 0 0 𝑧 0
𝑥+𝑦+𝑧 =1
𝑦 + 3𝑧 = 1
Put 𝒛 = 𝒕𝟏
𝑦 + 3𝑡1 = 1 → 𝒚 = 𝟏 − 𝟑𝒕𝟏
Put 𝑦 = 1 − 3𝑡1 & 𝑧 = 𝑡1
𝑥 + 1 − 3𝑡1 + 𝑡1 = 1
𝑥 + 1 − 2𝑡1 = 1 → 𝑥 = 1 + 2𝑡1 − 1 → 𝒙 = 𝟐𝒕𝟏
The required solution is (2𝑡1 , 1 − 3𝑡1 , 𝑡1 )
HOMEWORK:
Check the consistency of set of equations & solve.
1. 𝟓𝒙 + 𝟑𝒚 + 𝟕𝒛 = 𝟒, 𝟑𝒙 + 𝟐𝟔𝒚 + 𝟐𝒛 = 𝟗, 𝟕𝒙 + 𝟐𝒚 + 𝟏𝟎𝒛 = 𝟓
2. 𝟒𝒙 − 𝟐𝒚 + 𝟔𝒛 = 𝟖, 𝒙 + 𝒚 − 𝟑𝒛 = −𝟏, 𝟏𝟓𝒙 − 𝟑𝒚 + 𝟗𝒛 = 𝟐𝟏
3. 𝒙 − 𝟐𝒚 + 𝟑𝒕 = 𝟐, 𝟐𝒙 + 𝒚 + 𝒛 + 𝒕 = 𝟒, 𝟒𝒙 − 𝟑𝒚 + 𝒛 + 𝟕𝒕 = 𝟖
4. 𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 = 𝟑, 𝟐𝒙𝟏 − 𝒙𝟐 + 𝟑𝒙𝟑 = 𝟏, 𝟒𝒙𝟏 + 𝒙𝟐 + 𝟓𝒙𝟑 = 𝟐, 𝟑𝒙𝟏 − 𝟐𝒙𝟐 + 𝒙𝟑 = 𝟒
5. 𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 = 𝟔, 𝒙𝟏 − 𝒙𝟐 + 𝟐𝒙𝟑 = 𝟓, 𝟑𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 = 𝟖, 𝟐𝒙𝟏 − 𝟐𝒙𝟐 + 𝟑𝒙𝟑 = 𝟕
6. 5𝒙 + 𝟑𝒚 + 𝟕𝒛 = 𝟒, 𝟑𝒙 + 𝟐𝟔𝒚 + 𝟐𝒛 = 𝟗, 𝟕𝒙 + 𝟐𝒚 + 𝟏𝟎𝒛 = 𝟓
Page 26 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (20 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix; Normal form of a matrix;
Consistency of non- homogeneous and homogeneous system of linear equations; Eigen values and
Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs); Cayley-Hamilton‘s
theorem (without proof) and its applications. MR SUDHIR S DESAI
Course Outcome: After completion of this course, students will be able to
CO2: Implement matrix concept to solve real life problems.
To check the consistency (i.e. if the system of equation has at least one solution) we find the rank of
matrices.
𝑎11 𝑎12 𝑎13 … 𝑎1𝑛
𝑎21 𝑎22 𝑎23 … 𝑎2𝑛
𝐴=[ ⋮ ⋮ ⋮ … ⋮ ]
𝑎𝑚1 𝑎𝑚2 𝑎𝑚3 … 𝑎𝑚𝑛
Here 𝐴 is called coefficient matrix of equation 1)
We find the rank of matrix A by reducing them to triangular form by applying elementary row
transformations.
Case I) If 𝜌(𝐴) = 𝑛 (𝐍𝐮𝐦𝐛𝐞𝐫 𝐨𝐟 𝐮𝐧𝐤𝐧𝐨𝐰𝐧𝐬) then the system of equation 1) will have only a trivial
solution. 𝑥1= 𝑥2 = 𝑥3 = ⋯ … … = 𝑥𝑛 = 0
Case II) If 𝜌(𝐴) < 𝑛 (𝐍𝐮𝐦𝐛𝐞𝐫 𝐨𝐟 𝐮𝐧𝐤𝐧𝐨𝐰𝐧𝐬) then the system of equation 1) will have infinite number of
solution (non-trivial solution) & assign 𝑛 − 𝑟 parameters to variables.
Note: The necessary & sufficient condition for the system of equations 1) to have non trivial solution is
that determinant of coefficient matrix is zero.
Page 27 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
Examples:
1. Solve the equations. 𝒙 + 𝟐𝒚 + 𝟑𝒛 = 𝟎, 𝟑𝒙 + 𝟒𝒚 + 𝟒𝒛 = 𝟎, 𝟕𝒙 + 𝟏𝟎𝒚 + 𝟏𝟐𝒛 = 𝟎.
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
1 2 3 𝑥 0
∴ [3 4 4 ] [𝑦] = [0]
7 10 12 𝑧 0
𝑅2 → 𝑅2 − 3 × 𝑅1 , 𝑅3 → 𝑅3 − 7 × 𝑅1
𝑹𝟐 − 𝟑 × 𝑹𝟏 𝑹𝟑 − 𝟕 × 𝑹𝟏
3−3×1 = 0 7−7×1=0
4 − 3 × 2 = −2 10 − 7 × 2 = −4
4 − 3 × 3 = −5 12 − 7 × 3 = −9
1 2 3 𝑥 0
∴ [0 −2 −5] [𝑦] = [0]
0 −4 −9 𝑧 0
𝑅3 → 𝑅3 − 2 × 𝑅2
𝑹𝟑 − 𝟐 × 𝑹𝟐
0−2×0=0
−4 − 2 × (−2) = 0
−9 − 2 × (−5) = 1
1 2 3 𝑥 0
∴ [0 −2 −5] [𝑦] = [0]
0 0 1 𝑧 0
Here 𝜌(𝐴) = 3 &. Number of unknowns = 3.
∴ 𝜌(𝐴) = 𝑛 = 3
System will have a trivial solution.
𝒙 = 𝒚 = 𝒛 = 𝟎.
2. Solve the equations. 𝒙 + 𝟑𝒚 + 𝟐𝒛 = 𝟎, 𝟐 𝒙 − 𝒚 + 𝟑𝒛 = 𝟎, 𝟑𝒙 − 𝟓𝒚 + 𝟒𝒛 = 𝟎.
Sol: The given system of equation can be written as, 𝐴𝑋 = 𝐵
1 3 2 𝑥 0
∴ [2 −1 3] [𝑦] = [0]
3 −5 4 𝑧 0
𝑅2 → 𝑅2 − 2 × 𝑅1 , 𝑅3 → 𝑅3 − 3 × 𝑅1
𝑹𝟐 − 𝟐 × 𝑹𝟏 𝑹𝟑 − 𝟑 × 𝑹𝟏
2−2×1=0 3−3×1 = 0
−1 − 2 × 3 = −7 −5 − 3 × 3 = −14
3 − 2 × 2 = −1 4 − 3 × 2 = −2
1 3 2 𝑥 0
∴ [0 −7 −1] [𝑦] = [0]
0 −14 −2 𝑧 0
𝑅3 → 𝑅3 − 2 × 𝑅2
𝑹𝟑 − 𝟐 × 𝑹𝟐
Page 28 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
0−2×0=0
−14 − 2 × (−7) = 0
−2 − 2 × (−1) = 0
1 3 2 𝑥 0
∴ [0 −7 −1] [𝑦] = [0] … … … 1)
0 0 0 𝑧 0
Here 𝜌(𝐴) = 2 < 𝑛 = 3.
System will have infinite number of solutions.
Assign 𝑛 − 𝑟 = 3 − 2 = 1 parameter.
Consider 𝒛 = 𝒕
From equation 1), we get.
𝑥 + 3𝑦 + 2𝑧 = 0 … … 2)
−7𝑦 − 𝑧 = 0 … . .3)
∴ −7𝑦 − 𝑡 = 0 ⇒ 7𝑦 + 𝑡 = 0
−𝒕
∴ 7𝑦 = −𝑡 ⟹ 𝒚 =
𝟕
−𝑡
Put 𝑦 = ,𝑧 = 𝑡 in equation 2)
7
−𝑡
∴ 𝑥 + 3 ( ) + 2𝑡 = 0
7
3𝑡
∴ 𝑥 − + 2𝑡 = 0
7
11𝑡 𝟏𝟏𝒕
∴𝑥+ =0⟹ 𝒙=−
7 𝟕
𝟏𝟏𝒕 𝒕
The required solution is (− 𝟕
, − 𝟕 , 𝒕)
Page 29 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
UNIT 2
MATRICES (20 MARKS)
Topic Content: Inverse of a matrix by Gauss-Jordan method; Rank of a matrix; Normal form of a matrix;
Consistency of non- homogeneous and homogeneous system of linear equations; Eigen values and
Eigen vectors; Properties of Eigen values and Eigen vectors (without proofs)
MR SUDHIR S DESAI
Course Outcome: After completion of this course, students will be able to
CO2: Implement matrix concept to solve real life problems.
Page 30 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
Examples:
𝟓 𝟒
1. Find the Eigen values for the following matrix. 𝑨 = [ ] [S-23, W-23 2M]
𝟏 𝟐
5 4
Sol: Given 𝐴 = [ ]
1 2
The characteristic equation is |𝐴 − 𝜆𝐼| = 0
5−𝜆 4 +6
∴| |=0 ×
1 2−𝜆
∴ (5 − 𝜆)(2 − 𝜆) − (4)(1) = 0
-6 -1
∴ 10 − 5𝜆 − 2𝜆 + 𝜆2 − 4 = 0 + -7
2
∴ 𝜆 − 7𝜆 + 6 = 0
∴ (𝜆 − 6)(𝜆 − 1) = 0
∴𝜆−6=0&𝜆−1=0
∴ 𝝀=𝟔&𝝀=𝟏
These are required Eigen Values.
𝟏 𝟐
2. Find the Eigen values & Eigen vectors for the following matrix. 𝑨 = [ ]
𝟒 𝟑
1 2
Sol: Given 𝐴 = [ ]
4 3
The characteristic equation is |𝐴 − 𝜆𝐼| = 0
1−𝜆 2
∴| |=0
4 3−𝜆
∴ (1 − 𝜆)(3 − 𝜆) − (2)(4) = 0
∴ 3 − 𝜆 − 3𝜆 + 𝜆2 − 8 = 0
∴ 𝜆2 − 4𝜆 − 5 = 0
∴ (𝜆 − 5)(𝜆 + 1) = 0
∴𝜆−5=0&𝜆+1=0
∴ 𝝀 = 𝟓 & 𝝀 = −𝟏
These are required Eigen Values.
To find Eigen Vectors:
Consider [𝐴 − 𝜆𝐼]𝑋 = 0
1−𝜆 2 𝑥1 0
∴[ ] [𝑥 ] = [ ] … … .1)
4 3−𝜆 2 0
For 𝝀 = 𝟓:
Put 𝜆 = 5 in equation 1)
1−5 2 𝑥1 0
∴[ ] [𝑥 ] = [ ]
4 3−5 2 0
−4 2 𝑥1 0
∴[ ][ ] = [ ]
4 −2 𝑥2 0
∴ −𝟒𝒙𝟏 + 𝟐𝒙𝟐 = 𝟎 … … . . 𝟐)
Page 31 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
& 𝟒𝒙𝟏 − 𝟐𝒙𝟐 = 𝟎 … … … . 𝟑)
Consider, 4𝑥1 − 2𝑥2 = 0
Divide by 2
∴ 2𝑥1 − 𝑥2 = 0
∴ 2𝑥1 = 𝑥2
𝑥1 𝑥2
∴ =
1 2
∴ 𝑥1 = 1 & 𝑥2 = 2
𝟏
∴ For 𝝀 = 𝟓 the required Eigen vector is [ ]
𝟐
For 𝝀 = −𝟏:
Put 𝜆 = −1 in equation 1)
1 − (−1) 2 𝑥1 0
∴[ ][ ] = [ ]
4 3 − (−1) 𝑥2 0
2 2 𝑥1 0
∴[ ][ ] = [ ]
4 4 𝑥2 0
∴ 𝟐𝒙𝟏 + 𝟐𝒙𝟐 = 𝟎 … … . . 𝟒)
& 𝟒𝒙𝟏 + 𝟒𝒙𝟐 = 𝟎 … … . . 𝟓)
Consider, 4𝑥1 + 4𝑥2 = 0
Divide by 4
∴ 𝑥1 + 𝑥2 = 0
∴ 𝑥1 = −𝑥2
𝑥1 𝑥2
∴ =
−1 1
∴ 𝑥1 = −1 & 𝑥2 = 1
−𝟏
∴ For 𝝀 = −𝟏 the required Eigen vector is [ ]
𝟏
𝟖 −𝟔 𝟐
3. Find the Eigen values & Eigen vectors for the following matrix. 𝑨 = [−𝟔 𝟕 −𝟒]
𝟐 −𝟒 𝟑
8 −6 2
Sol: Given 𝐴 = [−6 7 −4]
2 −4 3
The characteristic equation is |𝐴 − 𝜆𝐼| = 0
8−𝜆 −6 2
∴ | −6 7−𝜆 −4 | = 0
2 −4 3−𝜆
∴ 𝜆3 − 𝑠1 𝜆2 + 𝑠2 𝜆 − |𝐴| = 0 … … 1)
∴ 𝑠1 = Sum of main diagonal elements of matrix A.
∴ 𝑠1 = 8 + 7 + 3 ⇒ 𝒔𝟏 = 𝟏𝟖
𝑠2 = Sum of minors of main diagonal elements of matrix A.
7 −4 −6 −4 −6 7
∴ 𝑠2 = | |+| |+| |
−4 3 2 3 2 −4
Page 32 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
∴ 𝑠2 = 21 − 16 + (−18) − (−8) + 24 − 14 ⇒ 𝒔𝟐 = 𝟒𝟓
8 −6 2
& |𝐴| = |−6 7 −4|
2 −4 3
7 −4 −6 −4 (2) −6 7
∴ |𝐴| = (8) | | − (−6) | |+ | |
−4 3 2 3 2 −4
∴ |𝐴| = 8[21 − 16] + 6[−18 − (−8)] + 2[24 − 14]
∴ |𝑨| = 𝟎
Equation 1) becomes;
∴ 𝜆3 − 18𝜆2 + 45𝜆 − 0 = 0
∴ 𝜆3 − 18𝜆2 + 45𝜆 = 0
Taking 𝜆 comman. + 45
X
2
∴ 𝜆[𝜆 − 18𝜆 + 45] = 0
∴ 𝜆(𝜆 − 15)(𝜆 − 3) = 0 - 15 -3
+ - 18
∴ 𝜆 = 0, 𝜆 − 15 = 0, 𝜆 − 3 = 0
∴ 𝝀 = 𝟎, 𝝀 = 𝟏𝟓, 𝝀 = 𝟑
These are required Eigen Values.
To find Eigen Vectors:
Consider [𝐴 − 𝜆𝐼]𝑋 = 0
8−𝜆 −6 2 𝑥1 0
∴ [ −6 7−𝜆 −4 ] [𝑥2 ] = [0] … … .1)
2 −4 3 − 𝜆 𝑥3 0
For 𝝀 = 𝟎:
Put 𝜆 = 0 in equation 1)
8 − 0 −6 2 𝑥1 0
∴ [ −6 7 − 0 −4 ] [𝑥2 ] = [0]
2 −4 3 − 0 𝑥3 0
8 −6 2 𝑥1 0
∴ [−6 7 −4] [𝑥2 ] = [0]
2 −4 3 𝑥3 0
Writing equations;
8𝑥1 − 6𝑥2 + 2𝑥3 = 0
Divide by 2
∴ 4𝑥1 − 3𝑥2 + 𝑥3 = 0 … . .2)
−6𝑥1 + 7𝑥2 − 4𝑥3 = 0 … . .3)
2𝑥1 − 4𝑥2 + 3𝑥3 = 0 … … 4)
Solving 2) & 3) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
−3 1 4 1 4 −3
| | | | | |
7 −4 −6 −4 −6 7
𝑥1 −𝑥2 𝑥3
∴ = =
12 − 7 −16 − (−6) 28 − 18
Page 33 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
𝑥1 −𝑥2 𝑥3
∴ = =
5 −10 10
Divide by 5
𝑥1 𝑥2 𝑥3
∴ = =
1 2 2
𝟏
∴ 𝝀 = 𝟎 Corresponding Eigen vector is [𝟐]
𝟐
For 𝝀 = 𝟏𝟓:
Put 𝜆 = 15 in equation 1)
8 − 15 −6 2 𝑥1 0
∴ [ −6 7 − 15 −4 ] [𝑥2 ] = [0]
2 −4 3 − 15 𝑥3 0
−7 −6 2 𝑥1 0
∴ [−6 −8 −4 ] [𝑥2 ] = [0]
2 −4 −12 𝑥3 0
Writing equations;
−𝟕𝒙𝟏 − 𝟔𝒙𝟐 + 𝟐𝒙𝟑 = 𝟎 … … 𝟐)
−6𝑥1 − 8𝑥2 − 4𝑥3 = 0
Divide by – 2
𝟑𝒙𝟏 + 𝟒𝒙𝟐 + 𝟐𝒙𝟑 = 𝟎 … … 𝟑)
2𝑥1 − 4𝑥2 − 12𝑥3 = 0
Divide by 2
𝒙𝟏 − 𝟐𝒙𝟐 − 𝟔𝒙𝟑 = 𝟎 … … 𝟒)
Solving 3) & 4) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
4 2 3 2 3 4
| | | | | |
−2 −6 1 −6 1 −2
𝑥1 −𝑥2 𝑥3
∴ = =
−24 − (−4) −18 − 2 −6 − 4
𝑥1 −𝑥2 𝑥3
∴ = =
−20 −20 −10
Divide by – 10
𝑥1 −𝑥2 𝑥3
∴ = =
2 2 1
𝑥1 𝑥2 𝑥3
∴ = =
2 −2 1
𝟐
∴ 𝝀 = 𝟏𝟓 corresponding Eigen vector is [−𝟐]
𝟏
For 𝝀 = 𝟑:
Put 𝜆 = 3 in equation 1)
8 − 3 −6 2 𝑥1 0
∴ [ −6 7 − 3 −4 ] [𝑥2 ] = [0]
2 −4 3 − 3 𝑥3 0
Page 34 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
5 −6 2 𝑥1 0
∴ [−6 4 −4] [𝑥2 ] = [0]
2 −4 0 𝑥3 0
Writing equations;
𝟓𝒙𝟏 − 𝟔𝒙𝟐 + 𝟐𝒙𝟑 = 𝟎 … … 𝟐)
−6𝑥1 + 4𝑥2 − 4𝑥3 = 0
Divide by – 2
𝟑𝒙𝟏 − 𝟐𝒙𝟐 + 𝟐𝒙𝟑 = 𝟎 … … 𝟑)
2𝑥1 − 4𝑥2 + 0𝑥3 = 0
Divide by 2
𝒙𝟏 − 𝟐𝒙𝟐 − 𝟎𝒙𝟑 = 𝟎 … … 𝟒)
Solving 3) & 4) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
−2 2 3 2 3 −2
| | | | | |
−2 0 1 0 1 −2
𝑥1 −𝑥2 𝑥3
∴ = =
0 − (−2) 0 − 2 −6 − (−2)
𝑥1 −𝑥2 𝑥3
∴ = =
2 −2 −4
Divide by 2
𝑥1 −𝑥2 𝑥3
∴ = =
1 −1 −2
𝑥1 𝑥2 𝑥3
∴ = =
1 1 −2
𝟏
∴ 𝝀 = 𝟑 corresponding Eigen vector is [ 𝟏 ]
−𝟐
𝟏 𝟎 −𝟒
4. Find the Eigen values & Eigen vectors for the following matrix. 𝑨 = [ 𝟎 𝟓 𝟒 ]
−𝟒 𝟒 𝟑
1 0 −4
Sol: Given 𝐴 = [ 0 5 4 ]
−4 4 3
The characteristic equation is |𝐴 − 𝜆𝐼| = 0
1−𝜆 0 −4
∴| 0 5−𝜆 4 |=0
−4 4 3−𝜆
∴ 𝜆3 − 𝑠1 𝜆2 + 𝑠2 𝜆 − |𝐴| = 0 … … 1)
∴ 𝑠1 = Sum of main diagonal elements of matrix A.
∴ 𝑠1 = 1 + 5 + 3 ⇒ 𝒔𝟏 = 𝟗
𝑠2 = Sum of minors of main diagonal elements of matrix A.
5 4 1 −4 1 0
∴ 𝑠2 = | |+| |+| |
4 3 −4 3 0 5
∴ 𝑠2 = 15 − 16 + 3 − 16 + 5 − 0 ⇒ 𝒔𝟐 = −𝟗
Page 35 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
1 0 −4
& |𝐴| = | 0 5 4 |
−4 4 3
5 4 0 4 0 5
∴ |𝐴| = (1) | | − (0) | | + (−4) | |
4 3 −4 3 −4 4
∴ |𝐴| = 1[15 − 16] + 0 − 4[0 − (−20)]
∴ |𝑨| = −𝟖𝟏
Equation 1) becomes;
∴ 𝜆3 − 9𝜆2 − 9𝜆 + 81 = 0
Here 𝜆 = 3 is one of its Eigen value.
By Synthetic Division Method.
𝜆3 𝜆2 𝜆 𝐶
- 27
𝜆2 𝜆 𝐶 X
∴ (𝜆 − 3)(𝜆2 − 6𝜆 − 27) = 0 -9 3
∴ (𝜆 − 3)(𝜆 − 9)(𝜆 + 3) = 0 + -6
∴ 𝝀 = 𝟑, 𝟗, −𝟑
These are required Eigen values.
To find Eigen vectors:
Consider [𝐴 − 𝜆𝐼]𝑋 = 0
1−𝜆 0 −4 𝑥1 0
∴[ 0 5−𝜆 4 ] [𝑥2 ] = [0] … … .2)
−4 4 3 − 𝜆 𝑥3 0
For 𝝀 = 𝟑:
Put 𝜆 = 3 in equation 1)
1−3 0 −4 𝑥1 0
∴[ 0 5−3 4 ] [𝑥2 ] = [0]
−4 4 3 − 3 𝑥3 0
−2 0 −4 1 𝑥 0
∴ [ 0 2 4 ] [𝑥2 ] = [0]
−4 4 0 𝑥3 0
Writing equations;
−2𝑥1 + 0𝑥2 − 4𝑥3 = 0
Divide by 2
∴ −𝒙𝟏 + 𝟎𝒙𝟐 − 𝟐𝒙𝟑 = 𝟎 … . . 𝟑)
0𝑥1 + 2𝑥2 + 4𝑥3 = 0
Divide by 2
∴ 𝟎𝒙𝟏 + 𝒙𝟐 + 𝟐𝒙𝟑 = 𝟎 … … 𝟒)
−4𝑥1 + 4𝑥2 + 0𝑥3 = 0
Divide by 4
Page 36 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
∴ −𝒙𝟏 + 𝟐𝒙𝟐 + 𝟎𝒙𝟑 = 𝟎 … … 𝟓)
Solving 3) & 4) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
0 −2 −1 −2 −1 0
| | | | | |
1 2 0 2 0 1
𝑥1 −𝑥2 𝑥3
∴ = =
0 − (−2) −2 − 0 −1 − 0
𝑥1 −𝑥2 𝑥3
∴ = =
2 −2 −1
𝑥1 𝑥2 𝑥3
∴ = =
2 2 −1
𝟐
∴ 𝝀 = 𝟑 corresponding Eigen vector is [ 𝟐 ]
−𝟏
For 𝝀 = 𝟗:
Put 𝜆 = 9 in equation 1)
1−9 0 −4 𝑥1 0
∴[ 0 5−9 4 ] [𝑥2 ] = [0]
−4 4 3 − 9 𝑥3 0
−8 0 −4 𝑥1 0
∴ [ 0 −4 4 ] [𝑥2 ] = [0]
−4 4 −6 𝑥3 0
Writing equations;
−8𝑥1 + 0𝑥2 − 4𝑥3 = 0
Divide by 4
∴ −𝟐𝒙𝟏 + 𝟎𝒙𝟐 − 𝒙𝟑 = 𝟎 … . . 𝟑)
0𝑥1 − 4𝑥2 + 4𝑥3 = 0
Divide by 4
∴ 𝟎𝒙𝟏 − 𝒙𝟐 + 𝒙𝟑 = 𝟎 … … 𝟒)
−4𝑥1 + 4𝑥2 − 6𝑥3 = 0
Divide by 2
∴ −𝟐𝒙𝟏 + 𝟐𝒙𝟐 − 𝟑𝒙𝟑 = 𝟎 … … 𝟓)
Solving 3) & 4) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
0 −1 −2 −1 −2 0
| | | | | |
−1 1 0 1 0 −1
𝑥1 −𝑥2 𝑥3
∴ = =
0 − 1 −2 − 0 2 − 0
𝑥1 −𝑥2 𝑥3
∴ = =
−1 −2 2
𝑥1 𝑥2 𝑥3
∴ = =
−1 2 2
−𝟏
∴ 𝝀 = 𝟗 Corresponding Eigen vector is [ 𝟐 ]
𝟐
Page 37 of 38
MR. SUDHIR S DESAI 8087348936 MATHEMATICS FOR MACHINE LEARNING
For 𝝀 = −𝟑:
Put 𝜆 = −3 in equation 1)
1 − (−3) 0 −4 𝑥1 0
∴[ 0 5 − (−3) 4 ] [𝑥2 ] = [0]
−4 4 3 − (−3) 𝑥3 0
4 0 −4 𝑥1 0
∴ [ 0 8 4 ] [𝑥2 ] = [0]
−4 4 6 𝑥3 0
Writing equations;
4𝑥1 + 0𝑥2 − 4𝑥3 = 0
Divide by 4
∴ 𝒙𝟏 + 𝟎𝒙𝟐 − 𝒙𝟑 = 𝟎 … . . 𝟑)
0𝑥1 + 8𝑥2 + 4𝑥3 = 0
Divide by 4
∴ 𝟎𝒙𝟏 + 𝟐𝒙𝟐 + 𝒙𝟑 = 𝟎 … … 𝟒)
−4𝑥1 + 4𝑥2 + 6𝑥3 = 0
Divide by 2
∴ −𝟐𝒙𝟏 + 𝟐𝒙𝟐 + 𝟑𝒙𝟑 = 𝟎 … … 𝟓)
Solving 3) & 4) Using Crammers Rule,
𝑥1 −𝑥2 𝑥3
= =
0 −1 1 −1 1 0
| | | | | |
2 1 0 1 0 2
𝑥1 −𝑥2 𝑥3
∴ = =
0 − (−2) 1 − 0 2 − 0
𝑥1 −𝑥2 𝑥3
∴ = =
2 1 2
𝑥1 𝑥2 𝑥3
∴ = =
2 −1 2
𝟐
∴ 𝝀 = −𝟑 Corresponding Eigen vector is [−𝟏]
𝟐
Homework:
Find the Eigen Values & Eigen vectors of following matrix.
𝟑 𝟏 𝟒
1. 𝑨 = [𝟎 𝟐 𝟔]
𝟎 𝟎 𝟓
𝟐 𝟏 −𝟏
2. 𝑨 = [ 𝟏 𝟏 −𝟐]
−𝟏 −𝟐 𝟏
𝟒 𝟐 −𝟐
3. 𝑨 = [−𝟓 𝟑 𝟐 ] [S-24 4M]
−𝟐 𝟒 𝟏
𝟏𝟒 −𝟏𝟎
4. 𝑨 = [ ] [S-23, W-23 4M]
𝟓 −𝟏
Page 38 of 38