Bachelor of Data
Science (Year 1)
Linear Algebra
Semester -2
MATHEMATICS (103)
8/6/2023
Linear Algebra-2 BDA SEM 2 Prof.A
Choudhury
1
Session 1,2
Systems of Linear Equations and Matrices
Introduction to Systems of Linear Equations
Gaussian Elimination
8/6/2023
Linear Algebra-2 BDA SEM 2 2
Sections
O Linear Equation in one and many
variables
O Solution set
O Linear Systems
O Graphs of linear systems in one ,two and
three variables
O Matrix representation-augmented matrix
O Consistent and Inconsistent systems of
linear equations
O Homogeneous system of linear equations
8/6/2023
Linear Algebra-2 BDA SEM 2 3
Linear systems(1)
8/6/2023
Linear Algebra-2 BDA SEM 2 4
Linear systems (2)
(e)
Which of these figures represent (i)
no solution,(ii) infinitely many
solutions and iii) unique solution?
8/6/2023
Linear Algebra-2 BDA SEM 2 5
Augmented matrix
8/6/2023
Linear Algebra-2 BDA SEM 2 7
2x1+3x2=4
7x1+6x2=9
A=
2 3
7 6
b=
4
9
Augmented matrix
[A b]
𝐴 𝑏 =
2 3 4
7 6 9
Write the augmented
matrix :
x - y + z =9
y – x = 8
2x + z = 10
Gaussian elimination
Example: Three dozens oranges and a dozen bananas
cost $9 while a dozen oranges and a dozen bananas
cost $8.What is the price of a dozen oranges and a
dozen banana?
O Step 1:Formulation of the problem:
3𝑥 + 𝑦 = 9 ; 𝑥 + 𝑦 = 8
O Step 2:
3 1
1 1
𝑥
𝑦 =
9
8
← 𝐴𝑥 = 𝑏(Matrix form)
O Step 3:𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥 ∶
𝐴 𝑏 =
3 1 9
1 1 8
𝑨 𝒃 𝒉𝒂𝒔 𝒂𝒏 𝒂𝒅𝒅𝒆𝒅 𝒄𝒐𝒍𝒖𝒎𝒏 .
8/6/2023
Linear Algebra-2 BDA SEM 2 8
Gaussian elimination
Step 4:Forward elimination:
[A b] =
3 1 9
1 1 8
→
3 1 9
0
2
3
5 R2-(1/3)R1
3𝑥 + 𝑦 = 9 → (𝑒𝑞. 1) Ax=b Ux=c
0𝑥 +
2
3
𝑦 = 5 → (𝑒𝑞. 2)
Step 5: Backward substitution:
Solving the equation(2) we get, 𝑦 = 7.5.Substituting in (1), we get
3𝑥 + 7.5 = 9
3𝑥 = 9 − 7.5
𝑥 = 0.5
Hence,(0.5,7.5) is the solution of the system of linear equations in
x and y.
8/6/2023
Linear Algebra-2 BDA SEM 2 9
Elementary row operations
O The basic method for solving a system of linear equations is to
replace the given system by a new system that has the same
solution set but is easier to solve. This new system is generally
obtained in a series of steps by applying the following three
types of operations to eliminate unknowns systematically:
O Multiply an equation through by a nonzero constant.
𝑹𝒊→ 𝒌𝑹𝒊
O Interchange two equations. 𝑹𝒊 ↔ 𝑹𝒋
O Add a multiple of one equation to another. 𝑹𝒋→
𝑹𝒋 + 𝒌𝑹𝒊
Apply elementary row operations on the augmented matrix of
2𝑥 + 𝑦 − 𝑧 = 9
𝑥 + 𝑦 + 2𝑧 = 10
−𝑦 + 3𝑧 = 7
8/6/2023
Linear Algebra-2 BDA SEM 2 10
Row echelon form of a matrix
Reduced row echelon form R
8/6/2023
Linear Algebra-2 BDA SEM 2 11
Reduced row echelon form R
Row echelon form
Row echelon form
In each part, suppose that the row echelon form of the
augmented matrix of the linear systems are given. State which of
them have a) unique solution; b) no solution & c) infinitely
many solutions. Explain why.
1.
4 6 0
0 1 3
0 0 0
3
−5
0
infinitely
2.
1 −5 1
0 0 0
0 0 0
4
0
0
infinitely
3.
2 1 3
0 0 1
no solution
4.
2 1 −1
0 1 5
0 0 4
9
11
9
unique solution
8/6/2023
Linear Algebra-2 BDA SEM 2 12
Elementary row operations
𝑥 + 𝑦 + 2𝑧 = 9 𝐴 𝑏 =
1 1 2
2 4 −3
3 6 −5
9
1
0
=
1 1 2
0 2 −7
0 3 −11
9
−17
−27
=
1 1 2
0 2 −7
0 0 −1/2
9
−17
−3/2
2𝑥 + 4𝑦 − 3𝑧 = 1
3𝑥 + 6𝑦 − 5𝑧 = 0 R3=R3-(3/2)R2 [U c]
Row echelon form:
1 1 2
0 1
−7
2
0 0
−1
6
9
−17
2
−1
2
-----------Gaussian elimination -1/2 z= -3/2 ; z=3
2y-7z=-17; 2y-21=-17 ;2y=4, y=2
Reduced row echelon form R:
1 0 0
0 1 0
0 0 1
1
2
3
-----Gauss-Jordan elimination
𝒙 = 𝟏; 𝒚 = 𝟐; 𝒛 = 𝟑
Gaussian elimination: In this procedure, there is a forward phase in which zeros are introduced below the leading
1’s.
Gauss-Jordan elimination: This algorithm has two phases; a forward phase in which zeros are introduced below
the leading 1’s and a backward phase in which zeros are introduced above the leading 1’s.
8/6/2023
Linear Algebra-2 BDA SEM 2 13
Gauss- Jordan elimination
𝑥1 + 3𝑥2 − 2𝑥3 + +2𝑥5 = 0
2𝑥1 + 6𝑥2 − 5𝑥3 − 2𝑥4 + 4𝑥5 − 3𝑥6 = -1
5𝑥3 + 10𝑥4 + 15𝑥6 = 5
2𝑥1 + 6𝑥2 + 8𝑥4 + 4𝑥5 + 18𝑥6 = 6
Solution :
𝒙 =
𝑥1
𝑥2
𝑥3
𝑥4
𝑥5
𝑥6
= 𝑟
−3
1
0
0
0
0
+ 𝑠
−4
0
−2
1
0
0
+ 𝑡
−2
0
0
0
1
0
+
0
0
0
0
0
1/3
8/6/2023
Linear Algebra-2 BDA SEM 2 14
Homogeneous Linear Systems
8/6/2023
Linear Algebra-2 BDA SEM 2 16
Special case of a homogeneous
system of linear equations.
O a1x+ b1y = 0 ; a2x+b2y=0
8/6/2023
Linear Algebra-2 BDA SEM 2 17
Theorems
Theorem 1: If a homogeneous system has n unknowns, and if
the reduced row echelon form R of its augmented matrix has r
nonzero rows, then the system has n-r free variables.
Theorem 2: A homogeneous linear system with more
unknowns than equations has infinitely many solutions.
8/6/2023
Linear Algebra-2 BDA SEM 2 18
Homogeneous Linear Systems
8/6/2023
Linear Algebra-2 BDA SEM 2 19
• What is the row reduced
echelon form of a square
invertible matrix?
Round Off Errors and
Instability
There is often a gap between mathematical theory and its
practical implementation.
O Gauss–Jordan elimination and Gaussian elimination are
good examples.
O Computers generally approximate numbers, thereby
introducing round off errors, so unless precautions are
taken, successive calculations may degrade an answer
to a degree that makes it useless.
O Algorithms (procedures) in which this happens are called
unstable.
O Gauss–Jordan elimination involves roughly 50% more
operations than Gaussian elimination.
8/6/2023
Linear Algebra-2 BDA SEM 2 20
References:
1) Howard Anton (2014). Elementary Linear Algebra, 11 th Edition.
Wiley Publication.
2) Gilbert Strang (2016 ).Introduction to Linear Algebra , 5th Edition ,
Wellesley Publishers
8/6/2023
Linear Algebra-2 BDA SEM 2 21

Linear Algebra(1).pptx

  • 1.
    Bachelor of Data Science(Year 1) Linear Algebra Semester -2 MATHEMATICS (103) 8/6/2023 Linear Algebra-2 BDA SEM 2 Prof.A Choudhury 1
  • 2.
    Session 1,2 Systems ofLinear Equations and Matrices Introduction to Systems of Linear Equations Gaussian Elimination 8/6/2023 Linear Algebra-2 BDA SEM 2 2
  • 3.
    Sections O Linear Equationin one and many variables O Solution set O Linear Systems O Graphs of linear systems in one ,two and three variables O Matrix representation-augmented matrix O Consistent and Inconsistent systems of linear equations O Homogeneous system of linear equations 8/6/2023 Linear Algebra-2 BDA SEM 2 3
  • 4.
  • 5.
    Linear systems (2) (e) Whichof these figures represent (i) no solution,(ii) infinitely many solutions and iii) unique solution? 8/6/2023 Linear Algebra-2 BDA SEM 2 5
  • 6.
    Augmented matrix 8/6/2023 Linear Algebra-2BDA SEM 2 7 2x1+3x2=4 7x1+6x2=9 A= 2 3 7 6 b= 4 9 Augmented matrix [A b] 𝐴 𝑏 = 2 3 4 7 6 9 Write the augmented matrix : x - y + z =9 y – x = 8 2x + z = 10
  • 7.
    Gaussian elimination Example: Threedozens oranges and a dozen bananas cost $9 while a dozen oranges and a dozen bananas cost $8.What is the price of a dozen oranges and a dozen banana? O Step 1:Formulation of the problem: 3𝑥 + 𝑦 = 9 ; 𝑥 + 𝑦 = 8 O Step 2: 3 1 1 1 𝑥 𝑦 = 9 8 ← 𝐴𝑥 = 𝑏(Matrix form) O Step 3:𝐴𝑢𝑔𝑚𝑒𝑛𝑡𝑒𝑑 𝑚𝑎𝑡𝑟𝑖𝑥 ∶ 𝐴 𝑏 = 3 1 9 1 1 8 𝑨 𝒃 𝒉𝒂𝒔 𝒂𝒏 𝒂𝒅𝒅𝒆𝒅 𝒄𝒐𝒍𝒖𝒎𝒏 . 8/6/2023 Linear Algebra-2 BDA SEM 2 8
  • 8.
    Gaussian elimination Step 4:Forwardelimination: [A b] = 3 1 9 1 1 8 → 3 1 9 0 2 3 5 R2-(1/3)R1 3𝑥 + 𝑦 = 9 → (𝑒𝑞. 1) Ax=b Ux=c 0𝑥 + 2 3 𝑦 = 5 → (𝑒𝑞. 2) Step 5: Backward substitution: Solving the equation(2) we get, 𝑦 = 7.5.Substituting in (1), we get 3𝑥 + 7.5 = 9 3𝑥 = 9 − 7.5 𝑥 = 0.5 Hence,(0.5,7.5) is the solution of the system of linear equations in x and y. 8/6/2023 Linear Algebra-2 BDA SEM 2 9
  • 9.
    Elementary row operations OThe basic method for solving a system of linear equations is to replace the given system by a new system that has the same solution set but is easier to solve. This new system is generally obtained in a series of steps by applying the following three types of operations to eliminate unknowns systematically: O Multiply an equation through by a nonzero constant. 𝑹𝒊→ 𝒌𝑹𝒊 O Interchange two equations. 𝑹𝒊 ↔ 𝑹𝒋 O Add a multiple of one equation to another. 𝑹𝒋→ 𝑹𝒋 + 𝒌𝑹𝒊 Apply elementary row operations on the augmented matrix of 2𝑥 + 𝑦 − 𝑧 = 9 𝑥 + 𝑦 + 2𝑧 = 10 −𝑦 + 3𝑧 = 7 8/6/2023 Linear Algebra-2 BDA SEM 2 10
  • 10.
    Row echelon formof a matrix Reduced row echelon form R 8/6/2023 Linear Algebra-2 BDA SEM 2 11 Reduced row echelon form R Row echelon form
  • 11.
    Row echelon form Ineach part, suppose that the row echelon form of the augmented matrix of the linear systems are given. State which of them have a) unique solution; b) no solution & c) infinitely many solutions. Explain why. 1. 4 6 0 0 1 3 0 0 0 3 −5 0 infinitely 2. 1 −5 1 0 0 0 0 0 0 4 0 0 infinitely 3. 2 1 3 0 0 1 no solution 4. 2 1 −1 0 1 5 0 0 4 9 11 9 unique solution 8/6/2023 Linear Algebra-2 BDA SEM 2 12
  • 12.
    Elementary row operations 𝑥+ 𝑦 + 2𝑧 = 9 𝐴 𝑏 = 1 1 2 2 4 −3 3 6 −5 9 1 0 = 1 1 2 0 2 −7 0 3 −11 9 −17 −27 = 1 1 2 0 2 −7 0 0 −1/2 9 −17 −3/2 2𝑥 + 4𝑦 − 3𝑧 = 1 3𝑥 + 6𝑦 − 5𝑧 = 0 R3=R3-(3/2)R2 [U c] Row echelon form: 1 1 2 0 1 −7 2 0 0 −1 6 9 −17 2 −1 2 -----------Gaussian elimination -1/2 z= -3/2 ; z=3 2y-7z=-17; 2y-21=-17 ;2y=4, y=2 Reduced row echelon form R: 1 0 0 0 1 0 0 0 1 1 2 3 -----Gauss-Jordan elimination 𝒙 = 𝟏; 𝒚 = 𝟐; 𝒛 = 𝟑 Gaussian elimination: In this procedure, there is a forward phase in which zeros are introduced below the leading 1’s. Gauss-Jordan elimination: This algorithm has two phases; a forward phase in which zeros are introduced below the leading 1’s and a backward phase in which zeros are introduced above the leading 1’s. 8/6/2023 Linear Algebra-2 BDA SEM 2 13
  • 13.
    Gauss- Jordan elimination 𝑥1+ 3𝑥2 − 2𝑥3 + +2𝑥5 = 0 2𝑥1 + 6𝑥2 − 5𝑥3 − 2𝑥4 + 4𝑥5 − 3𝑥6 = -1 5𝑥3 + 10𝑥4 + 15𝑥6 = 5 2𝑥1 + 6𝑥2 + 8𝑥4 + 4𝑥5 + 18𝑥6 = 6 Solution : 𝒙 = 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 = 𝑟 −3 1 0 0 0 0 + 𝑠 −4 0 −2 1 0 0 + 𝑡 −2 0 0 0 1 0 + 0 0 0 0 0 1/3 8/6/2023 Linear Algebra-2 BDA SEM 2 14
  • 15.
  • 16.
    Special case ofa homogeneous system of linear equations. O a1x+ b1y = 0 ; a2x+b2y=0 8/6/2023 Linear Algebra-2 BDA SEM 2 17
  • 17.
    Theorems Theorem 1: Ifa homogeneous system has n unknowns, and if the reduced row echelon form R of its augmented matrix has r nonzero rows, then the system has n-r free variables. Theorem 2: A homogeneous linear system with more unknowns than equations has infinitely many solutions. 8/6/2023 Linear Algebra-2 BDA SEM 2 18
  • 18.
    Homogeneous Linear Systems 8/6/2023 LinearAlgebra-2 BDA SEM 2 19 • What is the row reduced echelon form of a square invertible matrix?
  • 19.
    Round Off Errorsand Instability There is often a gap between mathematical theory and its practical implementation. O Gauss–Jordan elimination and Gaussian elimination are good examples. O Computers generally approximate numbers, thereby introducing round off errors, so unless precautions are taken, successive calculations may degrade an answer to a degree that makes it useless. O Algorithms (procedures) in which this happens are called unstable. O Gauss–Jordan elimination involves roughly 50% more operations than Gaussian elimination. 8/6/2023 Linear Algebra-2 BDA SEM 2 20
  • 20.
    References: 1) Howard Anton(2014). Elementary Linear Algebra, 11 th Edition. Wiley Publication. 2) Gilbert Strang (2016 ).Introduction to Linear Algebra , 5th Edition , Wellesley Publishers 8/6/2023 Linear Algebra-2 BDA SEM 2 21