Matrix Algebra: Concepts and Operations
Matrix Algebra: Concepts and Operations
CHAPTER TWO
A a a a
21 22 in which
2n
a a a
m1 m2 mn
The number of rows, m, and the number of columns, n, of the array give
its ORDER, or its DIMENSIONS, mxn (read “m by n”) = A mxn or [a ij]
(mxn).
Example: The following are examples of matrices
1 7
A
5
4
3
2
This is a 3 x 2 matrix
ELEMENT
a12= 7
a21 = 5
a32 = 2
a23 = X - Because is a 3 x 2 matrix.
1 5 9 15
2 6 10 20
This is a 4 x 4 matrix Elements X44 = 45 x32 = 7
3 7 11 30
4 8 12 45
IMPORTANCE OF MATRICES
TYPES OF MATRICES
If then A-t =
2 5 8
A 4 5 6 11 A
3 6 9
7 8 9 12 10 11 12
2. Square Matrix - is a matrix that has the same number of rows and
columns. It is also called an nth order matrix.
1 0
E.g. 2x2, A
0
1
.
3. NULL (ZERO) MATRIX - is a matrix that has zero for every entry. It is
generally denoted by Omn. In matrix operations it is used in much the
same way that the number zero is used in regular algebra. Thus, the sum
of a zero matrix and any matrix gives that given matrix and the product
of a zero matrix and any matrix equals that given matrix.
4. IDENTITY MATRIX - a square matrix in which all of the primary
diagonal entries are ones and all of the off diagonal entries are zeros.
Generally it is denoted as I n. Primary diagonal represents: a 11, a22, a33, a44,
--- ann entries.
1 0
1 0 0 0
0
I2 = A
0
1
, I4 = A
0
0
1
0
0
1
0
0 0 0 1
The product of any given matrix and the identity matrix is the given
matrix it self. That is, A x I = A and I.A = A. Thus, the identity matrix
behaves in matrix multiplication like the number 1 in an ordinary
arithmetic.
1 2 4 2
However; A
3
4
is not equal to C = A
3
1
Even though they contain the same set of numerical values, A and C are
not equal because their corresponding elements are not equal; that is,
a11 ≠ C11 and so on.
If A and B are two matrices, each of size mxn, then the SUM of A and B
is the mxn matrix C whose elements are:
Cij = Aij + bij for i = 1, 2, ------- m
j = 1, 2, -------- n.
Given that two matrices do have the same dimension, the way we
subtract a matrix from another matrix is the same as the way we add two
matrices.
Matrix Multiplication
B. Vector-by-Vector multiplication
In multiplying two vectors always a row vector is written in the first
position and the column vector in the second position. Each component
of a row vector is multiplied by the corresponding component of the
column vector to obtain a result known as PARTIAL PRODUCT. The sum
of all partial products is called INNER/DOT PRODUCT of two vectors,
and this is a number not a vector. In other words, Vector- by- Vector
results in a real number rather than a matrix.
E.g. Consider the product (AB) of the following row and column vectors.
2
A 3 6 ’
5
4 2 B=
7
0
3x2=6
4 x 5 = 20 partial products
-2 x 7 = -14
6x0=0
12 Inner/Dot Product
The first element in the raw is multiplied by the first element in the
column; the second element in the row is multiplied by the second
element in the column and so on until the nth row element is multiplied
by nth column element. These products are then summed up to obtain
the single number that is the product of the two vectors.
Example
2 3 4 1 7
A
6 9
7
B= 0
8
5 1
18 42
AB = 29 121
AB = (-1x2) + (7x6) = 40
(0x3) + (8x9) = 72 AB =
40 60 45
48 72 56
16 24 27
not generally true that AB equals BA. (In the product AB, we say that B is
pre multiplied by A and that A is post multiplied by B). In many
instances for two matrices A and B, the product AB may be defined while
the product BA is not defined, or vice versa.
In some special cases, AB does equal BA. In such special cases A and B
are said to Commute.
3. The product of two matrices can be the zero matrix even though neither
of the two matrices them selves is zero matrix! We cannot conclude
from the result AB = 0 that at least one of the matrices A or B is a zero
matrix.
3 0 0 0 0 0
A = 2
0 0
0
, B = 7
10 4
, AB =
1 0 8 3 2
0 0 0
0 0 0
0 0 0
10 14
AB = AC =
20
28
but B ≠ C.
Then, because AA-1 = I and A-1 I = A-1, we would have [I/A-1]. We do not
follow this procedure, because the inverse is not known at this juncture;
we are trying to determine the inverse. We instead employee a set of
permissible row operations on the augmented matrix [A/I] to transform A
on the left side of the vertical line in to an identity matrix (I). As the
identity matrix is formed on the left of the vertical line, the inverse of A
is formed on the right side. The allowable manipulations are called
ELEMENTARY ROW OPERATIONS. These Elementary Row Operations
are operations permitted on the row of a matrix.
4 3 2 2 6 7
E.g. 1. A
2 6
7
,B 4
3 2
= interchanging
rows
4 3 2 8 6 4
2. A
2 6
7
B = A
2 6
7
= multiplying the
first row by 2.
4 3 2 4 3 2
3. A
2 6
7
B=
6 12
11
= Multiplying the first
Interchange R1 with R2
2 3 4 1 2
13 19
A
1 2
3
B= 1
1
C, = 9 13
2 3
1. To get ones first in a column and next zeros (within a given column)
2. To get zeros first in a matrix and next ones.
Ones First: Try to set ones first in a column and then zeros of the same
column. G0 from left to right
Zeros First: Find the off diagonal zeros first, and following this obtain
ones on the main diagonal. It can simplify the work involved in hand
calculation by avoiding fractions until the last step.
MATRIX APPLICATIONS
1. n by n systems
Systems of linear equations can be solved using different methods. Some
are:
Elimination method for 2 variable problems (equations).
Matrix method
i. Inverse method
ii. Cramer’s rule – using determinants (independent
study)
iii. Gaussian Method.
Inverse Method
2. X+Y = 2
2x + 2y 4
Ax = B
Ix = C
x=C
The Gaussian Method helps us to obtain:
Unique solution
No. Solution
Infinite solution
E.g. 1. 2x + 3y = 4 2. x + y = 2 3. x + y = 5
x + 2y = 2 2x + 2Y = 4 x+y=8
2 3 4
1
2
2
IX = c
X=C
Summarizing our results for solving an “n” by “n” system, we start with
matrix (A/B), and attempt to transform it in to the matrix (I/C).
One of the three things will result:
1 0 0 10
0 1 0 5
0 0 1 3
2. A row that is all zeros except in the constant column, indicating that
there are no solutions; e.g.
1 0 0 3
0 1 0 5
0 0 0 7
3. A matrix in a form different from (1) and (2), indicating that there are an
unlimited number of solutions. Note that for an n by n system, this case
occurs when there is a row with all zeros, including the constant column;
e.g.
1 0 2 5
0 1 3 3
0 0 0 0
2. M by n linear systems
The mxn linear systems are those systems where the number of rows (m)
and number of columns (n) are unequal or it is the case where the
number of equations (m) and the number of variables (n) are unequal.
And it may appear as m>n or m<n.
2.1 Linear equations where m>n
To solve an m by n systems of equations with m>n, we start with the
matrix (A/B), and attempt to transform it in to the matrix (I/C). One of
the three things will result:
1. An n by n identity matrix above m-n bottom rows that are all zeros,
giving the unique solution
E.g.
2. A row that all zeros except in the constant column, indicating that
there are no solutions.
E.g.
3. A matrix in a form different from (a) and (2), indicating that there are
an unlimited number of solutions.
E.g.
WORD PROBLEMS
Steps
Example.
1. The weights (in pounds) of six people before taking a weight reduction
program were 350, 249, 260, 195, 275, and 295. The weights of these
same people after the weight reduction program are 345, 200, 220, 140,
200, and 230, respectively. Summarize this information in a (6 by 2)
matrix.
X 38 57
Y 32 48
percent, 9 percent and 7.5 percent respectively. Total interest earned for
the year was Br 845. The amount in the 9 percent account was twice the
amount invested in the 7.5 percent account. How much did Alemayehu
invest in each account? Br 1,000, Br 6,000 and Br 3,000
11. Two departments of a firm A and B need different amounts of the same
product. The following table gives the amounts of the products needed
by the department.
Two suppliers, Abebe and Tefera supply these three products with the
unit-selling price given below:
Abebe Tefera
Required:
a) Use matrix multiplication to find how much these two orders will
cost at the two suppliers.
b) From which supplier should each department make its purchase?
Answer: Department A from Tefera, and Department B from
Abebe.
MARKOV CHAINS
Markov chains are models which are useful in studying the evolution of
certain system over repeated trials. These repeated trails are often
successive time periods where the state (out come, condition) of the
system in any particular time period cannot be determined with
certainty. Therefore, a set of transition probabilities is used to describe
the manner in which the system makes transition from one period to the
next. Hence, we can predict the probability of the system being in a
particular state at a given time period. We can also talk about the long
run/equilibrium, steady state.
1. The system has a finite number of states - the out comes of the system
should be finite.
2. The system condition/outcome, state in any given period depends on
its state in the preceding period and on the transition probabilities
3. The transition probabilities are constant over time.
4. Changes in the system will occur once and only once each period.
5. The transition period occurs with regularities.
6. The states are both mutually exclusive and collectively exhaustive.
7. The system is a closed one, that is, there will be no arrival or exits
from the system.
From these inputs the model makes two predictions usually expressed as
vectors:
1. The probabilities of the system being in any state at any given future
time period.
2. The long run / equilibrium, steady state probabilities.
About past
About today
S1 0.9 0.1
S2 0.2 0.8
P11, P22, P33, P44 ---------------------Pnn that represent the primary diagonal
show loyalty. Others switching.
V12(2) = V12(1) x P
= V12(1) x P
= (.76 .24)
.9 .1
= (.8) .2)
.2
.8
=(0.732 .268)
0.9V1 + .2V2 = V1
.1V1 + .8V2 = V2
V1 + V2 = 1
-.1V1 + .2V2 = 0
one is the - ve of the other.
.1V1 + -.2V2 = 0
.9V1+.2(1-V1) =V1
.9V1 + .2 - .2V1 = V1
.7V1 + .2 = V1
.2 = .3V1
V1 = 2/3
V2 = 1 - V1
= 1 - 2/3
V2 = 1/3
In short, the switching over the sum of the switching gives us the long
run state.
To
S1 S2
From S1 .9 .1
S2 .2 .8
V1= V2 =
= =
2 1
(V1 V2) =
3 3
In the long run 67 of the customer will shop in store 1 and 33% in store
2.
Prediction: Long run - only the transition matrix.
At specified time - the transition matrix and state vector.
Hence, unless the transition matrix is affected, the long run state will not
be affected. Moreover, we cannot know the number of years, weeks, or
periods to attain the long run state, point but we can know the share.
For example, if we take the above example and change the transition
matrix
S1 S2
S1 1 0
S2 .2 .8
The state S1 (store 1) in absorbing
In short:
Consider a Markov chain with n different states {S1, S2, and S3 --- Sn}.
The ith state Si is called absorbing if P ii = 1. Moreover, the Markov chain
is called absorbing if it has at least one absorbing state, and it is possible
for a member of population to move from any non-absorbing state to an
absorbing one in a finite number of transitions.
Remark: Note that for an absorbing state Si, the entry on the main
diagonal p must be Pii = 1 and all other entries in the ith row must be 0.
E.g. a.
E.g. b.
S1 .5 1 5 0 0
fro m S 2
0 1 0 0
The second state is absorbing.
0 0 .4 6
S3
S 4 0 0 5 .5
However the corresponding Markov chain is not observing. Because
there is no way to move from state 3 or state 4 to state 2.
Exercises
Solution
2. V (1) UN = V (0) UN x P
.95 .05
= 0.2 0.8
.10 .90
=
(0.27 0.73)
V (2) UN = V (1) UN x P
.95 .05
= 0.27 0.73
.10 .90
= (.3295 0.6705)
3. VU VN = (? ?)
switchtoU switchtoN
Switchtou SwitchtoN Switchtou SwitchtoU
VU = VU =
.1 .05
0.65 0.33
.15 .15
VU VN = 0.67 0.33
VUN (n) = 0.67 0.33
2. A city has two suburbs: suburb x and suburb y. Over the past several
years, the city has experienced a population shift from the city to the
suburbs, as shown in the table below.
To the next year
From City (C) Suburb x (X) Suburb y
one (Y)
year City (C) .85 .07 .08
Suburb x (X) .01 .96 .03
Suburb y (Y) .01 .02 .97
Solution.
250,000 1.00
P=
.85 .07 .08
V(1)cxy = V(0)cxy x p (.48 .32 .20)
.01 .96 .03
.01 .02 .97
.85 .07 .08
V(2)cxy = (.4132 .3448 .2420) .01 .96 .03
.01 .02 .97
V cxy = (.3571
(2)
.3648 .2781)
Thus, in 20X2, 89,275, 91,200 and 69,525 people will live in the city,
suburb x and suburb y respectively.
longrun
b. n p n+1
.85 .07 .08
(Vc Vx Vy) .01 .96 .03 (Vc Vx Vy)
.01 .02 .97
.16C - .01 = 0
.16C = .01
.01
C=
.16
C = 0.0625 .11 (.0625) + .06y - .06y - .04 = 0
.006875 + .06y - .04 = 0
.06y = .033125
y = 0.5521
C+X+y = 1
.0625+x+.5521=1
0.6146+x=1
X = .3854
In the long run 15,625, 96,350 and 138,025 people will live in the city
suburban X and suburban respectively.
4. In a certain college class, 70% of the students who receive an “A” on the
current examination will receive an “A” on the next examination.
Moreover, 10% of the students who do not receive an “A” on the current
examination will receive an “A” on the next examination. Assuming that
this pattern continues, what is the stable matrix?
VA VA1 = (.25 .75)
soln.
A.
C. Vx = =1
Vx' = =0