41
ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination Jan, 2011.

ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Embed Size (px)

DESCRIPTION

ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination. Jan, 2011. Outline. Matrix arithmetic Matrix addition, multiplication Non-singular matrix Gauss-Jordan elimination. The love function: a normal case. Function L. Function L’. Domain. Range. Range. Domain. Boy 1 - PowerPoint PPT Presentation

Citation preview

Page 1: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

ENGG2013 Unit 7Non-singular matrix

and Gauss-Jordan eliminationJan, 2011.

Page 2: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Outline

• Matrix arithmetic– Matrix addition, multiplication

• Non-singular matrix• Gauss-Jordan elimination

kshum ENGG2013 2

Page 3: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

The love function: a normal case

kshum ENGG2013 3

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

Function LDomain Range

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

DomainRange

L(Boy 1) = Girl A, but L’(Girl A) = Boy 4.

Function L’

Page 4: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

The love function: a utopian case

kshum ENGG2013 4

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

Function LDomain Range

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

Function L’Domain Range

This function L’ is the inverse of L

Page 5: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

The love function: no inverse

kshum ENGG2013 5

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

Function LDomain Range

Boy 1

Boy 2

Boy 3

Boy 4

Boy 5

Girl A

Girl B

Girl C

Girl D

Girl E

Domain Range

This function L has no inverse

This is not a function

Page 6: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Undo-able

kshum ENGG2013 6

Multiplied by

Rotate 90 degrees clockwise

Multiplied by

Rotate 90 degrees counter-clockwise

A matrix which represents a reversibleprocess is called invertible or non-singular.

Page 7: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Objectives

• How to determine whether a matrix is invertible?

• If a matrix is invertible, how to find the corresponding inverse matrix?

kshum ENGG2013 7

Page 8: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

MATRIX ALGEBRA

kshum ENGG2013 8

Page 9: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Matrix equality

• Two matrices are said to be equal if1. They have the same number of rows and the same number

of columns (i.e. same size).2. The corresponding entry are identical.

kshum ENGG2013 9

Page 10: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Matrix addition and scalar multiplication

• We can add two matrices if they have the same size

• To multiply a matrix by a real number, we just multiply all entries in the matrix by that number.

kshum ENGG2013 10

Page 11: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Matrix multiplication

• Given an mn matrix A and a pq matrix B, their product AB is defined if n=p.

• If n = p, we define their product, say C = AB, by computing the (i,j)-entry in C as the dot product of the i-th row of A and the j-th row of B.

kshum ENGG2013 11

mnpq

m q

Page 12: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Examples

kshum ENGG2013 12

is undefined.

is undefined.

Page 13: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Square matrix• A matrix with equal number of columns and rows is

called a square matrix.• For square matrices of the same size, we can freely

multiply them without worrying whether the product is well-defined or not.– Because multiplication is always well-defined in this case.

• The entries with the same column and row index are called the diagonal entries.– For example:

kshum ENGG2013 13

Page 14: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Compatibility with function composition

kshum ENGG2013 14

Multiplied by

Multiplied by

Multiplied by

Page 15: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Order does matter in multiplication

kshum ENGG2013 15

Multiplied by

Rotate 90 degrees

Multiplied by

Reflection around x-axis

Multiplied by

Reflection around x-axis

Multiplied by

Rotate 90 degrees

Are they the same?

Page 16: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Non-commutativity

• For real numbers, we have 35 = 53.– Multiplication of real numbers is commutative.

• For matrices, in general AB BA.– Multiplication of matrices is non-commutative.– For example

kshum ENGG2013 16

Page 17: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Associativity

• For real numbers, we have (34)5 = 3(45).– Multiplication of real numbers is associative.

• For any three matrices A, B, C, it is always true that (AB)C = A(BC), provided that the multiplications are well-defined.– Multiplication of matrices is associative.

kshum ENGG2013 17

Page 18: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

INVERTIBLE MATRIX

kshum ENGG2013 18

Page 19: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Identity matrix• A square matrix whose diagonal entries are all one, and off-diagonal entries are all zero,

is called an identity matrix.

• We usually use capital letter I for identity matrix, or add a subscript and write In if we want to stress that the size is nn.

kshum ENGG2013 19

Page 20: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Multiplication by identity matrix

• Identity matrix is like a do-nothing process.– There is no change after multiplication by the

identity matrix

• IA = A for any A.• BI = B for any B.

kshum ENGG2013 20

Multiplied by

is trivial

Page 21: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Invertible matrix• Given an nn matrix A, if we can find a matrix A’, such that

then A is said to be invertible, or non-singular.• This matrix A’ is called an inverse of A.

kshum ENGG2013 21

Multiplied by

A

Multiplied by

A’

Multiplied by

In

Page 22: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Example

kshum ENGG2013 22

Multiplied by

Rotate 90 CW

Multiplied by

Rotate 90 CCW

implies is invertible.

Page 23: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Matrix inverse may not exist

• If matrix A induces a many-to-one mapping, then we cannot hope for any inverse.

kshum ENGG2013 23

has no inverse

Page 24: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Naïve method for computing matrix inverse

• Consider

• Want to find A’ such that A A’= I• Solve for p, q, r, s in

kshum ENGG2013 24

Page 25: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Uniqueness of matrix inverse

• Before we discuss how to compute matrix inverse, we first show there is at most one A’ such that A A’ = A’ A = I.

• Suppose on the contrary that there is another matrix A’’ such that A A’’ = A’’ A = I.

• We want to prove that A’ = A’’.

kshum ENGG2013 25

Page 26: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Proof of uniqueness

kshum ENGG2013 26

Defining property of A’’

Multiply by A’ from the left

I times anything is the same thing

Matrix multiplication is associative

Defining property of A’

I times anything is the same thing

Page 27: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Notation

• Since the matrix inverse (if exists) is unique, we use the symbol A-1 to represent the unique matrix which satisfies

• We say that A-1 is the inverse of A.

kshum ENGG2013 27

Page 28: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

A convenient fact

• To check that a matrix B is the inverse of A, it is sufficient to check either 1. BA = I, or2. AB = I.

• It can be proved that (1) implies (2), and (2) implies (1).– The details is left as exercise.

kshum ENGG2013 28

Page 29: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

GAUSS-JORDAN ELIMINATION

kshum ENGG2013 29

Page 30: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Row operation using matrix

• Recall that there are three kind of elementary row operations1. Row exchange2. Multiply a row by a non-zero constant3. Replace a row by the sum of itself and a

constant multiple of another row.

• We can perform elementary row operation by matrix multiplication (from the left).

• All three kinds of operation are invertible.kshum ENGG2013 30

Page 31: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Row exchange

• Example: exchange row 2 and row 3

Multiply the same matrix from the left again, we get back the original matrix.

kshum ENGG2013 31

Page 32: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Multiply a row by a constant

• Multiply the first row by -1.

Multiply the same matrix from the left again, we get back the original matrix.

kshum ENGG2013 32

Page 33: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Row replacement

• Add the first row to the second row

Multiply by another matrix from the left to undo

kshum ENGG2013 33

Page 34: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Elementary matrix (I)• Three types of elementary matrices

1. Exchange row i and row j

kshum ENGG2013 34

Row i

Row j

Col

.

jCol

.

i

Page 35: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Elementary matrix (II)2. Multiply row i by m

kshum ENGG2013 35

Row i

Col

.

i

Page 36: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Elementary matrix (III)3. Add s times row i to row j

kshum ENGG2013 36

Row i

Row j

Col

.

jCol

.

i

Page 37: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Row reduction

• A series of row reductions is the same as multiplying from the left a series of elementary matrices.

kshum ENGG2013 37

E1, E2, E3, … are elementary matrices.

Page 38: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

If we can row reduce to identity

• Then A is non-singular, or invertible.

kshum ENGG2013 38

(Matrixmultiplication isassociative)

Page 39: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Gauss-Jordan elimination

• It is convenient to append an identity matrix to the right

• We can interpret it asIf we can row reduce A to the identity by a series of

row operationsthen we can apply the same series of row operations to I and obtain the inverse of A.

kshum ENGG2013 39

Page 40: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Algorithm

• Input: an nn matrix A.• Create an n 2n matrix M

– The left half is A– The right half is In

• Try to reduce the expanded matrix M such that the left half is equal to In.

• If succeed, the right half of M is the inverse of A.• If you cannot reduce the left half of M to , then A

is not invertible, a.k.a. singular.

kshum ENGG2013 40

Page 41: ENGG2013 Unit 7 Non-singular matrix and Gauss-Jordan elimination

Example

• Find the inverse of

1. Create a 36 matrix 2. After some row reductions

we get

• Answer: kshum ENGG2013 41