0% found this document useful (0 votes)
13 views107 pages

Matrices

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views107 pages

Matrices

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 107

MATRICES AND MATRIX OPERATIONS

ELECTRONIC VERSION OF LECTURE

MATRICES AND MATRIX OPERATIONS 1 / 107


OUTLINE
1 MODELLING REAL-WORLD DATA WITH MATRICES
2 MATRICES
3 ELEMENTARY ROW OPERATIONS
4 RANK OF A MATRIX
5 OPERATIONS ON MATRICES
6 INVERSE OF A MATRIX
7 LESLIE MODEL
8 MARKOV CHAIN
9 LEONTIEF INPUT-OUTPUT MODELS
10 CRYTOGRAPLY
11 GRAPH THEORY
12 MATL AB
MATRICES AND MATRIX OPERATIONS 2 / 107
Modelling Real-World Data with Matrices

PREMIER LEAGUE 2012-2013

Team Won Draw Lost


Man. Utd 28 5 5
Man. City 23 9 6
Chelsea 22 9 7
Arsenal 21 10 7
Tottenham 21 9 8
Find the number of points each team scored if a
team scores 3 points for winner, 0 point for loser, and
1 point for draw match.

MATRICES AND MATRIX OPERATIONS 3 / 107


Modelling Real-World Data with Matrices

TRAVEL

Did you ever go on a vacation and realize that you


forgot to pack something that you needed?
Sometimes purchasing those items while travelling
can be expensive. The average cost of some items
bought in various cities is given below

MATRICES AND MATRIX OPERATIONS 4 / 107


Modelling Real-World Data with Matrices

To represent data using a matrix, choose which


category will be represented by the columns and
which will be represented by the rows. Let’s use the
columns to represent the prices in each city and the
rows to represent the prices of each item.
At l ant a L A Mexi co Tok yo
Film 4.03 4.21 3.97 7.08
Pain reliever 6.78 7.41 7.43 36.57
Blow dryer 18.98 20.49 32.25 63.71

MATRICES AND MATRIX OPERATIONS 5 / 107


Matrices Definition

DEFINITION 2.1
A matrix A with size m × n is a rectangular array of
numbers, which contains m rows and n columns.
 
a 11 ... a1 j ... a 1n
 .. ... .. ... ..
 . . .


 
 ai 1
A= ... ai j ... ai n 
 .. ... .. ... ..

 . . .


a m1 . . . a m j . . . a mn

The numbers ai j are called the entries.

MATRICES AND MATRIX OPERATIONS 6 / 107


Matrices Row vector, column vector

DEFINITION 2.2
 
a1 j
 a 
 2j 
A matrix with only one column  ..  is called a
 . 
an j
column vector. ¡ ¢
A matrix with only one row ai 1 ai 2 . . . ai n is
called a row vector.

MATRICES AND MATRIX OPERATIONS 7 / 107


Matrices Row vector, column vector

RELATION BETWEEN MATRIX AND ITS ROW VECTORS,


COLUMN VECTORS

¡ ¢
If A i ∗ = ai 1 ai 2 . . . ai n is the i −th row of matrix A ,
 
a1 j
 a 
 2j 
1 É i É m, and A ∗ j =  ..  is the j −th column if
 . 
am j
matrix A , 1 É j É n then
 
A 1∗
 A  ¡
 2∗  ¢
A =  ..  = A ∗1 A ∗2 . . . A ∗n
 . 
A m∗
MATRICES AND MATRIX OPERATIONS 8 / 107
Matrices Row vector, column vector

EXAMPLE 2.1
µ ¶
1 −4 5
Matrix A = consists of:
0 3 −2 2×3
¡ ¢ ¡ ¢
2 row vectors 1 −4 5 , 0 3 −2
µ ¶ µ ¶ µ ¶
1 −4 5
and 3 column vectors , ,
0 3 −2

MATRICES AND MATRIX OPERATIONS 9 / 107


Matrices Zero Matrices

ZERO MATRICES

DEFINITION 2.3
A matrix whose entries are all zero is called a zero
matrix, that is ai j = 0, ∀i , j.

EXAMPLE 2.2
µ ¶
0 0 0
A= is the zero matrix of order 2 × 3.
0 0 0

MATRICES AND MATRIX OPERATIONS 10 / 107


Matrices Square matrix

DEFINITION 2.4
A matrix A with n rows and n columns is called a
square matrix of order n
 
a 11 . . . a 1i . . . a 1n
.. ... .. ... .. 
. . . 


 
A= ai 1 . . . ai i . . . ai n 
.
.. ... .. . . . ... 

. .

 
a n1 . . . a ni . . . a nn

The entries a11 , a22 , . . . , ann are said to be on the main


diagonal of A .

MATRICES AND MATRIX OPERATIONS 11 / 107


Matrices Square matrix

EXAMPLE 2.3
 
1 2 3
A =  0 −3 −2  is the square matrix of order 3. The
 
5 4 −5
entries on the main diagonal of A are 1, −3, −5

MATRICES AND MATRIX OPERATIONS 12 / 107


Matrices Identity Matrices

IDENTITY MATRICES

DEFINITION 2.5
 
1 0 ... 0
 0 1 ... 0
A square matrix I =  .. .. . . , with 10 s on the
 
 . . . .. 
. 
0 0 ... 1
main diagonal and zeros elsewhere, i.e.
(a i i = 1, i = 1, ..n; a i j = 0, ∀i 6= j ) is called an identity
matrix of order n and is denoted by I or I n

MATRICES AND MATRIX OPERATIONS 13 / 107


Matrices Identity Matrices

EXAMPLE 2.4
 
1 0 0
I =  0 1 0  is the identity matrix of order 3.
 
0 0 1

MATRICES AND MATRIX OPERATIONS 14 / 107


Matrices Transpose of a Matrix

TRANSPOSE OF A MATRIX

DEFINITION 2.6
If A = (ai j )m×n is any m × n matrix, then the transpose
of A , denoted by A T = (a j i )n×m is defined to be the
n × m matrix that results by interchanging the rows
and columns of A; that is,
   
a 11 a 12 ... a 1n a 11 a 21 . . . a m1
 a
 21 a 22 ... a 2n  T  a 12 a 22 . . . a m2 
 
A =  .. , A =  ..

 . .. . . . ...  .. . . . ... 
.   . . 
a m1 a m2 . . . a mn a 1n a 2n . . . a mn

MATRICES AND MATRIX OPERATIONS 15 / 107


Matrices Transpose of a Matrix

EXAMPLE 2.5
If µ ¶
1 3 5
A=
2 4 6
then  
1 2
⇒ AT =  3 4 
 
5 6

MATRICES AND MATRIX OPERATIONS 16 / 107


Elementary Row Operations

SOLVING A SYSTEM OF LINEAR EQUATIONS

Which system is easier to solve algebraically?


 
 x − 2y + 3z = 9
  x − 2y + 3z = 9

−x + 3y = −4 or y + 3z = 5
 
 2x − 5y + 5z = 17  z = 2

The system on the right is clearly easier to solve. This


system is in row-echelon form, which means that it
follows a stair-step pattern and has leading
coefficients of 1.

MATRICES AND MATRIX OPERATIONS 17 / 107


Elementary Row Operations Definition

DEFINITION 3.1
Elementary Row Operations on matrix A are the
following operations:
1
Interchange 2 rows r i ↔ r j
2
Multiply a row through by a nonzero constant:
r i → λr i , (λ 6= 0).
3
Add a constant times one row to another:
r i → r i + λ.r j , ∀λ

MATRICES AND MATRIX OPERATIONS 18 / 107


Elementary Row Operations Definition

USING ELEMENTARY ROW OPERATIONS TO SOLVE A


SYSTEM

  
 x − 2y + 3z = 9
 1 −2 3 9
−x + 3y = −4  −1 3 0 −4 
 

 2x − 5y + 5z = 17 2 −5 5 17
Add the first row to the
Add the first equation to
second row to produce a
the second equation.
new second row.

MATRICES AND MATRIX OPERATIONS 19 / 107


Elementary Row Operations Definition

USING ELEMENTARY ROW OPERATIONS TO SOLVE A


SYSTEM

  
 x − 2y + 3z = 9
 1 −2 3 9
y + 3z = 5 0 1 3 5 
 

 2x − 5y + 5z = 17 2 −5 5 17
Add −2 times the first
Add −2 times the first
row to the third row
equation to the third
to produce a new third
equation.
row.

MATRICES AND MATRIX OPERATIONS 20 / 107


Elementary Row Operations Definition

USING ELEMENTARY ROW OPERATIONS TO SOLVE A


SYSTEM

  
 x − 2y + 3z = 9
 1 −2 3 9
y + 3z = 5 0 1 3 5 
 

 −y − z = −1 0 −1 −1 −1
Add the second equa- Add the second row to
tion to the third equa- the third row to produce
tion. a new third row.

MATRICES AND MATRIX OPERATIONS 21 / 107


Elementary Row Operations Definition

USING ELEMENTARY ROW OPERATIONS TO SOLVE A


SYSTEM

  
 x − 2y + 3z = 9
 1 −2 3 9
y + 3z = 5 0 1 3 5
 

 2z = 4 0 0 2 4
Multiply the third row
Multiply the third equa- 1
1 by to produce a new
tion by 2
2 third row.

MATRICES AND MATRIX OPERATIONS 22 / 107


Elementary Row Operations Definition

USING ELEMENTARY ROW OPERATIONS TO SOLVE A


SYSTEM

  
 x − 2y + 3z = 9
 1 −2 3 9
y + 3z = 5 0 1 3 5
 

 z = 2 0 0 1 2
The last matrix is said to
x = 1; y = −1; z = 2
be in row-echelon form

MATRICES AND MATRIX OPERATIONS 23 / 107


Elementary Row Operations Echelon form

DEFINITION 3.2
A matrix is called reduced row-echelon form if it has the
following properties
1 If a row does not consist entirely of zeros, then the first
nonzero number in the row is a 1, which is called a leading 1.
2 If there are any rows that consist entirely of zeros, then they
are grouped together at the bottom of the matrix.
3 In any two successive rows that do not consist entirely of
zeros, the leading 1 in the lower row occurs farther to the
right than the leading 1 in the higher row.
4 Each column that contains a leading 1 has zeros everywhere
else in that column.
DEFINITION 3.3
A matrix that has the first 3 properties is said to be in
row-echelon form.
MATRICES AND MATRIX OPERATIONS 24 / 107
Elementary Row Operations Echelon form

EXAMPLE 3.1
The following matrices are in reduced
 row-echelon
   0  1 −2 0 1
1 0 0 4 1 0 0 0 0 0 1 3 
form:  0 1 0 7  ;  0 1 0  ;  ;
     
0 0 0 0 0
0 0 1 −1 0 0 1

0 0 0 0 0
µ ¶
0 0
.
0 0

MATRICES AND MATRIX OPERATIONS 25 / 107


Elementary Row Operations Echelon form

EXAMPLE 3.2
The
 followingmatrices
 are
 in
 row-echelon form:

1 4 −3 7 1 1 0 0 1 2 6 0
 0 1 6 2  ;  0 1 0  ;  0 0 1 −1 0  .
     
0 0 1 5 0 0 0 0 0 0 0 1

MATRICES AND MATRIX OPERATIONS 26 / 107


Elementary Row Operations Echelon form

EXAMPLE 3.3
Transform the following matrix to row-echelon form
and reduced row-echelon form
 
0 0 −2 0 7 12
 2 4 −10 6 12 28 
 
2 4 −5 6 −5 −1

MATRICES AND MATRIX OPERATIONS 27 / 107


Elementary Row Operations Echelon form

Step 1. Locate the leftmost column that does not


consist entirely of zeros.
 
0 0 −2 0 7 12
 2 4 −10 6 12 28 
 
2 4 −5 6 −5 −1

Leftmost nonzero column.

MATRICES AND MATRIX OPERATIONS 28 / 107


Elementary Row Operations Echelon form

Step 2. Interchange the top row with another row, if


necessary, to bring a nonzero entry to the top of the
column found in Step 1.
 
2 4 −10 6 12 28
 0 0 −2 0 7 12 
 
2 4 −5 6 −5 −1

The first and second rows in the preceding matrix


were interchanged.

MATRICES AND MATRIX OPERATIONS 29 / 107


Elementary Row Operations Echelon form

Step 3. If the entry that is now at the top of the


column found in Step 1 is a , multiply the first row by
1
in order to introduce a leading 1.
a
 
1 2 −5 3 6 14
 0 0 −2 0 7 12 
 
2 4 −5 6 −5 −1

The first row of the preceding matrix was multiplied


1
by
2

MATRICES AND MATRIX OPERATIONS 30 / 107


Elementary Row Operations Echelon form

Step 4. Add suitable multiples of the top row to the


rows below so that all entries below the leading 1
become zeros.
 
1 2 −5 3 6 14
 0 0 −2 0 7 12 
 
0 0 5 0 −17 −29

(−2) times the first row of the preceding matrix was


added to the third row.

MATRICES AND MATRIX OPERATIONS 31 / 107


Elementary Row Operations Echelon form

Step 5. Now cover the top row in the matrix and


begin again with Step 1 applied to the submatrix that
remains. Continue in this way until the entire matrix
is
 in row-echelon form. 
1 2 −5 3 6 14 1
 r 2 →− 2 r 2
 0 0 −2 0 7 12  −−−−−→

0 0 5 0 −17 −29
 
1 2 −5 3 6 14
 0 0 1 0 −7/2 −6 
 
0 0 5 0 −17 −29

MATRICES AND MATRIX OPERATIONS 32 / 107


Elementary Row Operations Echelon form

 
1 2 −5 3 6 14
 r 3 →r 3 −5r 2
 0 0 1 0 −7/2 −6  −−−−−−−→

0 0 5 0 −17 −29
 
1 2 −5 3 6 14
 r 3 →2r 3
 0 0 1 0 −7/2 −6  −−−−→

0 0 0 0 1/2 1
 
1 2 −5 3 6 14
 0 0 1 0 −7/2 −6 
 
0 0 0 0 1 2
The procedure produces a row-echelon form is
called Gaussian Elimination

MATRICES AND MATRIX OPERATIONS 33 / 107


Elementary Row Operations Echelon form

Step 6. Beginning with the last nonzero row and


working upward, add suitable multiples of each row
to the rows 
above to introduce zeros
 above the
1 2 −5 3 6 14 r 2 →r 2 +r 3 ×7/2
0  r 1 →r 1 +r 3 ×(−6)
leading 1 s.  0 0 1 0 −7/2 −6  −−−−−−−−−→

0 0 0 0 1 2
 
1 2 −5 3 0 2
0 0 1 0 0 1
 
0 0 0 0 1 2

MATRICES AND MATRIX OPERATIONS 34 / 107


Elementary Row Operations Echelon form

   
1 2 −5 3 0 2 1 2 0 3 0 7
 r 1 →r 1 +r 2 ×5 
 0 0 1 0 0 1  −−−−−−−−→  0 0 1 0 0 1 
 
0 0 0 0 1 2 0 0 0 0 1 2
The last matrix is in reduced row echelon form. The
procedure described for reducing a matrix to
reduced row echelon form is called Gauss-Jordan
elimination.

MATRICES AND MATRIX OPERATIONS 35 / 107


Rank of a matrix Definition

RANK OF A MATRIX

DEFINITION 4.1
We denote A −→ B to show that B is the matrix that
results from A by performing some of the Elementary
Row Operations.

DEFINITION 4.2
If A m×n −→ B m×n , where B is in row-echelon form, then
rank of the matrix A is the number of leading 1’s of
matrix B and is denoted by r (A).

MATRICES AND MATRIX OPERATIONS 36 / 107


Rank of a matrix Properties of Rank of a matrix

PROPERTIES OF RANK OF A MATRIX

1
r (A) = 0 ⇔ A = 0
2
0 É r (A m×n ) É min{m, n}
Elementary Row Operations
3
If A −−−−−−−−−−−−−−−−−−−−−−−−−−−→ B then

r (B ) = r (A).

4
r (A) = r (A T ).

MATRICES AND MATRIX OPERATIONS 37 / 107


Rank of a matrix Properties of Rank of a matrix

EXAMPLE 4.1
 
0 2 −4
For matrix A =  −1 −4 5  , transform A to
 
3 1 7
row-echelon form using elementary row operations.
Determine the rank of the matrix A.

MATRICES AND MATRIX OPERATIONS 38 / 107


Rank of a matrix Properties of Rank of a matrix

   
0 2 −4 r 2 →−r 2 1 4 −5
 r 2 ↔r 1 
 −1 −4 5  −−−−−→  0 2 −4 
 
3 1 7 3 1 7
 
r 3 →r 3 −3r 1 1 4 −5
r 2 → 12 r 2  r 3 →r 3 +11r 2
−−−−−−−→  0 1 −2  −−−−−−−→

0 −11 22
 
1 4 −5
 0 1 −2  . Rank of matrix A is 2.
 
0 0 0

MATRICES AND MATRIX OPERATIONS 39 / 107


Operations on Matrices Equality of Matrices

DEFINITION 5.1
Two matrices A and B are defined to be equal if they
have the same size and their corresponding entries
are equal, i.e.

A = (a i j )m×n = B = (b i j )m×n ⇔ a i j = b i j , ∀i , j (1)

MATRICES AND MATRIX OPERATIONS 40 / 107


Operations on Matrices Equality of Matrices

EXAMPLE 5.1
Find real numbers x, y, z, t such that the following 2
matrices are equal
µ ¶ µ ¶
x + y 2z + t 3 7
=
x −y z −t 1 5

 

 x+y = 3 
 x = 2

 x−y 
= 1  y = 1


 2z + t = 7 
 z = 4
 
z −t = 5 t = −1
 

MATRICES AND MATRIX OPERATIONS 41 / 107


Operations on Matrices Scalar Multiples

DEFINITION 5.2
If A = (ai j )m×n is any matrix and α is any scalar, then
the product αA obtained by the multiplying each
entry of the matrix A by α. The matrix αA is said to be
a scalar multiple of A , i.e.

αA = (α.a i j )m×n (2)

MATRICES AND MATRIX OPERATIONS 42 / 107


Operations on Matrices Scalar Multiples

PROPERTIES
1
1.A = A
2
0.A = 0,
3
α.0 = 0, ∀α ∈ R, 0 is the zero matrix.
4
α(βA) = (αβ)A, ∀α, β ∈ R.

MATRICES AND MATRIX OPERATIONS 43 / 107


Operations on Matrices Scalar Multiples

EXAMPLE 5.2
µ ¶
1 2 3
If A = then
5 4 −5
µ ¶ µ ¶
3×1 3×2 3×3 3 6 9
3A = =
3 × 5 3 × 4 3 × (−5) 15 12 −15

MATRICES AND MATRIX OPERATIONS 44 / 107


Operations on Matrices Addition of Matrices

DEFINITION 5.3
If A and B are matrices of the same size, then the sum
A + B is the matrix obtained by adding the entries of B
to the corresponding entries of A.

IN ORDER TO ADD 2 MATRICES A AND B


1
A and B must have the same size m × n
2
A + B = (a i j + b i j )m×n

MATRICES AND MATRIX OPERATIONS 45 / 107


Operations on Matrices Addition of Matrices

PROPERTIES

IF A, B,C ARE MATRICES WITH THE SAME SIZE, THEN


1
A +B = B + A
2
A + (B +C ) = (A + B ) +C
3
α.(A + B ) = α.A + α.B, ∀α ∈ R.
4
(α + β).A = α.A + β.A, ∀α, β ∈ R.
5
A +0 = 0+ A = A

MATRICES AND MATRIX OPERATIONS 46 / 107


Operations on Matrices Addition of Matrices

EXAMPLE 5.3
µ ¶ µ ¶
1 4 3 3 1 1
+ =
8 −3 2 4 −1 0
µ ¶ µ ¶
1+3 4+1 3+1 4 5 4
= =
8 + 4 −3 − 1 2 + 0 12 −4 2

MATRICES AND MATRIX OPERATIONS 47 / 107


Operations on Matrices Matrix multiplication

PREMIER LEAGUE 2012-2013

Team Won Draw Lost


Man. Utd 28 5 5
Man. City 23 9 6
Chelsea 22 9 7
Arsenal 21 10 7
Tottenham 21 9 8
Find the number of points each team scored if a
team scores 3 points for winner, 0 point for loser, and
1 point for draw match.

MATRICES AND MATRIX OPERATIONS 48 / 107


Operations on Matrices Matrix multiplication

   
28 5 5   28 × 3 + 5 × 1 + 5 × 0

 23 9 6 
 3  23 × 3 + 9 × 1 + 6 × 0
 

22 9 7 . 1  =  22 × 3 + 9 × 1 + 7 × 0 =
     

   
 21 10 7  0  21 × 3 + 10 × 1 + 7 × 0 
21 9 8 21 × 3 + 9 × 1 + 8 × 0
 
89 (Man. Utd)

 78 (Man. City)  
= 75 (Chelsea) 
 
(Arsenal) 
 
 73
72 (Tottenham)

MATRICES AND MATRIX OPERATIONS 49 / 107


Operations on Matrices Matrix multiplication

HISTORICAL NOTE

The concept of matrix multiplication is due to the


German mathematician Gotthold Eisenstein, who
introduced the idea around 1844 to simplify the
process of making substitutions in linear system.
Eisenstein was a pupil of Gauss, who ranked him as
the equal of Isaac Newton and Archimedes. However,
Eisenstein, suffering from bad health his entire life,
died at age 30, so his potential was never realized.

MATRICES AND MATRIX OPERATIONS 50 / 107


Operations on Matrices Matrix multiplication

MATRICES AND MATRIX OPERATIONS 51 / 107


Operations on Matrices Matrix multiplication

MULTIPLICATION OF TWO MATRICES

DEFINITION 5.4
If A = (ai j )m×n ∈ M
  m×n
(K ), B = (b i j )n×p ∈ M n×p (K ).
a 11 a 12 ... a 1n
 . .. .. ..   
 . b 11 b 12 . . . b 1 j . . . b 1p
 . . . .


   . .. .. .. .. .. 
 ..
 ai 1 ai 2 ... ai n  . =
. . . . . 

 
 . .. .. .. 
 . b n1 b n2 . . . b n j . . . b np n×p
 . . . . 

a m1 a m2 . . . a mn m×n
 
c 11 c 12 . . . c1 j . . . c 1p
 . .. .. .. .. .. 
 .
 . . . . . . 

 
 ci 1
 ci 2 ... ci j . . . ci p   then the product AB is the matrix
 . .. .. .. .. .. 
 .
 . . . . . . 

c m1 c m2 . . . c m j . . . c mp m×p
n
C = A.B = (c i j )m×p whose entries are defined by c i j =
P
a i k .b k j , i = 1..m; j = 1..p
k=1

MATRICES AND MATRIX OPERATIONS 52 / 107


Operations on Matrices Matrix multiplication

REMARK

IN ORDER TO FORM THE PRODUCT AB

MATRICES AND MATRIX OPERATIONS 53 / 107


Operations on Matrices Matrix multiplication

EXAMPLE 5.4
Find product A.B where
 
1
¡ ¢  2 
A = 2 −1 4 5 , B =
 
1×4 0

 
−1 4×1

 
1
¢  2 
¡ 
A.B = 2 −1 4 5 .  =
 0 
−1
³ ´ ³ ´
2 × 1 + (−1) × 2 + 4 × 0 + 5 × (−1) = − 5
MATRICES AND MATRIX OPERATIONS
1×1 54 / 107
Operations on Matrices Matrix multiplication

EXAMPLE 5.5
Find product C = A.B where
 
µ ¶ 2 1 −1
2 3 1
A= , B =  1 3 −2  .
 
−1 0 1 2×3 0 2 1
3×3

 
µ 2 1 −1 ¶
2 3 1 
.  1 3 −2  =

−1 0 1
0 2 1
 
2
¡ ¢  
c 11 = 2 3 1 .  1  = 2 × 2 + 3 × 1 + 1 × 0 = 7
0
MATRICES AND MATRIX OPERATIONS 55 / 107
Operations on Matrices Matrix multiplication

 
1
¡ ¢  
c 12 = 2 3 1 .  3  = 2 × 1 + 3 × 3 + 1 × 2 = 13
2
 
−1
¡ ¢ 
c 13 = 2 3 1 .  −2  = 2 × (−1) + 3 × (−2) + 1 × 1 = −7

1
 
2
¡ ¢  
c 21 = −1 0 1 .  1  = (−1) × 2 + 0 × 1 + 1 × 0 = −2
0
 
1
¡ ¢  
c 22 = −1 0 1 .  3  = (−1) × 1 + 0 × 3 + 1 × 2 = 1
2

MATRICES AND MATRIX OPERATIONS 56 / 107


Operations on Matrices Matrix multiplication

 
−1
¡ ¢ 
c 23 = −1 0 1 .  −2  =

1
= (−1) × (−1) + 0 × (−2) + 1 × 1 = 2

Therefore,
µ ¶
7 13 −7
C = A.B = .
−2 1 2

MATRICES AND MATRIX OPERATIONS 57 / 107


Operations on Matrices Matrix multiplication

PROPERTIES
1
(A.B ).C = A.(B.C ) = A.B.C
2
A.(B +C ) = A.B + A.C .
3
(B +C ).A = B.A +C .A
4
λ(AB ) = (λA).B = A.(λB ), λ ∈ R.

MATRICES AND MATRIX OPERATIONS 58 / 107


Operations on Matrices Matrix Polynomials

DEFINITION 5.5
If A is a square matrix and

p(x) = a 0 + a 1 x + a 2 x 2 + . . . + a m x m

is any polynomial, then we define the matrix p(A) to


be
p(A) = a 0 I + a 1 A + a 2 A 2 + . . . + a m A m (3)

MATRICES AND MATRIX OPERATIONS 59 / 107


Operations on Matrices Matrix Polynomials

EXAMPLE 5.6
· ¸
2 −1 2
Find p(A) for p(x) = x − 2x − 3 and A =
0 3

p(A) = A 2 − 2A − 3I =
· ¸2 · ¸ · ¸ · ¸
−1 2 −1 2 1 0 0 0
= −2 −3 =
0 3 0 3 0 1 0 0

MATRICES AND MATRIX OPERATIONS 60 / 107


Operations on Matrices Elementary Matrix

ELEMENTARY MATRIX

DEFINITION 5.6
A matrix E is called an elementary matrix if it can be
obtained from an identity matrix I by performing a
single elementary row operation.

EXAMPLE 5.7
   
1 0 0 1 0 3
 r 1 →r 1 +r 3 ×3 
 0 1 0  −−−−−−−−→  0 1 0  .
 
0 0 1 0 0 1

MATRICES AND MATRIX OPERATIONS 61 / 107


Operations on Matrices Elementary Matrix

THEOREM 5.1 (ROW OPERATIONS BY MATRIX


MULTIPLICATION)
If the elementary matrix E results from performing a
certain row operation on I m and if A is an m × n
matrix, then the product E A is the matrix that results
when this same row operation is performed on A.

MATRICES AND MATRIX OPERATIONS 62 / 107


Operations on Matrices Elementary Matrix

EXAMPLE 5.8
Consider an 3 × 4 matrix A and elementary row
operation: adding 2 times the first row of matrix A to
the third row. Find the elementary matrix E such that
the product E A is the matrix that results when this
same row operation is performed on A .
r 3 →r 3 +2r 1
A 3×4 −−−−−−−→ B 3×4 ⇔ B 3×4 = E 3×3 .A 3×4
   
1 0 0 1 0 0
 r 3 →r 3 +2r 1 
I 3×3 =  0 1 0  −−−−−−−→  0 1 0  = E 3×3
 
0 0 1 2 0 1

MATRICES AND MATRIX OPERATIONS 63 / 107


Operations on Matrices Elementary Matrix

Suppose
 
a 11 a 12 a 13 a 14
 r 3 →r 3 +2r 1
A =  a 21 a 22 a 23 a 24  −−−−−−−→ B =

a 31 a 32 a 33 a 34
 
a 11 a 12 a 13 a 14
a 21 a 22 a 23 a 24
 
 
a 31 + 2a 11 a 32 + 2a 12 a 33 + 2a 13 a 34 + 2a 14

MATRICES AND MATRIX OPERATIONS 64 / 107


Operations on Matrices Elementary Matrix

   
1 0 0 a 11 a 12 a 13 a 14
E .A =  0 1 0  .  a 21 a 22 a 23 a 24  = B =
   
2 0 1 a 31 a 32 a 33 a 34
 
a 11 a 12 a 13 a 14
a 21 a 22 a 23 a 24
 
 
a 31 + 2a 11 a 32 + 2a 12 a 33 + 2a 13 a 34 + 2a 14

MATRICES AND MATRIX OPERATIONS 65 / 107


Inverse of a Matrix

INVERSE OF A MATRIX

DEFINITION 6.1
If A is a square matrix, and if a matrix B of the same
size can be found such that

B A = AB = I , (4)

then A is said to be invertible (or non-singular) and B


is called an inverse of A and is denoted by A −1 . If no
such matrix B can be found, then A is said to be
singular.

MATRICES AND MATRIX OPERATIONS 66 / 107


Inverse of a Matrix

REMARK

The relationship AB = B A = I is not changed by


interchanging A and B , so if A is invertible and B is
an inverse of A , then it is also true that B is invertible,
and A is an inverse of B . Thus, when

AB = B A = I

we say that A and B are inverses of one another.

MATRICES AND MATRIX OPERATIONS 67 / 107


Inverse of a Matrix

EQUIVALENT STATEMENTS

THEOREM 6.1
If A is an n × n matrix, then the following statements
are equivalent
1
A is invertible
Elementary Row Operations
2
A −−−−−−−−−−−−−−−−−−−−−−−−−−→ I n
3
r (A) = n

MATRICES AND MATRIX OPERATIONS 68 / 107


A method for Inverting Matrices using Elementary Row
Inverse of a Matrix Operations

USING ELEMENTARY ROW OPERATIONS TO FIND


INVERSE OF AN INVERTIBLE MATRIX

INVERSION ALGORITHM
Elementary Row Operations
(A|I ) −−−−−−−−−−−−−−−−−−−−−−−−−−−→ (I |A −1 )

E n .E n−1 . . . . .E 2 E 1 .A = I
⇒ A −1 = E n .E n−1 . . . . .E 2 E 1

MATRICES AND MATRIX OPERATIONS 69 / 107


A method for Inverting Matrices using Elementary Row
Inverse of a Matrix Operations

EXAMPLE 6.1
 
1 2 3
Find the inverse A −1 of A =  2 5 4 
 
3 7 8

 ¯ 
1 2 3 ¯¯ 1 0 0 r 2 →r 2 −2r 1
 r 3 →r 3 −3r 1
(A|I 3 ) =  2 5 4 ¯ 0 1 0  −−−−−−−→
 ¯
¯
3 7 8¯ 0 0 1

MATRICES AND MATRIX OPERATIONS 70 / 107


A method for Inverting Matrices using Elementary Row
Inverse of a Matrix Operations

 ¯ 
1 2 3 ¯¯ 1 0 0 r 1 →r 1 −2r 2
 r 3 →r 3 −r 2
 0 1 −2 ¯ −2 1 0  −−−−−−−→
 ¯
¯
0 1 −1 ¯ −3 0 1
 ¯ 
1 0 7 ¯¯ 5 −2 0 r 1 →r 1 −7r 3
 r 2 →r 2 +2r 3
 0 1 −2 ¯ −2 1 0  −−−−−−−→
 ¯
¯
0 0 1 ¯ −1 −1 1
 ¯ 
1 0 0 ¯¯ 12 5 −7
−1
 0 1 0 ¯ −4 −1 2  = (I 3 |A )
 ¯ 
¯
0 0 1 ¯ −1 −1 1

MATRICES AND MATRIX OPERATIONS 71 / 107


A method for Inverting Matrices using Elementary Row
Inverse of a Matrix Operations

 
12 5 −7
⇒ A −1 =  −4 −1 2 
 
−1 −1 1

MATRICES AND MATRIX OPERATIONS 72 / 107


Leslie model

LESLEI MODEL

EXAMPLE 7.1
A population of rabbits raised in a research
laboratory has the characteristics listed below. (a)
Half of the rabbits survive their first year. Of those,
half survive their second year. The maximum life
span is 3 years. (b) During the first year, the rabbits
produce no offspring. The average number of
offspring is 6 during the second year and 8 during the
third year. The laboratory population now consists of
24 rabbits in the first age class, 24 in the second, and
20 in the third. How many rabbits will be in each age
class in 1 year, 2 years?
MATRICES AND MATRIX OPERATIONS 73 / 107
Leslie model

The current age distribution vector is


 
24 (0 ≤ ag e ≤ 1)
x =  24 (1 ≤ ag e ≤ 2) 
 
20 (2 ≤ ag e ≤ 3)

and the age transition matrix is


 
0 6 8
A =  0.5 0 0 
 
0 0.5 0

MATRICES AND MATRIX OPERATIONS 74 / 107


Leslie model

After 1 year the age distribution vector will be


    
0 6 8 24 304
Ax =  0.5 0 0   24  =  12 
    
0 0.5 0 20 12

After 2 year the age distribution vector will be


    
0 6 8 304 168
A 2 x =  0.5 0 0   12  =  152 
    
0 0.5 0 12 6

MATRICES AND MATRIX OPERATIONS 75 / 107


Markov chain

MARKOV CHAIN

EXAMPLE 8.1
In a city with 1000 householders there are 3
supermarkets A , B and C . At this month, there are
200, 500 and 300 householders that go to the
supermarkets A , B and C , respectively. After each
month, there are 10% of customers of A change to B ,
10% of those change to C ; 7% of customers of B
change to A , 3% of those change to C ; 8.3% of
customers of C change to A , 6.7% of those change to B .
Find the numbers of customers of each supermarket
after 1 month, 2 months.
MATRICES AND MATRIX OPERATIONS 76 / 107
Markov chain

THEOREM 8.1
Let P be the transition matrix of a Markov chain. The
i j -th entry p i(n)
j
of the matrix P n gives the probability
that the Markov chain, starting in state s j , will be in
state s i after n steps.

MATRICES AND MATRIX OPERATIONS 77 / 107


Markov chain

The numbers of customers of A , B and C at this


month  
200
X =  500 
 
300
The transition matrix
 
0.8 0.07 0.83
A =  0.1 0.9 0.067 
 
0.1 0.03 0.85

MATRICES AND MATRIX OPERATIONS 78 / 107


Markov chain

The numbers of customers of each supermarket


after 1 month  
220
AX ≈  490 
 
290
The numbers of customers of each supermarket
after 2 month  
234
2
A X ≈  483 
 
283

MATRICES AND MATRIX OPERATIONS 79 / 107


LEONTIEF INPUT-OUTPUT MODELS

LEONTIEF INPUT-OUTPUT MODELS

Consider an economic system that has n different


industries I 1 , I 2 , ..., I n , each having input needs (raw
materials, utilities, etc.) and an output (finished
product). In producing each unit of output, an
industry may use the outputs of other industries,
including itself. For example, an electric utility uses
outputs from other industries, such as coal and
water, and also uses its own electricity.

MATRICES AND MATRIX OPERATIONS 80 / 107


LEONTIEF INPUT-OUTPUT MODELS

Let di j be the amount of output the j -th industry


needs from the i -th industry to produce one unit of
output per year. The matrix of these coefficients is
the input-output matrix
 
d 11 d 12 . . . d 1n
 d
 21 d 22 . . . d 2n 
D =  ..

 . .. .. 
. ... . 
d n1 d n2 . . . d nn

MATRICES AND MATRIX OPERATIONS 81 / 107


LEONTIEF INPUT-OUTPUT MODELS

EXAMPLE 9.1
Consider a simple economic system consisting of 3
industries: electricity, water, and coal. Production, or
output, of one unit of electricity requires 0.5 unit of
itself, 0.25 unit of water, and 0.25 unit of coal.
Production of one unit of water requires 0.1 unit of
electricity, 0.6 unit of itself, and 0 units of coal.
Production of one unit of coal requires 0.2 unit of
electricity, 0.15 unit of water, and 0.5 unit of itself.
Find the input-output matrix for this system.

MATRICES AND MATRIX OPERATIONS 82 / 107


LEONTIEF INPUT-OUTPUT MODELS

SOLUTION. The column entries show the amounts


each industry requires from the others, and from
itself, to produce one unit of output
 
0.5 0.1 0.2
D =  0.25 0.6 0.15 
 
0.25 0 0.5

The row entries show the amounts each industry


supplies to the others, and to itself, for that industry
to produce one unit of output.

MATRICES AND MATRIX OPERATIONS 83 / 107


LEONTIEF INPUT-OUTPUT MODELS

CLOSED SYSTEM

Let the total output of the i -th industry be denoted


by x i . If the economic system is closed (that is, the
economic system sells its products only to industries
within the system), then the total output of the i -th
industry is

x i = d i 1 x 1 + d i 2 x 2 + ... + d i n x n

MATRICES AND MATRIX OPERATIONS 84 / 107


LEONTIEF INPUT-OUTPUT MODELS

OPEN SYSTEM

If the industries within the system sell products to


non-producing groups (such as governments or
charitable organizations) outside the system, then
system is open and the total output of the ith
industry is

x i = d i 1 x 1 + d i 2 x 2 + ... + d i n x n + e i

where e i represents the external demand for the i -th


industry’s product.

MATRICES AND MATRIX OPERATIONS 85 / 107


LEONTIEF INPUT-OUTPUT MODELS

The collection of total outputs for an open system is





 x 1 = d 11 x 1 + d 12 x 2 + ... + d 1n x n + e 1


x = d x + d x + ... + d x + e
2 21 1 22 2 2n n 2


 ...

x = d x + d x + ... + d x + e

n n1 1 n2 2 nn n n

The matrix form of this system is

X = DX +E,

where X is the output matrix and E is the external


demand matrix.
MATRICES AND MATRIX OPERATIONS 86 / 107
LEONTIEF INPUT-OUTPUT MODELS

EXAMPLE 9.2
An economic system composed of 3 industries has the
input-output matrix
 
0.1 0.43 0
D =  0.15 0 0.37 
 
0.23 0.03 0.02

Find the output matrix X when the external demands


are  
20000
E =  30000 
 
25000

MATRICES AND MATRIX OPERATIONS 87 / 107


LEONTIEF INPUT-OUTPUT MODELS

SOLUTION.

X = D X + E ⇒ (I − D)X = E ⇒ X = (I − D)−1 E .
 
46616
X ≈  51058 
 
38014
To produce the given external demands, the outputs
of the 3 industries must be approximately 46616
units for the industry I, 51058 units for industry II,
and 38014 units for industry III.

MATRICES AND MATRIX OPERATIONS 88 / 107


Crytograply

APPLICATION IN CRYPTOGRAPHY
We need to encrypt the series of characters R U
CRAZY. Choose a rule of cryptography, for ex.,
transform the characters A → Z into the numbers
1 → 26, respectively, the white space is 27:
R U C R A Z Y
18 27 21 27 3 18 1 26 25
Rearrange the series into the matrix with 3 rows:
 
18 27 1
A =  27 3 26 
 
21 18 25
MATRICES AND MATRIX OPERATIONS 89 / 107
Crytograply

Chose a square matrix of order 3: K as the


"symmetric key" and then multiply it to the left of A
 
1 0 1
K = 2 1 1
 

0 0 1
    
1 0 1 18 27 1 39 45 26
⇒ B = K A =  2 1 1   27 3 26  =  63 57 28 
    
0 0 1 21 18 25 21 18 25

MATRICES AND MATRIX OPERATIONS 90 / 107


Crytograply

We have the encrypted series of numbers

R U C R A Z Y
⇒ 18 27 21 27 3 18 1 26 25
⇒ 39 63 21 45 57 18 26 28 25
We can recover A from B by A = K −1 B .

MATRICES AND MATRIX OPERATIONS 91 / 107


Graph theory

GRAPH THEORY

Graph theory investigates the structure, properties,


and algorithms associated with graphs. Graphs have
a number of equivalent representations; one
representation, in particular, is widely used as the
primary definition, a standard which this paper will
also adopt.
A graph, denoted G, is defined as an ordered pair
composed of two distinct sets:
1
A set of vertices, denoted V (G)
2
A set of edges, denoted E (G)

MATRICES AND MATRIX OPERATIONS 92 / 107


Graph theory

The order of a graph G refers to |V (G)| and the size of


a graph G refers to |E (G)|. In other words, order refers
to the number of vertices and size refers to the
number of edges. In order to perform computations
with these graphs, we utilize matrices as an
incredibly valuable, alternative representation. Such
representations include incidence, adjacency,
distance, and Laplacian matrices.

MATRICES AND MATRIX OPERATIONS 93 / 107


Graph theory

ADJACENCY MATRICES

DEFINITION 11.1
For a graph G of order n , the adjacency matrix,
denoted A(G), of graph G is an n by n matrix whose
(i , j )-th entry is determined as follows:
(
1, if vertex v i is adjacent to vertex v j
Ai j =
0, otherwise

Adjacency matrices not only encapsulate the structure


and relationships of a graph, but also provide for an
efficient method of storage and access in a computer.

MATRICES AND MATRIX OPERATIONS 94 / 107


2.3 Eigenvalues and Complete Graphs 2 ADJACENCY MATRICES
Graph theory

Figure 2: Depiction of 2 Paths Between


Figure 1: Graph of Order 8 Vertices 6 and 8

 
0 1 120 101 0 00 1 10 030 0 217 11 13 11 10 4 16 23
 1 0 166611 01010 01 110 00 001 007770 0 666 11 18 13 17 4 9 11 67
13 13 28 13 16 14 13 27
7
6 7 6 7
 60 0 1 0 1 0 1 07 611 17 13 18 4 9 11 67
A(G) = 6 7
60 1 0 1 0 0 0 17 A (G) = 6
4 6 7 (2)
 1 1 06661 010 0 00 0 01 07771 0 6664 9 14 9 4 10 4 27777
10 4 16 4 15 4 10 0

4 5 416 11 13 11 10 4 17 25
 0 0 100 00010 10 101 10 000 00 1 0 

2 6 2 6 0 2 2 3
A= 4
As expected, the (6,8)-entry of A (G) counts the
 by0symmetry,
two paths between vertices v and v –
1 0
 of counting 1 is true
the same 0 of the0 (8,6)-entry.
0 1While 6

 this result provides a useful method


8

the number of paths between vertices in a graph, it can be extended to a similarly


1 0 0logical0corollary. 0 0 1 0
 interesting and 
 Corollary
 the sum S 2.1. Let G be a graph with adjacency matrix
 A and k be a positive integer. Then
 0 0 defined 1 by1 0 1S = A0+ A 0+ ... 
n
n
2
+A k
(3)

0 0 0 0 1 0 0 0
is the n x n matrix whose (i,j)-entry counts the number of paths of length k or less between
vertices v and v .
i j
MATRICES AND MATRIX OPERATIONS 95 / 107
Graph theory

DISTANCE AND POWERS OF A

The distance between vertices v i and v j , denoted


d (i , j ), of a graph G is defined by the path of
minimum length between the two vertices.
The adjacency matrix of a graph provides a method
of counting these paths by calculating the powers of
the matrices.
THEOREM 11.1
Let G be a graph with adjacency matrix A and k be a
positive integer. Then the matrix power A k gives the
matrix where A i j counts the the number of paths of
length k between vertices v i and v j .
MATRICES AND MATRIX OPERATIONS 96 / 107
2.3 Eigenvalues and Complete Graphs 2 ADJACENCY MATRICES
Graph theory

Figure 2: Depiction of 2 Paths Between


Figure 1: Graph of Order 8 Vertices 6 and 8

 
17 11 1320 111 1 0 010 1 0 0 4
3 162
17 112 13 11 10 4 16 2
3
61 0 1 0 1 0 0 07 611 18 13 17 4 9 11 67
6 7 6 7

 11 18 1366610 1017 0 1 0 4
1 0 1
0 1 07
0 1 0
79
7
116 6
613 13 28 13 16 14 13 27

611 17 1318 4 9 11 67
7
A(G) = 6 7 4 6
60 1 0 1 0 0 0 17 A (G) = 610 4 164 15 4 10 07
7 (2)
13 13 286661 013 0 0 016 0 1 014 136 4 92 149 4 10 4 27
 7 6 7
 7
7 6 7
 40 0 1 1 0 1 0 05 416 11 1311 10 4 17 25
11 17 130 018 0 0 1 4 0 0 0 9 112 66 2 6 0 2 2 3
A4 = 

4
As expected, the (6,8)-entry of A (G) counts the two paths
between vertices v and v –

 10 4 16the same4is true15
by symmetry, 4 10
of the (8,6)-entry. 0result
While this
6

 provides a useful method


8

of counting the number of paths between vertices in a graph, it can be extended to a similarly
4 9 14 9 4 10 4 2 
interesting and logical corollary.
 
 Corollary 2.1. Let G be a graph with adjacency matrix A and  k be a positive integer. Then
16 11 13 11 10S = A4+ A +17 2
 the sum S defined by
n
2 k
 n ... + A (3)

2 6 2 6 0 2 2 3
is the n x n matrix whose (i,j)-entry counts the number of paths of length k or less between
vertices v and v .
i j
MATRICES AND MATRIX OPERATIONS 97 / 107
MatLab Constructing Matrix

CONSTRUCTING MATRIX

EXAMPLE 12.1
A = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16]

1 2 3 4
5 6 7 8
A=
9 10 11 12
13 14 15 16

MATRICES AND MATRIX OPERATIONS 98 / 107


MatLab Some special matrices

SOME SPECIAL MATRICES

1
Zero matrix: zeros(m, n)
2
Square zero matrix of order n : zeros(n)
3
Identity matrix of order n : eye(n)

MATRICES AND MATRIX OPERATIONS 99 / 107


MatLab Operations on Matrices

1
Rank of the matrix A : r ank(A)
2
Transforming the matrix A to reduced row
echelon form: r r e f (A) (Reduced row echelon
form)
3
Addition of Matrices: A + B
4
Subtraction of Matrices : A − B
5
Matrix multiplication: A ∗ B
6
Power of matrices: Aˆn
7
Scalar Multiples: k ∗ A
8
Transpose of Matrices: A.0

MATRICES AND MATRIX OPERATIONS 100 / 107


MatLab Extracting the entries of a matrix

EXTRACTING THE ENTRIES OF A MATRIX

1
Extracting the entry at the i −th row and the
j −column of the matrix A : A(i , j )
2
Extracting the main diagonal of the square matrix
A : d i ag (A)
3
Extracting the i −row of the matrix A : A(i , :)
4
Extracting the j −column of the matrix A : A(:, j )

MATRICES AND MATRIX OPERATIONS 101 / 107


MatLab Elementary Row Operations

ELEMENTARY ROW OPERATIONS

1
Multiply the i −row through by a nonzero
constant k A(i , :) = A(i , :) ∗ k
2
Add a constant times one row to another:
A(i , :) = A(i , :) + A( j , :) ∗ k
3
Interchange 2 rows
A = A([the order of rows in A], :)

MATRICES AND MATRIX OPERATIONS 102 / 107


MatLab Elementary Row Operations

1 2 3 4
5 6 7 8
A=
9 10 11 12
13 14 15 16
If A([1 3 2 4], :) we obtain
1 2 3 4
9 10 11 12
5 6 7 8
13 14 15 16

MATRICES AND MATRIX OPERATIONS 103 / 107


Using Elementary Row Operations to find inverse of an
MatLab invertible matrix

USING ELEMENTARY ROW OPERATIONS TO FIND


INVERSE OF AN INVERTIBLE MATRIX

Adjoin the identity matrix I to right side of A


   
1 2 3 4 1 0 0 0
 2 5 4 7   0 1 0 0 
A= , I = 
   
3 7 8 12 0 0 1 0

   
4 8 14 19 0 0 0 1

>> B = [A I]

MATRICES AND MATRIX OPERATIONS 104 / 107


Using Elementary Row Operations to find inverse of an
MatLab invertible matrix

 
1 2 3 4 1 0 0 0
 2 5 4 7 0 1 0 0 
B =
 
3 7 8 12 0 0 1 0

 
4 8 14 19 0 0 0 1
>> C =rref(B) ⇒
 
1 0 0 0 10 7 −9 1
0 1 0 0 −2 −3 4 −1 
 
0 0 1 0 1 −3 3 −1 
 

0 0 0 1 −2 2 −2 1

MATRICES AND MATRIX OPERATIONS 105 / 107


Using Elementary Row Operations to find inverse of an
MatLab invertible matrix

>> [C (:, 5) C (:, 6)C (:, 7) C (:, 8)]


 
10 7 −9 1
 −2 −3 4 −1 
⇒
 
 1 −3 3 −1


−2 2 −2 1

MATRICES AND MATRIX OPERATIONS 106 / 107


Using Elementary Row Operations to find inverse of an
MatLab invertible matrix

THANK YOU FOR YOUR ATTENTION

MATRICES AND MATRIX OPERATIONS 107 / 107

You might also like