2application of Matrices - 2020
2application of Matrices - 2020
HCMC — 2020.
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 1 / 54
OUTLINE
1 LESLIE MATRIX
1 LESLIE MATRIX
2 MARKOV CHAINS
1 LESLIE MATRIX
2 MARKOV CHAINS
1 LESLIE MATRIX
2 MARKOV CHAINS
4 CRYPTOGRAPHY
· ¸
(n − 1)M
,M ⇒ nth age class
n
· ¸
(n − 1)M
,M ⇒ nth age class
n
The age distribution vector X represents
the number of female population members
in each age class, where
x1 Number in first age class
x
2 Number in second age class
X = .. ...
.
xn Number in nth age class
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 4 / 54
Leslie matrix Population growth
M
Over a period of years, the probability
n
that a female member of the i th age class
will survive to become a member of the
(i + 1)th age class is p i , where
0 É p i É 1, i = 1, 2, . . . , n − 1.
M
Over a period of years, the probability
n
that a female member of the i th age class
will survive to become a member of the
(i + 1)th age class is p i , where
0 É p i É 1, i = 1, 2, . . . , n − 1.
b 1 b 2 . . . b n−1 bn
p1 0 . . . 0 0
L= 0 p2 . . . 0 0
... ... . . . ... ...
0 0 . . . p n−1 0
b 1 b 2 . . . b n−1 bn
p1 0 . . . 0 0
L= 0 p2 . . . 0 0
... ... . . . ... ...
0 0 . . . p n−1 0
Multiplying this age transition matrix by
the age distribution vector for a specific
time period produces the age distribution
vector for the next time period.
LX j = X j +1 , j = 1, 2, . . . , n. (1)
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 6 / 54
Leslie matrix Age transition matrix
In matrix
form,the age transition matrix is
0 6 8
L = 0.5 0 0 .
0 0.5 0
In matrix
form,the age transition matrix is
0 6 8
L = 0.5 0 0 . After 1 year, the age
0 0.5 0
distribution vector will be
0 6 8 24 304
X 2 = LX 1 = 0.5 0 0 . 24 = 12
0 0.5 0 20 12
X n+1 = LX n = λX n (2)
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 11 / 54
Leslie matrix Stable age distribution vector
EXAMPLE 1.2
Find a stable age distribution vector for the
population of female rabbits.
EXAMPLE 1.2
Find a stable age distribution vector for the
population of female rabbits.
SOLUTION. To solve this problem, find an
eigenvalue λ and a corresponding
eigenvector X such that LX = λX .
EXAMPLE 1.2
Find a stable age distribution vector for the
population of female rabbits.
SOLUTION. To solve this problem, find an
eigenvalue λ and a corresponding
eigenvector X such that LX = λX . The
characteristic polynomial of L is
|L − λI | = −(λ + 1)2 (λ − 2)
EXAMPLE 1.2
Find a stable age distribution vector for the
population of female rabbits.
SOLUTION. To solve this problem, find an
eigenvalue λ and a corresponding
eigenvector X such that LX = λX . The
characteristic polynomial of L is
|L − λI | = −(λ + 1)2 (λ − 2)
The corresponding
eigenvectors are of the
16
form X = α 4 .
1
The corresponding
eigenvectors are of the
16
form X = α 4 . For example, if α = 2, then
1
the initial age distribution vector is
32 64
X 1 = 8 ⇒ X 2 = LX 1 = 2X 1 = 16
2 4
The percent of the population in each age
class remains the same.
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 13 / 54
Markov Chains Stochastic matrices and Markov chains
DEFINITION 2.1
p 11 p 12 . . . p 1n
p 21 p 22 . . . p 2n
The matrix P = is called
... ... . . . ...
p n1 p n2 . . . p nn
the matrix of transition probabilities.
DEFINITION 2.1
p 11 p 12 . . . p 1n
p 21 p 22 . . . p 2n
The matrix P = is called
... ... . . . ...
p n1 p n2 . . . p nn
the matrix of transition probabilities.
At each transition, each member in a given
state must either stay in that state or change
to another state. It means that
n
P
p i j = 1, ∀ j = 1..n.
i =1
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 15 / 54
Markov Chains Stochastic matrices and Markov chains
DEFINITION 2.2
The n th state vector of a Markov chain for
which P is the matrix of transition
probabilities and X 0 is the initial state vector
is
THEOREM 2.1
If P is the transition matrix for a regular
Markov chain, then
1
There is a unique probability vector X ,
which is called the steady-state vector of
the Markov chain, with positive entries
such that P X = X .
THEOREM 2.1
If P is the transition matrix for a regular
Markov chain, then
1
There is a unique probability vector X ,
which is called the steady-state vector of
the Markov chain, with positive entries
such that P X = X .
2
For any initial probability vector X 0, the
sequence of state vectors
X 0 , P X 0 , . . . , P n X 0 , . . . converges to X
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 23 / 54
Markov Chains Steady State vector of a Markov chain
EXAMPLE 2.2
Find the steady state vector X of the Markov
chain whose matrix of transition
probabilities is the regular matrix
0.70 0.15 0.15
P = 0.20 0.80 0.15
0.10 0.05 0.70
x1
SOLUTION. Let X = x 2 . Then use the
x3
matrix equation P X = X to obtain
0.70 0.15 0.15 x1 x1
0.20 0.80 0.15 x 2 = x 2
0.10 0.05 0.70 x3 x3
P X = X = 1.X ,
so 1 is an eigenvalue of P with
corresponding eigenvector X .
Eigenvalues: λ1 = 1;λ2 =0.65; λ3= 0.55.
7 0
Eigenvectors: X 1 = 10 ; X 2 = −1 ;
4 1
−2
X3 = 1 ;
1
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 27 / 54
Markov Chains Absorbing Markov Chains
Consider
n a Markovo chain with n different
states S 1, S 2, . . . , S n .
DEFINITION 2.4
The i th state S i is an absorbing state when,
in the matrix of transition probabilities P ,
pi i = 1 (4)
Consider
n a Markovo chain with n different
states S 1, S 2, . . . , S n .
DEFINITION 2.4
The i th state S i is an absorbing state when,
in the matrix of transition probabilities P ,
pi i = 1 (4)
DEFINITION 2.5
An absorbing Markov chain has the two
properties listed below
1
The Markov chain has at least one
absorbing state.
DEFINITION 2.5
An absorbing Markov chain has the two
properties listed below
1
The Markov chain has at least one
absorbing state.
2
It is possible for a member of the
population to move from any
nonabsorbing state to an absorbing state
in a finite number of transitions.
EXAMPLE 2.3
EXAMPLE 2.3
EXAMPLE 2.4
EXAMPLE 2.4
d n1 d n2 . . . d nn
EXAMPLE 3.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.
xi = di 1 x1 + di 2 x2 + . . . + di n xn (5)
xi = di 1 x1 + di 2 x2 + . . . + di n xn + e i (6)
EXAMPLE 3.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
20000
demands are E = 30000
25000
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 41 / 54
Leontief input-output models Open system
SOLUTION.
X = D X + E ⇒ (I − D)X = E ⇒ X = (I − D)−1 E .
46616
X ≈ 51058
38014
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.
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 42 / 54
Cryptography Definition
CRYPTOGRAPHY
DEFINITION 4.1
A cryptogram is a message written
according to a secret code. One method of
using matrix multiplication to encode and
decode messages is introduced below.
CRYPTOGRAPHY
DEFINITION 4.1
A cryptogram is a message written
according to a secret code. One method of
using matrix multiplication to encode and
decode messages is introduced below.
t a b c d e f g h i j k ` m
0 1 2 3 4 5 6 7 8 9 10 11 12 13
n o p q r s t u v w x y z
14 15 16 17 18 19 20 21 22 23 24 25 26
EXAMPLE 4.1
Write the uncoded row matrices of size 1 × 3
for the message MEET ME MONDAY
EXAMPLE 4.1
Write the uncoded row matrices of size 1 × 3
for the message MEET ME MONDAY
SOLUTION.
m e e t t m e t m o n d a y t
13 5 5 20 0 13 5 0 13 15 14 4 1 25 0
EXAMPLE 4.1
Write the uncoded row matrices of size 1 × 3
for the message MEET ME MONDAY
SOLUTION.
m e e t t m e t m o n d a y t
13 5 5 20 0 13 5 0 13 15 14 4 1 25 0
The uncoded row matrices of size 1 × 3 for the message are
[13 5 5]; [20 0 13]; [5 0 13]; [15 14 4]; [1 25 0].
1 −2 2
¡ ¢ ¡ ¢
5 0 13 −1 1 3 = 18 −23 −42
1 −1 −4
1 −2 2
¡ ¢ ¡ ¢
5 0 13 −1 1 3 = 18 −23 −42
1 −1 −4
1 −2 2
¡ ¢ ¡ ¢
15 14 4 −1 1 3 = 5 −20 56
1 −1 −4
1 −2 2
¡ ¢ ¡ ¢
5 0 13 −1 1 3 = 18 −23 −42
1 −1 −4
1 −2 2
¡ ¢ ¡ ¢
15 14 4 −1 1 3 = 5 −20 56
1 −1 −4
1 −2 2
¡ ¢ ¡ ¢
1 25 0 −1 1 3 = −24 23 77
1 −1 −4
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 47 / 54
Cryptography Encoding a message
If X = [x 1 x 2 . . . x n ] is an uncoded 1 × n
matrix, then Y = X A is the corresponding
encoded matrix. The receiver of the
encoded matrix can decode Y by
multiplying on the right by A −1 to obtain
Y A −1 = (X A)A −1 = X (8)
EXAMPLE 4.3
1 −2 2
Use the inverse matrix A = −1 1 3 to
1 −1 −4
decode the cryptogram
13 − 26 21 33 − 53 − 12 18
−23 − 42 5 − 20 56 − 24 23 77.
EXAMPLE 4.3
1 −2 2
Use the inverse matrix A = −1 1 3 to
1 −1 −4
decode the cryptogram
13 − 26 21 33 − 53 − 12 18
−23 − 42 5 − 20 56 − 24 23 77.
SOLUTION.
−1 −10 −8
A −1 = −1 −6 −5
0 −1 −1
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 50 / 54
Cryptography Decoding a message
−1 −10 −8
¡ ¢ ¡ ¢
33 −53 −12 −1 −6 −5 = 20 0 13
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
33 −53 −12 −1 −6 −5 = 20 0 13
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
18 −23 −42 −1 −6 −5 = 5 0 13
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
33 −53 −12 −1 −6 −5 = 20 0 13
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
18 −23 −42 −1 −6 −5 = 5 0 13
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
5 −20 56 −1 −6 −5 = 15 14 4
0 −1 −1
Dr. Lê Xuân Đại (HCMUT-OISP) APPLICATIONS OF LINEAR ALGEBRA HCMC — 2020. 52 / 54
Cryptography Decoding a message
−1 −10 −8
¡ ¢ ¡ ¢
−24 23 77 −1 −6 −5 = 1 25 0
0 −1 −1
−1 −10 −8
¡ ¢ ¡ ¢
−24 23 77 −1 −6 −5 = 1 25 0
0 −1 −1
The sequence of decoded row matrices is
[13 5 5]; [20 0 13]; [5 0 13];
[15 14 4]; [1 25 0].
The message is
13 5 5 20 0 13 5 0 13 15 14 4 1 25 0
m e e t t m e t m o n d a y t