0 valutazioniIl 0% ha trovato utile questo documento (0 voti)

0 visualizzazioni74 pagineNov 30, 2019

© © All Rights Reserved

PDF, TXT o leggi online da Scribd

© All Rights Reserved

0 valutazioniIl 0% ha trovato utile questo documento (0 voti)

0 visualizzazioni74 pagine© All Rights Reserved

Sei sulla pagina 1di 74

Linear Algebra

Lecture-02: Solution of linear systems, Inverse of a matrix, Rank of a matrix

N. Anil

BITS Pilani, Hyderabad Campus

anil@hyderabad.bits-pilani.ac.in

1 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Outline

Gauss-Jordan Method

Inverse of a Matrix

Rank of a Matrix

2 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 x1 + a12 x2 + a13 x3 = b1

a21 x1 + a22 x2 + a23 x3 = b2 (1)

a31 x1 + a32 x2 + a33 x3 = b3

Let us define

a11 a12 a13 x1 b1

A = a21 a22 a23 , x = x2 and b = b2

a31 a32 a33 x3 b3

Equation (7) can then be written as

Ax = b (2)

3 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1

A b = a21 a22 a23 b2

a31 a32 a33 b3

4 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

• A b is said to be in Row Echelon Form (REF) if

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

5 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

• A b is said to be in Row Echelon Form (REF) if

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

5 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

6 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

This method allows three types of row operations on the augmented matrix

• Type I: Multiply a row by a non-zero scalar constant

• Type III: Interchange of rows

6 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

• Pivot: An element of matrix that is chosen first to perform certain calculations

• Apply row operations to make all elements below the pivot element to zero

• Finally we arrive at an upper triangular matrix

• Diagonal elements are 1

• Use back substitution to get the solution

7 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

• Gaussian elimination changes the coefficients of the augmented system but does

not change its solution

• This implies that the resulting augmented matrix is equivalent to the given

augmented matrix

• Note: Equivalent systems have the same solutions

• These systems are obtained by performing certain row operations

• It may happen that row operations lead to rows with no pivots

8 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method. Suppose if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗=C

a31 a32 a33 b3 0 0 1 ∗

9 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method. Suppose if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗=C

a31 a32 a33 b3 0 0 1 ∗

• No. of pivots in C = 3

• No. of non-zero rows to the left of augmentation bar = 3

• System Ax = b is consistent

9 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗ = C (and p 6= 0)

a31 a32 a33 b3 0 0 0 p

10 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗ = C (and p 6= 0)

a31 a32 a33 b3 0 0 0 p

• No. of non-zero rows to the left of augmentation bar = 2

• No. of pivots = 2

• System Ax = b is inconsistent

10 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗ = C

a31 a32 a33 b3 0 0 0 0

11 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 1 ∗ ∗ = C

a31 a32 a33 b3 0 0 0 0

• The independent variable corresponding to non-pivot column can take

any value

• Here x3 can take any value (it is a free variable)

• System Ax = b is consistent with infinite solutions

11 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 0 1 ∗ = C

a31 a32 a33 b3 0 0 0 0

12 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let Ax = b be a system of linear equations. Let C be the REF obtained from A b

by Gauss elimination method and if C is

a11 a12 a13 b1 1 ∗ ∗ ∗

REF

a21 a22 a23 b2 − −→ 0 0 1 ∗ = C

a31 a32 a33 b3 0 0 0 0

• The independent variable corresponding to non-pivot column can take

any value

• Here x2 can take any value

• System Ax = b is consistent with infinite solutions

12 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Generalisation:

n×n

Let A be of size and the vectors x and b have n elements. Let C be the REF

obtained from A b by Gauss elimination method

• Alternatively: The number of non-zero rows to the left of augmentation

bar in C = n

13 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Generalisation:

n×n

Let A be of size and the vectors x and b have n elements. Let C be the REF

obtained from A b by Gauss elimination method

• It has at least one row to the left of augmentation bar in C with all zeros

and the entry right to the augmentation bar is non-zero

14 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Generalisation:

n×n

Let A be of size and the vectors x and b have n elements. Let C be the REF

obtained from A b by Gauss elimination method and if C is

• It has at least one row to the left of augmentation bar in C with all zeros

and the entry right to the augmentation bar is also zero

• Note that the independent variables corresponding to non-pivot columns

can take any value

15 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Homework

• Please implement REF

• Entries are A and b

• It should first tell whether the system is consistent or not

• If it is consistent then it should say unique or infintie solutions

• In the case of unique solution it should give the full solution

• In the case of infinite solutions it should tell the free variables and the solutions

• Test the performance of the code with online source codes

16 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

17 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

18 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

19 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

20 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

21 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

22 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

23 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

24 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

25 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

26 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

27 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

28 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 x1 + a12 x2 + a13 x3 = b1

a21 x1 + a22 x2 + a23 x3 = b2 (3)

a31 x1 + a32 x2 + a33 x3 = b3

Let us define

a11 a12 a13 x1 b1

A = a21 a22 a23 , x = x2 and b = b2

a31 a32 a33 x3 b3

Equation (7) can then be written as

Ax = b (4)

29 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

(

x1 + x2 = 0

Examples: ,

x1 − x2 = 0

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

5x1 − 2x2 + 3x3 = 0

(

x1 + x2 = 0

Examples: , 6x1 + x2 − 7x3 = 0

x1 − x2 = 0

−x + 3x + x = 0

1 2 3

30 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 x1 + a12 x2 + a13 x3 = 0

a21 x1 + a22 x2 + a23 x3 = 0 (5)

a31 x1 + a32 x2 + a33 x3 = 0

Let us define

a11 a12 a13 x1 0

A = a21 a22 a23 , x = x2 and 0 = 0

a31 a32 a33 x3 0

Equation (7) can then be written as

Ax = 0 (6)

31 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 0

A 0 = a21 a22 a23 0

a31 a32 a33 0

32 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

• Either we have unique solution or infinitely many solutions

33 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

of homogeneous linear equations. Let C be the REF

obtained from A 0 by Gauss elimination method. Suppose if C is

a11 a12 a13 0 1 ∗ ∗ 0

REF

a21 a22 a23 0 −−→ 0 1 ∗ 0 = C

a31 a32 a33 0 0 0 1 0

• It is the trivial solution

• ∗ is any constant value

• No. of pivots in C = 3

• No. of non-zero rows to the left of augmentation bar = 3

34 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let

Ax = 0 be a system of linear equations. Let C be the REF obtained from

A 0 by Gauss elimination method and if C is

a11 a12 a13 0 1 ∗ ∗ 0

REF

a21 a22 a23 0 − −→ 0 1 ∗ 0 = C

a31 a32 a33 0 0 0 0 0

• The independent variable corresponding to non-pivot column can take

any value

• Here x3 can take any value (it is a free variable)

• System Ax = b is consistent with infinite solutions

35 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Let

Ax = 0 be a system of linear equations. Let C be the REF obtained from

A 0 by Gauss elimination method and if C is

a11 a12 a13 0 1 ∗ ∗ 0

a21 a22 a23 0 − REF

−→ 0 0 1 0 = C

a31 a32 a33 0 0 0 0 0

• The independent variable corresponding to non-pivot column can take

any value

• Here x2 can take any value

• System Ax = b is consistent with infinite solutions

36 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Generalisation:

Let A be of size

obtained from A 0 by Gauss elimination method

• Alternatively: The number of non-zero rows to the left of augmentation

bar in C = n

• The unique solution is the zero or the null vector

37 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Generalisation:

Let A be of size

obtained from A 0 by Gauss elimination method and if C is

• It has at least one row to the left of augmentation bar in C with all zeros

and the entry right to the augmentation bar is also zero

• Note that the independent variables corresponding to non-pivot columns

can take any value

38 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

39 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

40 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

41 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

42 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

43 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

44 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

45 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

46 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 x1 + a12 x2 + a13 x3 = b1

a21 x1 + a22 x2 + a23 x3 = b2 (7)

a31 x1 + a32 x2 + a33 x3 = b3

Let us define

a11 a12 a13 x1 b1

A = a21 a22 a23 , x = x2 and b = b2

a31 a32 a33 x3 b3

Equation (7) can then be written as

Ax = b (8)

47 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1

A b = a21 a22 a23 b2

a31 a32 a33 b3

48 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

• A b is said to be in Row Echelon Form (REF) if

a11 a12 a13 b1 1 ∗ ∗ ∗

a21 a22 a23 b2 → 0 1 ∗ ∗

a31 a32 a33 b3 0 0 1 ∗

• A b is said to be in Reduced Row Echelon Form (RREF) if

a11 a12 a13 b1 1 0 0 ∗

a21 a22 a23 b2 → 0 1 0 ∗

a31 a32 a33 b3 0 0 1 ∗

• Advantage: Solutions can be found easily

49 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 0 0 ∗

a21 a22 a23 b2 → 0 1 0 ∗

a31 a32 a33 b3 0 0 1 ∗

• First apply the Gaussian elimination method to get REF

• Later use row operations to make all entries above the pivots to zero

50 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

a11 a12 a13 b1 1 ∗ ∗ ∗ 1 0 0 ∗

REF RREF

a21 a22 a23 b2 −−→ 0 1 ∗ ∗ −−−→ 0 1 0 ∗

a31 a32 a33 b3 0 0 1 ∗ 0 0 1 ∗

above the pivot element to zeros

• Obviously, RREF is computationally more expensive than REF

• More type-II operations lead to more round-off errors (when computers are used).

Therefore, Gauss elimination yields more accurate solution compared to

Gauss-Jordan method

• Obtaining the solution is lot more straight forward with RREF

51 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Definition

Let A and B be two n × n matrices. The matrix B is said to be a multiplicative

inverse of A if and only if AB = BA = In .

52 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Definition

A square matrix is singular if and only if it does not have an inverse. It is non-singular

if and only if it has an inverse

Ax = b has a unique solution x = A−1 b if and only if A is non-singular

•

• In the above case if A is singular, then the system has either no solution

or infinitely many solutions

53 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

−1

• A−1 is non-singular and A−1 =A

k −1

k

Ak is non-singular and A = A−1 = A−k , for any integer k

•

−1 T

• AT is non-singular and AT = A−1

•

s

• (As )t = Ast = At

54 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

• Construct a n × 2n augmented matrix, whose first n columns are from A and the

rest of n columns from In

• Transform A In into RREF using Gauss-Jordan method

•

A−1

• That is A In transforms to In

55 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

56 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

57 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

58 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

59 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

60 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

61 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Rank of a Matrix

Rank

in the row echelon form (REF) or reduced row echelon form (RREF) of the

matrix A.

pivots in the RREF of A.

62 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Rank of a Matrix

2 1 4

A = 3 2 5

0 −1 1

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Rank of a Matrix

2 1 4

A = 3 2 5

0 −1 1

1 0 0

RREF(A) = 0 1 0

0 0 1

Therefore Rank of A is 3

63 / 64

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Rank of a Matrix

3 1 0 1 −9

A = 0 −2 12 −8 −6

2 −3 22 −14 −17

Gaussian Elimination Method Homogeneous Linear Systems Gauss-Jordan Method Inverse of a Matrix Rank of a Matrix

Rank of a Matrix

3 1 0 1 −9

A = 0 −2 12 −8 −6

2 −3 22 −14 −17

1 0 2 −1 −4

RREF(A) = 0 1 −6 4 3

0 0 0 0 0

Rank of A is 2

64 / 64

## Molto più che documenti.

Scopri tutto ciò che Scribd ha da offrire, inclusi libri e audiolibri dei maggiori editori.

Annulla in qualsiasi momento.