2.escholon Matrix
2.escholon Matrix
[Link] makes these slides available for educational purposes. You may not use or distribute
these slides for commercial purposes. You may make copies of these slides and use or distribute them for
educational purposes as long as you cite [Link] as the source of the slides.
Matrix
Neural networks - Matrix operations
"Hello! Welcome to
Math for Machine
Learning!"
Matrix Matrix
Neural networks - Matrix operations
"Hello! Welcome to
Math for Machine
Learning!"
● Automatic music
generation: compressing
music to discrete codes,
then training the model on
a specific genre to produce
new music.
Solving System of Linear Equations
• a + b = 10
• a + 2b = 12
Solving systems of equations
System
+ = $10
• a + b = 10
• a + 2b = 12
+ + = $12
Solving systems of equations
System
+ = $10
• a + b = 10
• a + 2b = 12
+ + = $12
Solving systems of equations
System
+ = $10
• a + b = 10
• a + 2b = 12
+ + = $12
Solving systems of equations
System
+ = $10
• a + b = 10
• a + 2b = 12
+ + = $12
$2
Solving systems of equations
System
+ = $10
• a + b = 10
$2
• a + 2b = 12
+ + = $12
$2
Solving systems of equations
System
+ = $10
• a + b = 10
$8 $2
• a + 2b = 12
+ + = $12
$2
Solving systems of equations
Solving systems of equations
System
• a + b = 10
• a + 2b = 12
Solving systems of equations
• a + b = 10 • a=8
• a + 2b = 12 • b=2
Solving systems of equations
• a + 2b = 12 • b=2
Solving systems of equations
• a + b = 10 • a=8
• a + 2b = 12 • b=2
Solving systems of equations
• a + b = 10 • a=8
• a + 2b = 12 • b=2
Multiplying by a constant
Manipulating equations
Multiplying by a constant
a + b = 10
Manipulating equations
Multiplying by a constant
a + b = 10
x 7
Manipulating equations
Multiplying by a constant
a + b = 10
x 7
7a + 7b = 70
Manipulating equations
a + b = 10
x 7
7a + 7b = 70
Manipulating equations
a + b = 10 a + b = 10
x 7
7a + 7b = 70
Manipulating equations
a + b = 10 a + b = 10
x 7 2a + 3b = 26
7a + 7b = 70
Manipulating equations
a + b = 10 a + b = 10
x 7 + 2a + 3b = 26
7a + 7b = 70
Manipulating equations
a + b = 10 a + b = 10
x 7 + 2a + 3b = 26
7a + 7b = 70 3a + 4b = 36
Let’s do a harder example
Systems of equations
Systems of equations
System
• 5a + b = 17
• 4a - 3b = 6
Systems of equations
System Solved system
• 5a + b = 17 • a=?
• 4a - 3b = 6 • b=?
Systems of equations
System Solved system
• 5a + b = 17 • a=?
• 4a - 3b = 6 • b=?
Eliminate ‘a’
from this equation
Systems of equations
System Divide by coefficient of a Solved system
Eliminate ‘a’
from this equation
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
Systems of equations
System Divide by coefficient of a Solved system
• 5a + b = 17 • a + 0.2b = 3.4 3
• a=?
• 5a + b = 17 • a=?
• 3b = 6 • b=?
What if one of the coefficients of a is zero?
System Solved system
• 5a + b = 17 • a=?
• 3b = 6 • b=?
Eliminate ‘a’
from this equation
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b=?
Eliminate ‘a’
from this equation
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b=?
Eliminate ‘a’
from this equation b=2
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b = ?2
Eliminate ‘a’
from this equation b=2
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b = ?2
Eliminate ‘a’
from this equation b=2
a + 0.2(2) = 3.4
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b = ?2
Eliminate ‘a’
from this equation b=2
a + 0.2(2) = 3.4
a + 0.4 = 3.4
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 3b = 6 • ??? • b = ?2
Eliminate ‘a’
from this equation b=2
a + 0.2(2) = 3.4
a + 0.4 = 3.4
a=3
What if one of the coefficients of a is zero?
System Divide by coefficient of a Solved system
• 5a + b = 17 • a + 0.2b = 3.4 3
• a=?
• 3b = 6 • ??? • b = ?2
Eliminate ‘a’
from this equation b=2
a + 0.2(2) = 3.4
a + 0.4 = 3.4
a=3
Quiz
● Solve the following system of equations
System
• 2a + 5b = 46
• 8a + b = 32
Solution
● Solve the following system of equations
System
• 2a + 5b = 46
• 8a + b = 32
Solution
• a=3
• b=8
Solving System of Linear Equations
• a + b = 10 • a=?
• 2a + 2b = 20 • b=?
What if the system is singular (redundant)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
Eliminate ‘a’
from this equation
What if the system is singular (redundant)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
0=0
What if the system is singular (redundant)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 20 • a + b = 10 • b=?
• a + b = 10 • a + b = 10 • a = ?x
• 2a + 2b = 20 • a + b = 10 • b=?
• a + b = 10 • a + b = 10 • a = ?x
• 2a + 2b = 20 • a + b = 10 • b=?
10 - x
• a + b = 10 • a + b = 10 • a = ?x
• 2a + 2b = 20 • a + b = 10 • b=?
10 - x
• a + b = 10 • a=?
• 2a + 2b = 24 • b=?
What if the system is singular (contradictory)?
System Solved system
• a + b = 10 • a=?
• 2a + 2b = 24 • b=?
Eliminate ‘a’
from this equation
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’
from this equation
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’
from this equation
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’ a + b = 12
from this equation
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’ a + b = 12
from this equation - a + b = 10
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’ a + b = 12
from this equation - a + b = 10
0=2
What if the system is singular (contradictory)?
System Divide by coefficient of a Solved system
• a + b = 10 • a + b = 10 • a=?
• 2a + 2b = 24 • a + b = 12 • b=?
Eliminate ‘a’ a + b = 12
from this equation - a + b = 10
0=2
Contradiction!
Quiz
● Solve the following system of equations
System
• 5a + b = 11
• 10a + 2b = 22
Solution
● Solve the following system of equations
System
• 5a + b = 11
• 10a + 2b = 22
Solution: If you look closely into the two equations in the system, you'll find that if equation 2 is divided by 2
• a + b + 2c = 12
• 3a - 3b - c = 3
• 2a - b + 6c = 24
Elimination method
System
• a + b + 2c = 12
• 3a - 3b - c = 3
• 2a - b + 6c = 24
Leave ‘a’ by
itself
Elimination method
System
• a + b + 2c = 12
• 3a - 3b - c = 3
• 2a - b + 6c = 24
Elimination method
System
• a + b + 2c = 12
• 3a - 3b - c = 3
• 2a - b + 6c = 24
Divide each
row by the
coefficient of ‘a’
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12
• 3a - 3b - c = 3 • a - b - 1/3 c = 1
• 2a - b + 6c = 24 • a - b/2 + 3c = 12
Divide each
row by the
coefficient of ‘a’
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12
• 3a - 3b - c = 3 • a - b - 1/3 c = 1
• 2a - b + 6c = 24 • a - b/2 + 3c = 12
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
• 2a - b + 6c = 24 • a - b/2 + 3c = 12 • - 3/2 b + c = 0
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
• 2a - b + 6c = 24 • a - b/2 + 3c = 12 • - 3/2 b + c = 0
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
• 2a - b + 6c = 24 • a - b/2 + 3c = 12 • - 3/2 b + c = 0
Elimination method
System
• a + b + 2c = 12
• - 3/2 b + c = 0
Elimination method
System
• a + b + 2c = 12
• - 3/2 b + c = 0
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12
• - 3/2 b + c = 0 • b - 2/3 c = 0
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12
• - 3/2 b + c = 0 • b - 2/3 c = 0
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
Elimination method
System
• a + b + 2c = 12 • a + b + 2c = 12 • a + b + 2c = 12
Elimination method
System
• a + b + 2c = 12
• b + 7/6 c = 11/2
• c=3
Elimination method
System
• a + b + 2c = 12
• b + 7/6 c = 11/2
• c=3
Replace c = 3
in the second
equation, get
b=2
Elimination method
System
• a + b + 2c = 12
Replace c = 3
in the second
equation, get
b=2
Elimination method
System
• a + b + 2c = 12
Replace c = 3 Replace c = 3
in the second and b = 2 in the
equation, get first equation,
b=2 get a = 4
Elimination method
System
a + 2 + 6 = 12
• a + b + 2c = 12 a=4
• b + 7/6 c = 11/2 b + 7/2 = 11/2
b=2
• c=3
Replace c = 3 Replace c = 3
in the second and b = 2 in the
equation, get first equation,
b=2 get a = 4
Elimination method
System
a + 2 + 6 = 12
• a + b + 2c = 12 a=4
• b + 7/6 c = 11/2 b + 7/2 = 11/2
b=2
• c=3
• 5a + b = 17
• 4a - 3b = 6
Systems of equations to matrices
Original system Intermediate System
• 5a + b = 17 • a + 0.2b = 3.4
• 4a - 3b = 6 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
Original matrix
5 1
4 -3
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
• a + b = 10
• 2a + 2b = 20
Systems of equations to matrices
Original system Intermediate System
• a + b = 10 • a + b = 10
• 2a + 2b = 20 • 0a + 0b = 0
Systems of equations to matrices
Original system Intermediate System
• a + b = 10 • a + b = 10
• 2a + 2b = 20 • 0a + 0b = 0
Original matrix
1 1
2 2
Systems of equations to matrices
Original system Intermediate System
• a + b = 10 • a + b = 10
• 2a + 2b = 20 • 0a + 0b = 0
• a + b = 10 • a + b = 10
• 2a + 2b = 20 • 0a + 0b = 0
• a + b = 10 • a + b = 10
• 2a + 2b = 20 • 0a + 0b = 0
• 5a + b = 11
• 10a + 2b = 22
• 5a + b = 11 • a + 0.2b = 2.2
• 10a + 2b = 22 • 0a + 0b = 0
• 5a + b = 11 • a + 0.2b = 2.2
• 10a + 2b = 22 • 0a + 0b = 0
Original matrix
5 1
10 2
• 5a + b = 11 • a + 0.2b = 2.2
• 10a + 2b = 22 • 0a + 0b = 0
• 5a + b = 11 • a + 0.2b = 2.2
• 10a + 2b = 22 • 0a + 0b = 0
• 5a + b = 11 • a + 0.2b = 2.2
• 10a + 2b = 22 • 0a + 0b = 0
• 0a + 0b = 0
• 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
Original matrix
0 0
0 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
• 0a + 0b = 0 • 0a + 0b = 0
5 1
4 3
Switching rows
5 1
4 3
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11

Switching rows
5 1 4 3
4 3 5 1
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11

Switching rows
5 1 4 3
4 3 5 1
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11 Determinant = 4 ⋅ 1 − 3 ⋅ 5 = − 11


Switching rows
5 1 4 3
4 3 5 1
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11 Determinant = 4 ⋅ 1 − 3 ⋅ 5 = − 11


Switching rows
5 1 4 3
4 3 5 1
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11 Determinant = 4 ⋅ 1 − 3 ⋅ 5 = − 11


Switching rows
5 1 4 3
4 3 5 1
Determinant = 5 ⋅ 3 − 1 ⋅ 4 = 11 Determinant = 4 ⋅ 1 − 3 ⋅ 5 = − 11


Multiplying a row by a (non-zero) scalar
5 1
4 3
-3
Multiplying a row by a (non-zero) scalar
5 1
4 3
-3
Determinant =5⋅3−1⋅4

Multiplying a row by a (non-zero) scalar
5 1
4 3
-3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1
4 -3 4 3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1 5 1
4 -3 4 3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1 5 1 x 10 =
4 -3 4 3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1 5 1 x 10 = 50 10
4 -3 4 3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1 5 1 x 10 = 50 10 50 10
4 -3 4 3
Determinant =5⋅3−1⋅4
= 11


Multiplying a row by a (non-zero) scalar
5 1 5 1 x 10 = 50 10 50 10
4 -3 4 3
5 1 5 1 x 10 = 50 10 50 10
4 -3 4 3
5 1
4 3
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1
4 3
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 4 3
4 3
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 + 4 3
4 3
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 + 4 3
4 3
9 4
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 + 4 3 9 4
4 3
9 4
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 + 4 3 9 4
4 3 4 3
9 4
Determinant =5⋅3−1⋅4
= 11


Adding a row to another row
5 1
5 1 + 4 3 9 4
4 3 4 3
9 4
5 1
5 1 + 4 3 9 4
4 3 4 3
9 4
Rank of a matrix
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Compressing Images - Reducing rank
Systems of information
Systems of information
System 1
Systems of information
System 1 System 2
Systems of information
System 1 System 2 System 3
Systems of information
System 1 System 2 System 3
Two sentences
Systems of information
System 1 System 2 System 3
Two sentences
Systems of information
System 1 System 2 System 3
Systems of information
System 1 System 2 System 3
Systems of information
System 1 System 2 System 3
Systems of information
System 1 System 2 System 3
Systems of information
System 1 System 2 System 3
Rank = 2
Systems of information
System 1 System 2 System 3
Rank = 2 Rank = 1
Systems of information
System 1 System 2 System 3
Systems of equations
Systems of equations
System 1
a+ b=0
a + 2b = 0
Systems of equations
System 1 System 2
a+ b=0 a+ b=0
a + 2b = 0 2a + 2b = 0
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Two equations
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Two equations
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Two equations
Rank = 2
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Rank = 2
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Rank = 2
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Rank = 2 Rank = 1
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Rank = 2 Rank = 1
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Rank = 2 Rank = 1
Systems of equations
System 1 System 2 System 3
a+ b=0 a+ b=0 0a + 0b = 0
a + 2b = 0 2a + 2b = 0 0a + 0b = 0
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 0a + 0b = 0
a + 2b = 0 1 2 2a + 2b = 0 0a + 0b = 0
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 0a + 0b = 0
a + 2b = 0 1 2 2a + 2b = 0 0a + 0b = 0
Rank = 2
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 1 1 0a + 0b = 0
a + 2b = 0 1 2 2a + 2b = 0 2 2 0a + 0b = 0
Rank = 2
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 1 1 0a + 0b = 0
a + 2b = 0 1 2 2a + 2b = 0 2 2 0a + 0b = 0
Rank = 2 Rank = 1
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 1 1 0a + 0b = 0 0 0
a + 2b = 0 1 2 2a + 2b = 0 2 2 0a + 0b = 0 0 0
Rank = 2 Rank = 1
Systems of equations
System 1 System 2 System 3
a+ b=0 1 1 a+ b=0 1 1 0a + 0b = 0 0 0
a + 2b = 0 1 2 2a + 2b = 0 2 2 0a + 0b = 0 0 0
(0,0)
a
Rank and solutions to the system
1 1 1 1 0 0
1 2 2 2 0 0
(0,0)
a a
Rank and solutions to the system
1 1 1 1 0 0
1 2 2 2 0 0
(0,0)
a a a
Rank of a matrix
1 1 1 1 0 0
1 2 2 2 0 0
Non-singular
Rank and singularity
1 1 1 1 0 0
1 2 2 2 0 0
Non-singular Singular
Rank and singularity
1 1 1 1 0 0
1 2 2 2 0 0
Matrix 1
5 1
-1 3
Matrix 2
2 -1
-6 3
Solutions: Rank of a matrix
Determine the rank of the following two matrices
5 1
-1 3
Rank of a matrix:
General case
Rank for matrices
System 1 System 2 System 3 System 4
3 Equations
3 Pieces of information
3 Equations
3 Pieces of information
Rank 3
3 Equations
3 Pieces of information
Rank 3
1 1 1
1 2 1
1 1 2
3 Equations
3 Pieces of information
Rank 3
1 1 1
1 2 1
1 1 2
3 Equations
3 Pieces of information
Rank 3
1 1 1
1 2 1
1 1 2
3 Equations
3 Pieces of information
Rank 3
1 1 1
1 2 1
1 1 2
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3
1 1 1
1 2 1
1 1 2
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3 Rank 2
1 1 1
1 2 1
1 1 2
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3 Rank 2
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3 Rank 2
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3 Rank 2
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
3 Equations 3 Equations
3 Pieces of information 2 Pieces of information
Rank 3 Rank 2
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
Rank 3 Rank 2
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
1 1 1 1 1 1
1 2 1 1 1 2
1 1 2 1 1 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1
1 2 1 1 1 2 2 2 2
1 1 2 1 1 3 3 3 3
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
Question
● Is there an easier way to calculate the rank?
● Answer: Yes! As before, it is the number of ones in the diagonal of the
reduced row echelon form of the matrix.
Solving System of Linear Equations
5 1
4 -3
Row echelon form of a matrix
Original matrix Row echelon form
5 1 1 0.2
4 -3 0 1
Row echelon form of a matrix
Original matrix Row echelon form
5 1 1 0.2
4 -3 0 1
5 1
10 2
Row echelon form of a matrix
Original matrix Row echelon form
5 1 1 0.2
4 -3 0 1
5 1 1 1
10 2 0 0
Row echelon form of a matrix
Original matrix Row echelon form
5 1 1 0.2
4 -3 0 1
5 1 1 1
10 2 0 0
0 0
0 0
Row echelon form of a matrix
Original matrix Row echelon form
5 1 1 0.2
4 -3 0 1
5 1 1 1
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form
Original matrix
5 1
4 -3
Row echelon form
Original matrix
5 1
4 -3
Original matrix
5 1
4 -3
Original matrix
5 1 1 0.2
4 -3
Original matrix
5 1 1 0.2
4 -3 1 -0.75
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75
1 0.2
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75
- 1 0.2
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75
- 1 0.2
0 -0.95
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75 0 -0.95
- 1 0.2
0 -0.95
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75 0 -0.95
0 -0.95
Original matrix
5 1 1 0.2 1 0.2
4 -3 1 -0.75 0 -0.95
0 -0.95
Original matrix
0 -0.95
Original matrix
0 -0.95
0 -0.95
Original matrix
5 1
10 2
Row echelon form for singular matrices
Original matrix
5 1
10 2
Original matrix
5 1
10 2
Original matrix
5 1 1 0.2
10 2
Original matrix
5 1 1 0.2
10 2 1 0.2
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2
1 0.2
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2
- 1 0.2
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2
- 1 0.2
0 0
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2 0 0
- 1 0.2
0 0
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2 0 0
0 0
Original matrix
5 1 1 0.2 1 0.2
10 2 1 0.2 0 0
0 0
Original matrix
0 0
Original matrix
0 0
0 0
Original matrix
0 0
0 0
Row echelon form for singular matrices
Original matrix
0 0
0 0
Original matrix
0 0
0 0
Original matrix
0 0 ? ?
0 0
Original matrix
0 0 ? ?
0 0 ? ?
0 0 ? ?
0 0 ? ?
5 1
4 -3
5 1
10 2
0 0
0 0
Row echelon form, singularity, and rank
5 1 1 0.2
4 -3 0 1
5 1
10 2
0 0
0 0
Row echelon form, singularity, and rank
5 1 1 0.2
4 -3 0 1
5 1 1 0.2
10 2 0 0
0 0
0 0
Row echelon form, singularity, and rank
5 1 1 0.2
4 -3 0 1
5 1 1 0.2
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form, singularity, and rank
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
5 1 1 0.2
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
5 1 1 0.2
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
5 1 1 0.2
1 one in the diagonal
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
1 one in the diagonal
10 2 0 0
0 0 0 0
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
1 one in the diagonal
10 2 0 0
0 0 0 0
0 ones in the diagonal
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
1 one in the diagonal
10 2 0 0
Rank 0
0 0 0 0
0 ones in the diagonal
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
Non-singular matrix 2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
1 one in the diagonal
10 2 0 0
Rank 0
0 0 0 0
0 ones in the diagonal
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
Non-singular matrix 2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
Singular matrix 1 one in the diagonal
10 2 0 0
Rank 0
0 0 0 0
0 ones in the diagonal
0 0 0 0
Row echelon form, singularity, and rank
Rank 2
5 1 1 0.2
Non-singular matrix 2 ones in the diagonal
4 -3 0 1
Rank 1
5 1 1 0.2
Singular matrix 1 one in the diagonal
10 2 0 0
Rank 0
0 0 0 0
Singular matrix 0 ones in the diagonal
0 0 0 0
Solving System of Linear Equations
• a + b + 2c = 12
• 3a - 3b - c = 3
• 2a - b + 6c = 24
• a + b + 2c = 12 • a + b + 2c = 12
• 3a - 3b - c = 3 • -6b - 7c = -33
• 2a - b + 6c = 24 • 6c = 18
• a + b + 2c = 12 • a + b + 2c = 12
• 3a - 3b - c = 3 • -6b - 7c = -33
• 2a - b + 6c = 24 • 6c = 18
Matrix
1 1 2
3 -3 -1
2 -1 6
• a + b + 2c = 12 • a + b + 2c = 12
• 3a - 3b - c = 3 • -6b - 7c = -33
• 2a - b + 6c = 24 • 6c = 18
1 1 2 1 1 2
3 -3 -1 0 -6 7
2 -1 6 0 0 6
2 * * * * 3 * * * *
0 1 * * * 0 0 1 * *
0 0 3 * * 0 0 0 -4 *
0 0 0 -5 * 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
Row echelon form
0 0 0 -5 * 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 0 -5 * 0 0 0 0 0
Every pivot is to the right of
0 0 0 0 1 0 0 0 0 0 the pivots on the rows above
0 0 0 -5 * 0 0 0 0 0
Every pivot is to the right of
0 0 0 0 1 0 0 0 0 0 the pivots on the rows above
Another example
Matrix
1 1 1
1 2 1
1 1 2
Another example
Matrix
1 1 1
1 2 1
1 1 2
1 1 1 1 1 1
1 2 1 0 1 0
1 1 2 0 0 1
Matrix
1 1 1
1 1 2
1 1 3
What if the matrix is singular?
Matrix
1 1 1
1 1 2
1 1 3
Matrix
1 1 1 1 1 1
1 1 2 0 0 1
1 1 3 0 0 2
Matrix
1 1 1 1 1 1
1 1 2 0 0 1
1 1 3 0 0 2
1 1 1 1 1 1 1 1 1
1 1 2 0 0 1 0 0 1
1 1 3 0 0 2 0 0 0
Matrix
1 1 1
2 2 2
3 3 3
What if the matrix is singular?
Matrix
1 1 1
2 2 2
3 3 3
Matrix
1 1 1 1 1 1
2 2 2 0 0 0
3 3 3 3 3 3
Matrix
1 1 1 1 1 1
2 2 2 0 0 0
3 3 3 3 3 3
1 1 1 1 1 1 1 1 1
2 2 2 0 0 0 0 0 0
3 3 3 3 3 3 0 0 0
1 1 1
0 1 0
0 0 1
Rank for matrices
Matrix 1 Matrix 2 Matrix 3 Matrix 4
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
1 1 1 1 1 1
0 1 0 0 0 1
0 0 1 0 0 0
Rank for matrices
Matrix 1 Matrix 2 Matrix 3 Matrix 4
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
1 1 1 1 1 1 1 1 1
0 1 0 0 0 1 0 0 0
0 0 1 0 0 0 0 0 0
Rank for matrices
Matrix 1 Matrix 2 Matrix 3 Matrix 4
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
Rank for matrices
Matrix 1 Matrix 2 Matrix 3 Matrix 4
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
Number of pivots = 3
Rank for matrices
Matrix 1 Matrix 2 Matrix 3 Matrix 4
1 1 1 1 1 1 1 1 1 0 0 0
1 2 1 1 1 2 2 2 2 0 0 0
1 1 2 1 1 3 3 3 3 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
Rank = 3
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
Rank = 3 Rank = 2
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0 0 0
0 1 0 0 0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0
• 5a + b = 17
• 4a - 3b = 6
• 5a + b = 17 • a + 0.2b = 3.4
• 4a - 3b = 6 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
Original matrix
5 1
4 -3
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 4a - 3b = 6 • b=2 • b=2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
• 5a + b = 17 • a + 0.2b = 3.4 • 1a
a =+30b = 3
• 4a - 3b = 6 • b=2 • 0a
b =+21b = 2
1 0.2
0 1
Reduced row echelon form
1 0.2
0 1 0 1
Reduced row echelon form
1 0.2
0 1 0 1
0 1
Reduced row echelon form
1 0.2
0 1 0 1
0 1
0.2
Reduced row echelon form
1 0.2
0 1 0 1
0 1
x 0.2
Reduced row echelon form
1 0.2
0 1 0 1
0 1
x 0.2
0 0.2
Reduced row echelon form
1 0.2
0 1 0 1
0 1 1 0.2
x 0.2
0 0.2
Reduced row echelon form
1 0.2
0 1 0 1
0 1 1 0.2
x 0.2 - 0 0.2
0 0.2
Reduced row echelon form
1 0.2
0 1 0 1
0 1 1 0.2
x 0.2 - 0 0.2
0 0.2 1 0
Reduced row echelon form
1 0.2 1 0
0 1 0 1
0 1 1 0.2
x 0.2 - 0 0.2
0 0.2 1 0
Reduced row echelon form
Reduced
Row echelon form
row echelon form
1 0.2 1 0
0 1 0 1
0 1 1 0.2
x 0.2 - 0 0.2
0 0.2 1 0
1 0 0 0 0 1 * 0 0 *
0 1 0 0 0 0 0 1 0 *
0 0 1 0 0 0 0 0 1 *
0 0 0 1 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
Reduced row echelon form
3 * * * *
0 0 2 * *
0 0 0 -4 *
0 0 0 0 0
0 0 0 0 0
Reduced row echelon form
3 * * * * 1 * * * *
0 0 2 * * 0 0 1 * *
0 0 0 -4 * 0 0 0 1 *
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Reduced row echelon form
3 * * * * 1 * * * * 1 * 0 0 *
0 0 2 * * 0 0 1 * * 0 0 1 0 *
0 0 0 -4 * 0 0 0 1 * 0 0 0 1 *
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Divide each row by
the value of the pivot
Reduced row echelon form
Reduced row
Row echelon form echelon form
3 * * * * 1 * * * * 1 * 0 0 *
0 0 2 * * 0 0 1 * * 0 0 1 0 *
0 0 0 -4 * 0 0 0 1 * 0 0 0 1 *
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Divide each row by Turn anything above a
the value of the pivot pivot to 0
Reduced row echelon form
Subtract 2 times the Add 5 times the third Subtract 4 times the
second row from the row to the first one third row from the
first one second one
Reduced row echelon form
Subtract 2 times the Add 5 times the third Subtract 4 times the
second row from the row to the first one third row from the
first one second one
Reduced row echelon form
Reduced row
Row echelon form echelon form
1 2 3 1 0 -5 1 0 0 1 0 0
0 1 4 0 1 4 0 1 4 0 1 0
0 0 1 0 0 1 0 0 1 0 0 1
Subtract 2 times the Add 5 times the third Subtract 4 times the
second row from the row to the first one third row from the
first one second one
Solving System of Linear Equations
Conclusion