Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

1

MATHEMATICS FOR DATA SCIENCE II

WEEK 1

Recall: TOPICS TO BE COVERED IN WEEK 1

 Vectors
 Vector addition
 Scalar Multiplication
 Visualization (in R2, R3)
 Matrices
 Rows , Columns, Size
 Matrix operations
o addition
o scalar multiplication
o multiplication
o transpose
 Matrix types
o rectangular
o square
o diagonal
o scalar
o zero (null)
o identity
o triangular
 System of linear equations
 Consistent - unique/infinitely many solutions
 Inconsistent - no solution

Instructor: Dr. Lavanya S


2

 Determinants

Instructor: Dr. Lavanya S


3

Topics to be covered in week 2:

o Some properties of determinants


o Solutions for a system of linear equations
 Cramer's rule
 Using inverse of a matrix
 Row reduction
 REF, RREF
 Dependent and independent variables
 Guassian elimination method

Row operations:The row operations consist of the following

1. Switch two rows


2. Multiply a row by a nonzero number
3. Replace a row by a multiple of another row added to itself

Determinants after row operations:

1) Switching two rows or columns changes the sign of the determinant


2) Scalar multiplication of a row by a constant 𝑡 multiplies the determinant by 𝑡
3) Multiples of rows or columns can be added together without changing the
determinant’s value
1 2 7 10
Exercise: (i) Let 𝐴 = ( ) and 𝐵 = ( ). What is the relationship between A and
3 4 3 4
B. What is det(A) and det(B)?

1 2
(ii) What is the determinant of ( )?
2 4

Instructor: Dr. Lavanya S


4

Observation: If a matrix A contains a row/column which is a multiple of another


row, then 𝑑𝑒𝑡 (𝐴) is equal to 0.

(iii) If a matrix A contains a zero row/column, then 𝑑𝑒𝑡(𝐴) =

4 0 0
(iv) det(0 1 0)
0 0 1

Some Important properties of determinant:

(i) det(𝐴1. 𝐴2 … 𝐴𝑛 ) = det(𝐴1 ) . det(𝐴2) … det(𝐴𝑛 ).

(ii) determinant of a diagonal/triangular matrix = product of diagonal entries.


1
(iii) det(𝐴−1) = (assuming 𝑑𝑒𝑡(𝐴) ≠ 0)
det(𝐴)

(iv)If A is a nxn matrix and t is any scalar, 𝑑𝑒𝑡(𝑡𝐴) = 𝑡 𝑛 𝑑𝑒𝑡(𝐴).

(v) If 𝐴𝑥 = 𝑏 represents a system on linear equations where 𝐴 is a nxn matrix, then the
system has an unique solution if and only if 𝑑𝑒𝑡(𝐴) ≠ 0.

(vi) det(At)= det(A)

(vii) Determinant of a matrix in which one row(column) is a linear combination of other


rows(columns) is zero.

Exercises:

(i) det(P-1AP) =

(ii) det(AtA) =

Instructor: Dr. Lavanya S


5

Determinant in terms of minors and cofactors

If A is a square matrix, then the minor of the entry in the i-th row and j-th column (also
called the (i, j) minor, or a first minor) is the determinant of the submatrix formed by
deleting the i-th row and j-th column. This number is often denoted 𝑀𝑖𝑗 .

Instructor: Dr. Lavanya S


6

Cramer’s rule for invertible coefficient matrix

Instructor: Dr. Lavanya S


7

Instructor: Dr. Lavanya S


8

INVERSE OF A MATRIX
Let A be an n×n matrix. Then the inverse of A, represented by A -1, is the unique matrix
which satisfies the condition
AA-1 = AA-1 = I.

where 𝑎𝑑𝑗(𝐴) = transpose of cofactor matrix.

Examples

Instructor: Dr. Lavanya S


9

SOLUTION OF A SYSTEM OF LINEAR EQUATIONS WITH AN INVERTIBLE COEFFICIENT


MATRIX
Consider a system of linear equations 𝐴𝑥 = 𝑏 where 𝐴 is an invertible matrix. Then
solution of the system of linear equations can be obtain as follows: 𝐴𝑥 = 𝑏. Pre-
multiplication of A−1 both sides, we get,

Steps to find the solution of above system of linear equations using inverse of the
coefficient matrix:
Consider a system of linear equations

matrix representation of the above system of linear equation is 𝐴𝑥 = 𝑏, where

Step-1: Find the inverse of the matrix A.

Step-2: Find the matrix multiplication of A −1 with b, i.e. A −1b which is a column matrix.

Step-3: Compare with the column matrix x and find the value of x 1, x2, . . .,xn

Example:

Instructor: Dr. Lavanya S


10

SOLUTIONS OF A HOMOGENEOUS SYSTEM OF LINEAR EQUATIONS

Example:

Instructor: Dr. Lavanya S


11

Gauss elimination method


We have learned some method to solve a system of linear equations when a system of
linear equations has a unique solution (i.e., when the coefficient matrix of the system of
linear equations is a square matrix and has determinant non zero).

But what will be the case when a system of linear equations has following things?

1. when the coefficient matrix of the system of linear equations is an square matrix and
has determinant zero.
2. A system of linear equations consists of m equations and n variables i.e. a system of
linear equations whose coefficient matrix is an rectangular matrix.

To solve such kind of system of linear equations there is a method called "Gauss
elimination method”

Row echelon form:

Reduced row echelon form:

Instructor: Dr. Lavanya S


12

1 0 2 2
1 2 3 1 0 2 1 0 −1
[ ], [ ], [ ], [0 1 0 2]
0 0 1 0 1 2 0 0 0
0 0 0 1

Solution of Ax = b when A is in reduced row echelon form

1 0
𝐴=[ ]
0 1

1 0
𝐴 = [0 1]
0 0

1 2 0
𝐴=[ ]
0 0 1

Instructor: Dr. Lavanya S


13

Dependent variable and independent variable


Let Ax = b be a system of linear equations, where A is in reduced row echelon form.
Assume that for each zero row of A, the corresponding entry of b also 0 ( i.e., the system
of linear equations has a solution)
• If the i-th column has the leading entry of some row, we call x i a dependent variable.

• If the i-th column does not have the leading entry of any row, we call x i an independent
variable.

Question: Consider a system of linear equations

Which of the variables are dependent and independent variables?

Instructor: Dr. Lavanya S


14

Consider the system of linear equations given by Ax = b where

Question 1: Find the number of independent variables.


Question 2: If x1 = 0 is given, then find out the number of solutions of the given system of
linear equations.

Instructor: Dr. Lavanya S


15

Steps to find the solution of a system of linear equations using Gauss elimination
method
Consider a system of linear equations Ax = b.
Step-1: Form the augmented matrix of the system [A|b].
Step-2: Perform the same elementary row operations on the matrix [A|b] that were used
to bring the matrix A into reduced row echelon form.
Step-3: After obtaining the reduced row echelon form the matrix [A|b], let R be the
submatrix of the obtained matrix of the first n columns and c be the submatrix of the
obtained matrix consisting of the last column. We can write reduced row echelon form of
[A|b] to [R|c].
Step-4: Form the corresponding system of linear equations Rx = c.
Step-5: Find all the solutions of Rx = c, those solution will be the solution of Ax = b.

Examples: (i) Consider a system of linear equations:

Instructor: Dr. Lavanya S


16

(ii)

Instructor: Dr. Lavanya S


17

Instructor: Dr. Lavanya S


18

Instructor: Dr. Lavanya S


19

Exercises: Find matrices in REF and RREF form.

Consider the system of linear equations given below:

x−y+z=2

x+y−z=3

−x + y + z = 4.

The system of linear equations has

[Hint: Use the relation between a system of linear equations and determinant of
corresponding coefficient matrix.]

• Option 1: no solution.

• Option 2: infinitely many solutions.

• Option 3: a unique solution.

• Option 4: finitely many solutions.

• Option 5: 3 dependent variables.

• Option 6: 2 dependent and 1 independent variables.

Instructor: Dr. Lavanya S


20

Instructor: Dr. Lavanya S


21

HW: For any diagonal matrix, write the condition for invertibility and what is the inverse of
a invertible diagonal matrix.

Instructor: Dr. Lavanya S


22

Instructor: Dr. Lavanya S

You might also like