guc - spring 2012 1math.guc.edu.eg/math201/lectures/lec 4/lec 4.pdf · guc - spring 2012 22 example...

45
GUC - Spring 2012 1

Upload: others

Post on 16-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 1

Page 2: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 2

Lecture 4Linear Algebra ( I )

Matrices & Determinants

Page 3: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 3

• To understand the concept of matrices consider the following case:

• An inventory of T-shirts for one department of a large store.

• The T-shirt comes in three different sizes and five colors,

• and each evening, the department’s supervisor prepares an inventory report for management.

• The supervisor can use the following form of report .

Page 4: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 4

This form is called a matrix form

Page 5: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 5

Definition

• A matrix is a rectangular array of elements

• arranged in a horizontal rows

• and vertical columns.

Page 6: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 6

For Example

• The matrix L has 3 rows and 2 columns; • so it is said to have order (3 × 2). • M has order (3 × 3),• The entries of a matrix are called elements

Page 7: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 7

Square Matrix

• A matrix is square if it has the same number of rows as columns.

• E.g.

Page 8: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 8

Column Matrix

• a column matrix consists only of a single column.

• E.g.

Page 9: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 9

Row Matrix

• a row matrix consists only of a single row.

• E.g. [ ]501 −

Page 10: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 10

Diagonal Matrix

• Diagonal matrix is the matrix such that all the off-diagonal element are zero.

• E.g.

Page 11: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 11

Equal Matrices

• Two matrices are equal if they have the same order and if their corresponding elements are equal.

Page 12: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 12

Sum of two Matrices

• The sum of two matrices of the same order is a matrix obtained by adding together the corresponding elements of the original two matrices.

Page 13: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 13

Example 1

Page 14: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 14

Example 2

• The following matrices can not be added together.

Page 15: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 15

Theorem 1

• If matrices A, B, and C all have the same order, then

• (a) the commutative law of addition holds; • that is, A + B = B + A

• (b) the associative law of addition holds; • that is, A + (B + C) = (A + B) + C.

Page 16: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 16

Scalar Multiplication

• The product of a scalar t by a matrix A is the matrix obtained by multiplying every element of A by t.

Page 17: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 17

Example 3

Page 18: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 18

Example 4

• Find 5A − ½ B if,

Page 19: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 19

Example 4_ Solution

Page 20: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 20

Matrix Multiplication

• The product of two matrices of two matrices AB is defined:

• if the number of columns of A equals the number of rows of B.

Page 21: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 21

Matrix Multiplication

• The result will be a matrix having the same number of rows as A and the same number of columns as B

Page 22: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 22

Example 5

• Consider the two matrices

• Since A is 2×2 and B is 2×3, then• the product AB is defined, • But the product BA is not.

Page 23: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 23

Matrix Multiplication

• In particular, let C be the 2 × 3 matrix representing the product AB.

• Thus, C has the form

Page 24: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 24

• The value of c11is computed by• multiplying each element of row

number 1 of A• by the corresponding element of column

number 1 in B, • and then adding up the products.• That is c11 = (1)(4) + (2)(-1) = 2.

Page 25: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 25

• The value of c12 is computed by• adding up the products resulting from

• multiplying each element in row number 1 of A• by the corresponding element of column

number 2 of B.

• Thus, c12 = (1)(5) + (2)(0) = 5

Page 26: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 26

In general

• the value of cIJ is computed by

• adding up the products resulting from•• multiplying each element in row number I of A

• by the corresponding element of column number J of B

Page 27: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 27

Page 28: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 28

Example 6

• Find the following (If defined)• AB • BA• Where,

Page 29: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 29

AB• Since the number of columns of A equals

• the number of rows of B which is 3

• then AB is defined and

• It will be a 2X3 Matrix • (number of rows of A and columns of B)

Page 30: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 30

AB

Page 31: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 31

BA

• The number of columns of B is 3,

• while the number of rows of A is 2.

• This implies that BA is not defined.

Page 32: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 32

Practice Problem

• Given,

Page 33: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 33

Practice Problem• Find (if defined),

• A + B

• 4A − 2C

• DE

• EB

Page 34: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 34

Determinants

• Determinants are defined only for square matrices.

• we use det(A) or |A| to designate the determinant of A.

• For Example

• which is defined as the scalar ad − bc

Page 35: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 35

Example

• If

• Then

Page 36: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 36

Minor of a Matrix

• A minor of a matrix A is the determinant of any square submatrix of A.

Page 37: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 37

Cofactor of the element aIJ

• If A = [aIJ] is a square matrix, • then the cofactor of the element aiJ in a

square matrix A • is the product of (−1)i+j with the minor

obtained from A by deleting its ith row and jth column

Page 38: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 38

Cofactor of the element a21

• To find the cofactor of the element 4 in the matrix A, we note that

• “4” appears in the row number 2 ( i = 2)

• and the column number 1 ( j = 1),

• hence (−1)i+j = (−1)3 = −1.

Page 39: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 39

• The submatrix of A obtained by deleting the second element and first column is

• which has a determinant equal to (2)(9)−(3)(8) = −6.

• The cofactor of 4 is (−1)(−6) = 6.

Page 40: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 40

How to find the determinant of any square matrix

• Step 1. Pick any one row or any one column of the matrix.

• Step 2. Calculate the cofactor of each element in the row or column selected.

• Step 3. Multiply each element in the selected row (or column) by its cofactor

• Step 4. Sum the results.

Page 41: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 41

Example

• Find det(A) for

Page 42: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 42

Solution

= 3(8 − (−6)) + 5(−1)(−4 − 3) + 0 = 77

Page 43: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 43

Example

• Find det(A) for

Page 44: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 44

Solution• Using the first row and considering the

periodicity of the sign rule, we get

Page 45: GUC - Spring 2012 1math.guc.edu.eg/math201/Lectures/Lec 4/Lec 4.pdf · GUC - Spring 2012 22 Example 5 • Consider the two matrices • Since A is 2×2 and B is 2×3, then • the

GUC - Spring 2012 45

A Photo to Respect