Matrix Algebra and Computational Methods
(Course Code: 23MA301BS104)
(B.Tech 1st Year, II Sem.)
AY: 2023-2024
Department of Mathematics
School of CS and AI
SR University
Detailed Syllabus
Module I
Matrices and Linear Equations
• Vector Space over R and Subspaces, Module II
• Null space and Column space, Numerical Methods
• Linear dependence-independence, • Algebraic and Transcendental Equations
• Span-Basis-dimensions, • Bisection Method
• Types of Matrices, • Newton Raphson Method
• Matrix operations, • Finite Differences,
• System of linear equations, • Relations between the operators ,
• Gauss elimination method, • Newton’s Forward and Backward
• Rank, Inverse Matrices, Interpolation
• Properties of Determinants, • Lagrange’s Interpolation Formula.
• Linear transformations, • Numerical Integration – Trapezoidal Rule –
• Matrix representation of a linear transformation, Simpson’s 1/3 Rule – Simpson’s 3/8 Rule
• Change of basis, • Numerical Solutions of ODE – Euler’s
• Eigenvalues and Eigenvectors, Method and Euler’s Modified Method –
• Characteristic polynomials, Runge - Kutta 4th order Method.
• Cayley-Hamilton theorem – applications.
Vectors
• A vector is most simply thought of as a matrix with a single
column. For instance,
1
2 2
𝑣= and 𝑤 = are both vectors.
1 3
4
• The entries in a vector are called its components.
• Since the vector 𝑣 has two components, it is a two-
dimensional vector.
• The vector 𝑤 is a four-dimensional vector.
Graphical representation
• We denote the set of all 𝑚–dimensional vectors by ℝm . of the vector 𝒗
• If 𝑢 is a 3-dimensional vector, we say that 𝑢 is in ℝ3 .
Properties
Graphical representation of vector addition
Linear Combinations
Matrix
Types of Matrices
Types of Matrices
Types of Matrices
Matrix Addition/Subtraction
Matrix Multiplication
In matrix algebra, there are two kinds of matrix multiplication: multiplication of a matrix by a
number and multiplication of a matrix by another matrix.
Scalar Multiplication
When you multiply a matrix by a number, you multiply every element in the matrix by the same
number. This operation produces a new matrix, which is called a scalar multiple.
Ex: =
Product of Matrices
The matrix product AB is defined only when the number of columns in A is equal to the number
of rows in B. Similarly, the matrix product BA is defined only when the number of columns in B
is equal to the number of rows in A.
Example
Elementary Row Operations
• Interchanged any rows (𝑅𝑖 interchanged with 𝑅𝑗 )
• Addition/Subtraction of any row to/from any row (𝑒. 𝑔., 𝑅𝑖 replaced with 𝑅𝑖 ± 2𝑅𝑗 )
• Scaling of any row (𝑅𝑖 replaced with 𝑘 ∗ 𝑅𝑖 , where 𝑘 is a scalar)
Example:
• Let 𝑨 be a 3 × 3 matrix:
1 2 3
𝐴= 4 5 6
7 8 9
• Row operation 1: Interchange the 2nd row and 3rd row:
1 2 3
𝐴= 7 8 9
4 5 6
• Row operation 2: Replace the 1st row by 𝑹𝟏 + 𝑹𝟐
8 10 12
𝐴= 7 8 9
4 5 6
𝟏
• Row operation 3: Replace the 3rd row by ∗ 𝑹𝟑
𝟐
8 10 12
𝐴= 7 8 9
2 5/2 3
Row Echelon Form
A matrix is in row echelon form when it satisfies the following conditions.
• The first non-zero element in each row, called the leading entry or pivot.
• Each leading entry is to the right of the leading entry in the previous row.
• Rows with all zero elements, if any, are below rows having a non-zero element.
Row Reduced Echelon Form
A matrix is in reduced row echelon form when it satisfies the following conditions.
• The matrix satisfies conditions for a row echelon form.
• The leading entry (pivot) in each row is only 1.
• The leading entry in each row is the only non-zero entry in its column.
System of Linear Equations
• A linear equation in unknowns 𝑥, 𝑦, 𝑧 is an equation that can be put in the
standard form:
𝑎1 𝑥 + 𝑎2 𝑦 + 𝑎3 𝑧 = 𝑏
where 𝑎1 ; 𝑎2 ; 𝑎3 , and 𝑏 are constants. The constant 𝑎1 ; 𝑎2 ; 𝑎3 are called the
coefficient of𝑥, 𝑦, 𝑧, and 𝑏 is called the constant term of the equation.
• A system of linear equations is a list of linear equations with the same
unknowns.
𝑎1 𝑥 + 𝑎2 𝑦 + 𝑎3 𝑧 = 𝑎 2𝑥 + 3𝑦 + 4𝑧 = 5
Example (with 3 unknowns): 𝑏1 𝑥 + 𝑏2 𝑦 + 𝑏3 𝑧 = b or 𝑥 + 2𝑦 + 3𝑧 = 4
𝑐1 𝑥 + 𝑐2 𝑦 + 𝑐3 𝑧 = c 3𝑥 + 4𝑦 + 5𝑧 = 6
Solution of System of Equations
Gaussian Elimination Method:
• Step 1: Consider the following system of linear equations:
𝑎1 𝑥 + 𝑎2 𝑦 + 𝑎3 𝑧 = a
𝑏1 𝑥 + 𝑏2 𝑦 + 𝑏3 𝑧 = b
𝑐1 𝑥 + 𝑐2 𝑦 + 𝑐3 𝑧 = c
• Step 2: Convert to a matrix form: 𝑨𝒙 = 𝑩, Where A is co-efficient
𝑎1 𝑎2 𝑎3 𝑥 𝑎
matrix= 𝑏1 𝑏2 𝑏3 , 𝑥 = 𝑦 , 𝐵 = 𝑏 .
𝑐1 𝑐2 𝑐3 𝑧 𝑐
• Step 3: Convert the augmented matrix (A|B) to its row echelon form.
• Step 4: Solve by backward substitutions.
Example
Solve the following system of linear equations (Gaussian Elimination Method):
𝑥 − 3𝑦 − 2𝑧 = 6
2𝑥 − 4𝑦 − 3𝑧 = 8
−3𝑥 + 6𝑦 + 8𝑧 = −5
1 −3 −2 𝑥 6
⇒ Convert to matrix form: 2 −4 −3 𝑦 = 8 .
−3 6 8 𝑧 −5
1 −3 −2 6 𝟑
⇒ Consider the augmented matrix 2 −4 −3 8 𝑹𝟐 → 𝑹𝟐 − 𝟐𝑹𝟏 ; 𝑹𝟑 → 𝑹𝟑 + 𝟑𝑹𝟏 ; 𝑹𝟑 → 𝑹𝟑 + 𝑹
𝟐 𝟐
−3 6 8 −5
1 −3 −2 6
⇒ Converting the augmented matrix to row echelon form (using row operations): 0 2 1 −4
7
0 0 7
2
7
⇒ Do Backward Calculation: 𝑧 = 7 ⇒ 𝑧 = 2, 2𝑦 + 𝑧 = −4 ⇒ 𝑦 = −3, 𝑥 − 3𝑦 − 2𝑧 = 6 ⇒ 𝑥 = 1
2
Hence, solution is 𝒙 = 𝟏, 𝒚 = −𝟑, 𝒛 = 𝟐.
Practice Problems
Solve the following systems of linear equations by using Gaussian elimination
method:
1.
𝑥 + 2𝑦 − 𝑧 = −1
2𝑥 + 2𝑦 + 𝑧 = 1
3 𝑥 + 5𝑦 − 2𝑧 = −1.
2.
𝑥−4𝑦−𝑧+𝑤 = 3
2𝑥 − 8𝑦 + 𝑧 − 4𝑤 = 9
−𝑥 + 4𝑦 − 2𝑧 + 5𝑤 = −6
Inverse of Matrix
Definition: A square matrix 𝑨 of order 𝒏 is said to be invertible matrix if there
exists a matrix 𝑩 of order 𝒏 such that 𝑨𝑩 = 𝑩𝑨 = 𝑰𝒏 and 𝑩 is called inverse of
the matrix 𝑨. The inverse of 𝑨 denoted by 𝑨−𝟏 .
Properties:
• An invertible matrix has a unique inverse.
• 𝐴−1 −1
=𝐴
• 𝐴𝐵 −1 = 𝐵−1 𝐴−1
• 𝐴𝑡 −1 = 𝐴−1 𝑡
How to Find Inverse of Matrix?
Gauss-Jordan Method:
Find the inverse of a matrix A of order n.
Gauss-Jordan Method:
Step 1: Consider the Form:
𝑻𝒉𝒆 𝑮𝒊𝒗𝒆𝒏 𝑴𝒂𝒕𝒓𝒊𝒙 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚 𝑴𝒂𝒕𝒓𝒊𝒙 𝒐𝒇 𝒐𝒓𝒅𝒆𝒓 𝒏 = 𝑨 𝑰
Using Elementary Row Operations
Step 2: Convert the matrix form to 𝑰𝒅𝒆𝒏𝒕𝒊𝒕𝒚 𝒎𝒂𝒕𝒓𝒊𝒙 𝑨−𝟏
Example
3 0 2
Find the inverse of the matrix 2 0 −2 .
0 1 1
Practice Problem
Linearly Independence
A set of vectors 𝑣1 , 𝑣2 , 𝑣3 , … , 𝑣𝑘 is linearly independent if the vector
equation:
𝑐1 𝑣1 + 𝑐2 𝑣2 + 𝑐3 𝑣3 + ⋯ + 𝑐𝑘 𝑣𝑘 = 0
has only the trivial solution 𝑐1 = 𝑐2 = 𝑐3 = ⋯ = 𝑐𝑘 = 0. Otherwise the set
of vectors 𝑣1 , 𝑣2 , 𝑣3 , … , 𝑣𝑘 is called linearly dependent.
1 0 0
Example: 0 , 1 , 0 ⇒ Linearly Independent.
0 0 1
1 0 1
0 , 1 , 1 ⇒ Linearly Dependent.
0 0 0
Rank of a Matrix
Definition:
The rank of a matrix is defined as:
i) the maximum number of linearly independent column vectors in
the matrix
or
ii) the maximum number of linearly independent row vectors in the
matrix. Both definitions are equivalent.
For an 𝑚 × 𝑛 matrix:
▪ If 𝑚 is less than 𝑛, then the maximum rank of the matrix is 𝑚.
▪ If 𝑚 is greater than 𝑛, then the maximum rank of the matrix is 𝑛.
Properties of Rank
Notes:
i) The rank of a matrix is always unique.
ii) The rank of a zero matrix is always zero.
iii) The rank of a non-singular matrix of order 𝑛 is 𝑛.
iv) The rank of a singular matrix of order 𝑛 is < 𝑛.
v) The rank of a unit/identity matrix of order 𝑛 is 𝑛.
vi) If 𝑨 is a matrix of order 𝑚 × 𝑛, then 𝑟𝑎𝑛𝑘(𝐴) ≤ min(𝑚, 𝑛).
vii) rank(𝐴)= rank(𝐴𝑡 ).
How to Find Rank of a Matrix?
Write the given matrix
Using elementary row operations
Transform the matrix to its row echelon form
Count the number of non-zero rows in the echelon form
Rank of the matrix = number of non-zero rows in the echelon form
Example
Find the rank of the matrix:
First interchange 𝑹𝟏 and 𝑹𝟐 . Next apply the operations ‘‘Replace 𝑹𝟐 by 𝑹𝟐 + 𝟒𝑹𝟏 ’’ and
‘‘Replace 𝑹𝟑 𝒃𝒚 𝑹𝟑 − 𝟔𝑹𝟏 ’’; and then apply the operation ‘‘Replace 𝑹𝟑 by 𝑹𝟑 + 𝑹𝟐 .’’
These operations yield
You can check that the number of non-zero rows in the echelon form of B is two. Hence the
rank of B is 2.
Practice Problems
Find the rank of the following matrices:
1. 2.
3.
Working rule for finding the solutions of 𝐴𝑥 = 𝐵
• The system is consistent i.e., it has a solution if and only if
𝑟𝑎𝑛𝑘 𝑜𝑓 𝐴 = 𝑟𝑎𝑛𝑘 𝑜𝑓 [𝐴/𝐵].
• If 𝑟𝑎𝑛𝑘 𝑜𝑓 𝐴 = 𝑟𝑎𝑛𝑘 𝑜𝑓 [𝐴/𝐵] < 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑢𝑛𝑘𝑛𝑜𝑤𝑛𝑠 , the
system is consistent and there exists infinite number of solutions.
• If 𝑟𝑎𝑛𝑘 𝑜𝑓 𝐴 = 𝑟𝑎𝑛𝑘 𝑜𝑓 [𝐴/𝐵] = 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑢𝑛𝑘𝑛𝑜𝑤𝑛𝑠 , the
system has unique solution.
• If 𝑟𝑎𝑛𝑘 𝑜𝑓 𝐴 ≠ 𝑟𝑎𝑛𝑘 𝑜𝑓 [𝐴/𝐵], the system is inconsistent. It has
no solution.
Example 1
Show that the following system is consistent and has a unique solution:
x + 2y + z = 3
x + 3y + z = 5
3x + 8y + 4z = 17
Ans: Reduce the augmented matrix (M) to echelon form (using the row operations 𝑹𝟐 → 𝑹𝟐 − 𝑹𝟏 ,
𝑹𝟑 → 𝑹𝟑 − 𝟑𝑹𝟏 , 𝑹𝟑 → 𝑹𝟑 − 𝟐𝑹𝟐 ) as follows:
Now, from the echelon form, you can check that,
The rank of A = Rank of augmented matrix = number of unknowns = 3.
Hence the system is consistent and has a unique solution.
Example 2
Show that the given system is inconsistent
𝑥 − 2𝑦 + 4𝑧 = 2
2𝑥 − 3𝑦 + 5𝑧 = 3
3𝑥 − 4𝑦 + 6𝑧 = 7
Ans: Reduce the augmented matrix (M) to echelon form (using the row operations 𝑹𝟐 → 𝑹𝟐 − 𝟐𝑹𝟏 ,
𝑹𝟑 → 𝑹𝟑 − 𝟑𝑹𝟏 , 𝑹𝟑 → 𝑹𝟑 − 𝟐𝑹𝟐 ) as follows:
Now, from the echelon form, you can check that,
The rank of A ≠ Rank of augmented matrix.
Hence the system is inconsistent and has no solution.
Example 3
Show that the following system is consistent and has infinite number of solutions:
x + y + 3z = 1
2x + 3y − z = 3
5x + 7y + z = 7
Ans: Reduce the augmented matrix (M) to echelon form (using the row operations
𝑹𝟐 → 𝑹𝟐 − 𝟐𝑹𝟏 , 𝑹𝟑 → 𝑹𝟑 − 𝟓𝑹𝟏 , 𝑹𝟑 → 𝑹𝟑 − 𝟐𝑹𝟐 ) as follows:
1 1 3 1
~ 0 1 −7 1
0 0 0 0
Now, from the echelon form, you can check that,
The rank of A = Rank of augmented matrix = 2 < number of unknowns = 3.
Hence the system is consistent and has infinite number of solutions.
Practice Problems
1. For what values of 𝑎 and 𝑏, the equations:
𝑥 + 2𝑦 + 3𝑧 = 4
𝑥 + 3𝑦 + 4𝑧 = 5
𝑥 + 3𝑦 + 𝑎𝑧 = 𝑏
will have (i) No solution (ii) Unique solution (iii) Infinite number of solutions?
2. For what values of a and b the equations
𝑥 + 𝑦 + 𝑧 = 6
𝑥 + 2𝑦 + 3𝑧 = 10
𝑥 + 2𝑦 + 𝑎𝑧 = 𝑏
will have (i) No solution (ii) Unique solution, (iii) Infinite no. of solutions.