Lecture 4: Linear Algebra contd…
“Linear Algebra is the math of Vector & Matrices…”
Linear Algebra has become as basic and as applicable
as calculus, and fortunately it is easier.
- Gilbert Strang, MIT
Lecture -4: Overview
Review of Lecture 3
Gauss Elimination
Week 4 lecture coverage
Elementary Matrices
Gauss Jordan Elimination
2
Elimination with Matrices
Elimination is the technique most commonly used by computer software to
solve systems of linear equations.
• Elimination(Success or Failure)
• Depends on the nature of Matrix 𝑥 + 2𝑦 + 𝑧 = 2
1 2 1 3𝑥 + 8𝑦 + 𝑧 = 12
• 𝐿𝑒𝑡 𝐴 = 3 8 1
0 4 1 4𝑦 + 𝑧 = 2
3
• While going from A to U, Pivots can’t be 0.
• What, If Pivot is Zero?
• Exchange the Rows
• Now, Considering b the Matrix A and U is:
1 2 1 | 2 𝟏 2 1 | 2
𝐴 = 3 8 1 | 12 𝐴 = 𝟎 𝟐 −2 | 6
0 4 1 | 2 𝟎 𝟎 𝟓 | −10
𝑥 + 2𝑦 + 𝑧 = 0 𝑥=2
2𝑦 − 2𝑧 = 6 𝑆𝑜, 𝑦 = 1
𝑧 = −2
5𝑧 = −10
4
Elimination with Matrices
𝟏 2 1
𝐿𝑒𝑡 𝐴 = 3 8 1
0 4 1
Consider 1 as pivot. After 𝑅2 = 𝑅2 − 3𝑅1
𝟏 2 1 𝟏 2 1 𝑥 + 2𝑦 + 𝑧 = 2
𝟎 𝟐 −2 𝟎 𝟐 −2 3𝑥 + 8𝑦 + 𝑧 = 12
0 4 1 𝟎 4 1
4𝑦 + 𝑧 = 2
After 𝑅3 = 𝑅3 − 2𝑅2 𝟏 2 1
U = 𝟎 𝟐 −2
𝟎 𝟎 𝟓
5
• Which matrix can do, R2 – 3R1?
𝑥 + 2𝑦 + 𝑧 = 2
? ? ? 1 2 1 1 2 1 3𝑥 + 8𝑦 + 𝑧 = 12
? ? ? 3 8 1 = 0 2 −2
? ? ? 0 4 1 0 4 1 4𝑦 + 𝑧 = 2
1 0 0 1 2 1 1 2 1
−3 1 0 3 8 1 = 0 2 −2
0 0 1 0 4 1 0 4 1
𝐸21
Its called E21 matrix because It is used to eliminate the A21 position of
our co-efficient matrix. 6
• Similarly, What about R3 – 2R2?
𝑥 + 2𝑦 + 𝑧 = 2
? ? ? 1 2 1 1 2 1 3𝑥 + 8𝑦 + 𝑧 = 12
? ? ? 0 2 −2 = 0 2 −2
? ? ? 0 4 1 0 0 5 4𝑦 + 𝑧 = 2
1 0 0 1 2 1 1 2 1
0 1 0 0 2 −2 = 0 2 −2
0 −𝟐 1 0 4 1 0 0 5
𝐸32 𝑈
Start from A, & to reach to U: What matrix does the whole job?
7
• 𝐸32 𝐸21 𝐴 = 𝑈
• (𝐸32 𝐸21 )𝐴 = 𝑈
• 𝐴𝑠𝑠𝑜𝑐𝑖𝑎𝑡𝑖𝑣𝑒 𝐿𝑎𝑤 𝑜𝑓 𝑀𝑎𝑡𝑟𝑖𝑥 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛
• 𝐸𝐴 = 𝑈, Where E is called the elementary matrix and its whole
purpose is to convert matrix A to U.
• Another type of Elementary Matrix is Permutation Matrix
? ? 𝑎 𝑏 𝑐 𝑑
1. Exchange Row 1 & Row 2. =
? ? 𝑐 𝑑 𝑎 𝑏
0 1 𝑎 𝑏 0 𝑎, 𝑏 + 1 𝑐, 𝑑 𝑐 𝑑
= =
1 0 𝑐 𝑑 1 𝑎, 𝑏 + 0[𝑐, 𝑑] 𝑎 𝑏
8
• Another type of Elementary Matrix is Permutation Matrix
𝑎 𝑏 ? ? 𝑏 𝑎
• Exchange Col 1 & Col 2. =
𝑐 𝑑 ? ? 𝑑 𝑐
𝑎 𝑏 0 1 𝑎 01 +𝑏 10 𝑏 𝑎
= =
𝑐 𝑑 1 0 𝑐 0 1 + 𝑑[1 0] 𝑑 𝑐
9
• 𝐸32 𝐸21 𝐴 = 𝑈
• (𝐸32 𝐸21 )𝐴 = 𝑈
• 𝐴𝑠𝑠𝑜𝑐𝑖𝑎𝑡𝑖𝑣𝑒 𝐿𝑎𝑤 𝑜𝑓 𝑀𝑎𝑡𝑟𝑖𝑥 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛
• 𝐸𝐴 = 𝑈, Where E is called the elementary matrix and its whole
purpose is to convert matrix A to U.
Now, What about reverse? i.e., U to A..! (E–1 U = A)
10
Inverse of a Matrix
• We Know: E–1 E = I = E E–1
1 3 𝑎 𝑐 1 0
=
2 7 𝑏 𝑑 0 1
• 𝐸 × 𝐶𝑜𝑙𝑢𝑚𝑛 𝑗 𝑜𝑓 𝐸 −1 = 𝐶𝑜𝑙𝑢𝑚𝑛 𝑗 𝑜𝑓 𝐼
• Gauss Jordan (Solve Two Equations at Once)
1 3 𝑎 1
=
2 7 𝑏 0
1 3 𝑐 0
=
2 7 𝑑 1
11
EI I E –1
Gauss-Jordan elimination: Carl Friedrich Gauss (1777–1855) and
Wilhelm Jordan (1842–1899)
12
13
14
Example
• Use Gauss-Jordan elimination to solve the system.
x – 2y + 3z = 9
– x + 3y + z = – 2
2x – 5y + 5z = 17
Solution: Gaussian elimination was used to obtain the row-echelon form.
cont’d
• To do this, you must produce zeros above each of the leading 1’s, as
follows.
Perform operations on R3 so
second column has a zero
above its leading 1.
Perform operations on R1 cont’d
and R2 so
third column has zeros above its
leading 1.
The matrix is now in reduced row-echelon form.
Converting back to a system of linear equations, you have
x= 1
y = –1
z= 2
Exercise:
𝑥+𝑦−𝑧 =7
𝑥+𝑦−𝑧 =7
2𝑥 + 𝑦 + 𝑧 = 9
1. Find the solution of the system using gauss Jordan elimination.
2. Find the elimination matrices E21,E31 and E32 for the coefficient matrix of the system.
3. Find the inverse of the coefficient matrix from the above system.
18
19