Lecture 7

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

ENGR-1100 Introduction to

Engineering Analysis

Lecture 7
Lecture outline
• Matrix and Matrix
operations
• Rules of matrix
arithmetic
• Determinants
Definition: A matrix is a
rectangular array of
numbers

2 2 2 2 
-2 0 -2 0 sin(2)
-1 -1 -1 -1 e

2 2 

The size of the matrix m x n. Where m the number


of rows and n the number of columns.
Capital letters denote matrices
Lower case letters denote numerical quantities

2 2
A= -2 0 C= 2 2 
-1 -1

In a square matrix m = n
a11 a12….… a1n
A= a21 a22….… a2n a11, a22….… ann are on the main diagonal

: : :
an1 an2….… ann
Definition 1: equal matrices
• Matrix are said to be equal if they
have: (i) the same size, and (ii) the
corresponding entries in the two
matrices are equal.
2 2 1 2 2 2 1
A= -2 0 B= -2 0 C= -2 0 2
-1 -1 3 -1 -1 -1 2

A=B; B=C; A=C


Definition 2: sum of matrices
• If A and B are any two matrices of the same size, then the
sum A+B is the matrix obtained by adding together the
corresponding entries in the two matrices. Matrices of
different sizes can’t be added.

2 2 1 2 2 2 1
A= -2 0 B= -2 0 C= -2 0 2
-1 -1 3 -1 -1 -1 2

3 4
A+C and B+C are A+B= -4 0
undefined
2 -2
Definition 3: matrix scalar product
• If A is any matrix and c any scalar, then the product cA is
the matrix obtained by multiplying each entry of A by c.

2 2 4 4
A= -2 0 2A= -4 0
-1 -1 -2 -2

-2 -2
(-1)A=-A= 2 0
1 1
Definition 4: Product of two matrices
4 1 4 3
1 2 4
A= B= 0 -1 3 1
2 6 0
2 7 5 2

A x B =?
4 1 4 3
1 2 4 =
2 6 0 0 -1 3 1 26

2 7 5 2

(2x4)+(6x3)+(0x5)=26

4 1 4 3 13
1 2 4 =
2 6 0 0 -1 3 1 26

2 7 5 2

(1x3)+(2x1)+(4x2)=13
Class assignment 1
complete the product computation

4 1 4 3 13
1 2 4 =
2 6 0 0 -1 3 1 26

2 7 5 2
Class assignment 1 Solution

4 1 4 3 12 27 30 13
1 2 4 =
2 6 0 0 -1 3 1 8 -4 26 12

2 7 5 2

c1,1  1x 4  2 x 0  4 x 2  4  0  8  12, c 2,1  2 x 4  6 x 0  0 x 2  8  0  0  8


c1, 2  1x1  2 x  1  4 x 7  1  2  28  27 c 2,2  2 x1  6 x  1  0 x 2  2  6  0  4
c1,3  1x 4  2 x 3  4 x5  4  6  20  30 c 2,4  2x 3  6 x1  0 x 2  6  6  0  12
The size of a product matrix

A B = AB

mxr rxn mxn

inside

outside
Transpose of a matrix At
a11 a12 a13 a14

A= a21 a22 a23 a24

a31 a32 a33 a34

a11 a21 a31


a12 a22 a32
A= t

a13 a23 a33


a14 a24 a34
Class assignment problem 2 Determine DE

1 5 2 6 1 3
D= -1 0 1 E= -1 1 2
3 2 4 4 1 3
Let F  ED,
f1,1  6x1  1x  1  3x 3  6  1  9  14 f1,2  6x 5  1x 0  3x 2  30  6  36 f1,3  6x 2  1x1  3x 4  12  1  12  25
f 2,1  1x1  1x  1  2 x 3  1  1  6  4 f 2,2  -1x5  1x0  2x2  -5  4  -1 f 2,3  1x 2  1x1  2x 4  2  1  8  7
f3,1  4 x1  1x  1  3x 3  4  1  9  12 f3,2  4x 5  1x 0  3x 2  20  6  26 f3,3  4x 2  1x1  3x 4  8  1  12  21

 14 36 25
DE   4  1 7 
 
 12 26 21
Class assignment problem 3 Determine D+E

1 5 2 6 1 3
D= -1 0 1 E= -1 1 2
3 2 4 4 1 3

 7 6 5

D  E    2 1 3 
 7 3 7 
Rules of matrix arithmetic

-1 0 1 2
A= B=
2 3 3 0

Multiply AB: Multiply BA

-1 -2 3 6
AB= BA=
11 4 -3 0

Then: AB=BA
The following rules of matrix
arithmetic are valid
(assuming that the sizes of the matrices are such
that the indicated operations can be performed )
• (a) A+B=B+A
• (b) A+(B+C)=(A+B)+C
• (c) A(BC)=(AB)C
• (d) A(B±C)=AB±AC
• (e) (B±C)A=BA±CA
• (f) a(B±C)=aB±aC
• (g) (a±b)C=aC±bC
• (h (ab)C=a(bC)
• (i) a(BC)=(aB)C=B(aC)
Identity matrix:
square matrix with 1’s on the main
diagonal and 0’s off the main
diagonal

1 0 0 0
1 0 1 0 0
I2 = I3 = I4 = 0 1 0 0
0 1 0 1 0
0 0 1 0 0 1 0
0 0 0 1

If A is an mxn matrix, then:


AIn=A and ImA=A
Why study determinants?
• They have important applications to system of
linear equations and can be used to produce
formula for the inverse of an invertible matrix.

• The determinant of a square matrix A is


denoted by det(A) or |A|. If A is 1x1 matrix
A=[a11]
Then: det(A)= a11
For example A=[-7]
det (A)=det(-7)=-7
Determinant of a 2x2 matrix
If A is a 2x2
matrix a11 a12
A=
a21 a22

Then we define
a11 a12
det(A)= = det(A)= a11a22 -a12a21
a21 a22

a11 a12
a21 a22
Example 1
5 4
A=
3 2
Then we define
5 4
det(A)= = det(A)= 5X2-4X3=-2
3 2

5 4
3 2
Duplicate column method – for 3x3

a11 a12 a13 a11 a12


a21 a22 a23 a21 a22
a31 a32 a33 a31 a32
1 5 -3 1 5
Example det(A)= 1 0 2 1 0 =0+30+3-0-(-2)-10=25
3 -1 2 3 -1
Class assignment 4

• Let -1 2 3
A= 4 1 -6
-3 5 2

• Find det(A) using the duplicate column method.


Class assignment 4 Solution

-1 2 3
A= 4 1 -6
-3 5 2

1 2 3 -1 2
A 4 1 6 4 1     1x1x 2  2 x  6 x  3  3x 4x 5   3x1x  3  1x  6 x 5  2 x 4 x 2  
3 5 2 -3 5
   2  36  60    9  30  16    94   37   57
Inverse of a 2x2 matrix
If A is a 2x2
matrix a11 a12
A=
a21 a22

Then we define
a22 -a12
Inv(A)= A-1= / det(A)
-a21 a11
Example 2
5 4
A=
3 2
Then we define
5 4
det(A)= = det(A)= 5X2-4X3=-2
3 2

2 -4
Inv(A)= / -2
-3 5

-1 2
A-1=
3/2 -5/2
Class assignment 5

• Let A be an invertible matrix whose inverse is:

 3 4
 5 6
 
• Find the matrix A.
Class assignment 5 Solution

 3 4
A 
-1
 , det(A -1
)    3x 6    4 x 5   18   20   2
 5 6
 6  4
 5 3 
   3 2 
A• Find the matrix   A. 
2  5 / 2  3 / 2 

You might also like