OT - Ch02 Matrix Algebra and Its Application
OT - Ch02 Matrix Algebra and Its Application
Importance of Matrices
Matrices provide a most convenient vehicle for organizing and storing large quantities of data.
Because the basic idea is to organize the data, we cannot over emphasize the importance of the
location of each number with in the matrix. It is not simply a matter of putting numbers in to rows
and columns; each row-column location within each matrix carries with it special interpretation; a
matrix is, in essence, a tool for organizing vast quantities of data. Matrices are used to represent
complex systems and operations by compact entities.
Matrix representations are possible
- Transportation matrix
- Distance matrix
- Cost matrix
- Brand switching
Dimensions and Types of Matrix
If a matrix has “m” rows and “n” column, it is known as a matrix with “m” by “n” or “mxn”
diminutions or order.
Therefore the order of the matrix represents the number of rows and columns.
Eg. B = 3
-2 4 5 find the order it is a 3 by 4
4 6 7 6
10 8 9 -11
Types of Matrix
1. Vector or Special Matrix: - is a matrix which has persistently a single row or column (1xn or
mx1)
A vector matrix with only one row is known as Row vector.
Eg. D = a11 E= 4
a21 9
a31 mx1 6 3x1
.
am1
2. Square Matrix: - a matrix with equal No of rows and columns it is nth ordered matrix.
E.g. A= a11 a12 B= 5 -11 -12
a21 a22 2by2 6 -9 10
5 2 19 3 by 3
3. Zero (null) matrix :-is a matrix with every of the elements having zero values and is denoted
represented by 0
E.g. A = 0 0 B = 0 0 0
0 0 2x2 0 0 0 3x3
Null vector:- a row or column vector whose elements are all zero is called a null vector and is also
denoted by 0
4. Identity or unit matrix :- it is a square matrix with the main diagonal elements having a value
of one and the off diagonal elements having the value of zero
E.g. A= 1 0 B= 1 0 0
0 1 2x2 0 1 0
0 0 1 3x3
Elements which don’t exist in the main diagonal are off-elements.
5. Equal Matrix: - if two or more matrices have the same order or damnation and corresponding
elements have the same value these matrices said to be equal.
E.g. A = 2 4 3 B= 2 4 3
5 6 9 = 5 6 9
6. Scalar Matrix: - is when a given matrix has a single element is called a scalar matrix.
Alternatively a scalar is a 1x1 matrix e.g. C = 10
Scalar Number is a constant number without a parenthesis is called scalar.
E.g. A = 4 or any constant k is a scalar B=6
7. Transposition Matrix: - the transpose of an mxn matrix Denoted by A’ (reads as A prime or
A transpose) is an nxm matrix obtained by interchanging the rows and columns of A, that is
the ith row of A becomes the jth column of A’.
Eg. 4 5 A’= 4 3 5
3 1 5 1 0 2x3
5 0 3x2
8. Sub Matrix: - given any mxn matrix A, if all but r rows and s columns of A are deleted. The
resulting matrix of order rxs is called a sub matrix of A.
Eg, A = 3 5 7 if we delete the 3rd row and the 3rd column of A, we
8 2 1 obtain B = 3 5
3 2 1 3x3 8 2
9. Diagonal Matrix:- A square matrix with at least one none zero element on the main diagonal
(running from the upper-left-hand corner to the lower-right- hand corner and zero else-where is
called Diagonal Matrix.
E.g. A = 2 0 B = -2 0 0
0 3 2x2 0 5 0
0 0 1 3x3
e.g. M = 2 5 N= 8 7
3 9 2x2 6 10 2x2
Find M-N M-N = 2-8 5-7 = -6 -2
3-6 9-10 -3 -1 2x2
Find N-M N-M = 8-2 7-5 = 6 2
6-3 10-9 3 1 2x2
A matrix can be multiplied by a constant by multiplying each component in the matrix by a constant.
The result is a new matrix of the same dimension as the original matrix.
If K is any real number & A is an M x n matrix, then the product KA is defined to be the matrix
whose components are given by K times the corresponding component of A; i.e.
KA = K aij (m x n)
E.g.2.4 Star business group sales products x1 , x2 &x3 at a price of br. 20, br. 10, & br. 30 per unit
respectively. If the quantity of x1 , x2 &x3 :- 50, 60 &40 units respectively.
a) Write this in a matrix form Price (P) 1by3 and Quantity (Q) 3by1order?
b) What is the revenue for x1 , x2 &x3 (PQ)?
c) What is the total revenue of star business?
iii. Matrix by Matrix Multiplication
If A & B are two matrices the product AB is defined if and only if the number of column of A is
equals to the number of rows in B. if this is fulfill, we say that the two matrices are conformable for
multiplication.
General Notation: if A is a matrix with mxn dimension and B is nxp dimension matrix, then C
equals to AB I a matrix with with mxp order, C ij is found by multiplying the ith row of A in to jth
column B.
Important Notice
1. The number of columns of A is equals to number of rows of B
2. The matrix C has the order mxp, where
m is the number of rows of A and
p is the number of columns of B
3. The elements of C are found by multiplying raw vector of A by the column vector of B
Solution
a) 200 150 160 250
Q= 400 120 110 P = 280
500 240 260 3x3 270 3x1
b) QP = 200 150 160 200x250+ 150x280 +160x270
250 400x250+ 120x280 +110x270
400 120 110 280
500 240 260 500x250+ 240x280 +260x270
270 3x1
3x3 =
= 50,000+ 42,000 +43,200 135,200 #1 revenue
100,000+ 33,600 +29,700 163,300 #2 revenue
125,000+ 67,200 +70,200 3x1 = 262,400 3x1 #3 revenue
c) Each cities revenue cannot be determined using matrix rather we can determined in the other way
Properties of Matrix Multiplication
1. Matrix multiplication is not necessarily commutative; that is, in general, AB ≠ BA. Therefore,
the order in which the matrices are multiplied is very important. AB means that A is post
multiplied by B or B is pre multiplied by A.
2. Even if AB and BA exist, the resulting matrices may not be of the same order. Thus, if A is mxn
and B is nxm AB is mxm where as BA is nxn, hence of different order.
3. Even if A and B are both square matrices will not be necessarily equal
e.g. A = 4 7 B= 1 5 AB = 46 76 BA = 19 17
3 2 6 8 15 31 48 58
AB ≠ BA an example of AB = BA is when both A&B are identity matrices.
e.g. A =
2 3 B= 9 AB = (2x9) + (3x10) = 48
1 4 2x2 10 2x1 -(1x9) + (4x10) 49
7. A row vector pot multiplied by a matrix is a row vector
8. Matrix multiplication is associative; that is (AB)C = A(BC); where A is mxn, B is nxp and C is
PxK
Inverse of a Matrix
If A is a square matrix of order n, then an inverse of a square matrix A, denoted by A-1 (read A
inverse) of the same order n is said to be the inverse of A, if and only if A x A-1 = I = A-1 x A
Two square matrices are inverse of each other, if their product is the identity matrix.
AA-1 = A-1 A = I
That is, whether A is pre or post multiplied by A-1 , the product will be the same identity matrix.
This is another exception to the rule that matrix multiplication is commutative.
All square matrices have no inverse. If a matrix has an inverse, it is said to be invertible or non-
singular. A matrix that doesn’t have an inverse is said to be singular or no- invertible. An
invertible matrix will have only one inverse; that is, if a matrix does have an inverse, that inverse
will be unique.
The Following Points are worth Noting
1. Note every square matrix has no inverse queerness is a necessary (pre) condition but not a
sufficient condition, for the existence of an inverse.
2. If A-1 does exist, then the matrix A can be regarded the inverse of A-1 , just as A-1 is the
inverse of A. in short A & A-1 are inverses of each other.
3. If A is nxn, then A-1 must also be nxn; otherwise it cannot be conformable for both pre and
post multiplication.
4. The identity matrix produced by the multiplication will also be nxn.
1. Find one (1) at the top left corner of the give matrix using appropriate elementary row
operations.
2. Use the multiple of the 1st row by some k to get zero in all places below the one obtained in
step 1 (or find zero (0) below one that we obtained in step one using the multiple of some non-
zero constant k)
3. Deletes ideally the top row and first column of the matrix and repeat step 1&2 on the sub
matrix.
4. Continuous this process step 1-3 until you get unit matrix in place of the original matrix.
In a matrix Algebra there are 3 types of row operations.
i. Any pair of row in a matrix may be interchanged /Exchange operations/. Interchanging rows.
Step2: Augment the coefficient matrix with vector of constant (A/b change into I/S (Identity with
solution))
C1 C2
Step3: R1 2 3 120 Change the coefficient matrix to identity matrix by applying
R2 1 5 95 elementary row operation
R3 1 2 65
Find 1 on R1C1 2 to 1 Find 1 on R2C2 -7 to 1
Inter change R1 & R2 Divide R2 by -7 (R2/-7)
1 5 95 1 5 95
2 3 120 0 1 10
1 2 65 0 3 30
Find 0 on R2C1&R3C1 2&1 to 0 Find 0 on R1C2 &R3C2 5&3 to 0
-2R1 + R2 = R2 -5R2 + R1 = R1
R1-R3 =R3 -3R2 + R3 = R3
1 5 95 1 0 45 = I/S X=45
0 -7 -70 0 1 10 Y=10
0 3 30 0 0 0
E.g.2.7 Tewodros School bought 2 foot balls, 1 base ball and 3 basket balls for a total cost of br. 90.
Minillik School bought 3 foot balls, 2 base balls and a basket ball for br. 81. Tsehaytu School bought
5 foot balls and 2 basket balls for br. 104.
Solution
a)
Step2: Augment the coefficient matrix with vector of constant (A/b change into I/S (Identity with
solution))
C1 C2 C3
R1 2 1 3 90
R2 3 2 1 81
R3 5 0 2 104
Step3: Change the coefficient matrix to identity matrix by applying elementary row operation
Find 1 on R1C1 2 to 1 Find 0 on R1C2&R3C2 ½&-5/2 to 0
Divide R1 by 2 (R1/2) -1/2R2 + R1 = R1
1 1/2 3/2 45 5/2R2 + R3 = R3
3 2 1 81 1 0 5 99
5 0 2 104 0 1 -7 -108
0 0 -23 -391
Find 0 on R2C1&R3C1 3&5 to 0 Find 1 on R3C3 -23 to 1
-3R1+R2 = R2 Divide R3 by -23
-5R1+R3 = R3 1 0 5 99
1 1/2 3/2 45 0 1 -7 -108
0 1/2 -7/2 -54 0 0 1 17
0 -5/2 -11/2 -121
Find 1 on R2C2 ½ to1 Find 0 on R1C3&R2C3 5&-7 to 0
Multiply R2 by 2 -5R3 +R1 = R1
1 1/2 3/2 45 7R3 + R2 = R2
0 1 -7 -108 1 0 0 14
0 -5/2 -11/2 -121 0 1 0 11 = I/S X1 = 14
0 0 1 17 X2 = 11
X3 =17
4X1 + 5X2 + aX3 = 315 4(14) + 5(11) + a(17) = 315 17a = 315-111
Where: a = Number of basket balls 56 + 55 +17a = 315 17a = 204 a = 12
X1 = 14; X2 = 11; X3 =17 111+17a = 315 17 17
Jiffar International school can purchase as many as 12 basket balls
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 (outcome, conditio n)
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.
Important Terms
1) State: - it refers to each individual outcome or condition.
2) System: - it can be an individual, machine, market brand performance and anything under
consideration.
3) Trials: - any convenient period of time (week, month, year) this repeated trials are often
successive time periods where the state of the system in any particular time period cannot be
determine with certainty.
4) Initial (current state vector): - it is a condition or situation at the beginning and it is also
called zero period state vector.
5) Transition Probability Matrix (Rate): - it shows the movement of one system from one state
“i” to another state “j” and therefore is represented by P ij. This probability matrix is a square
matrix such that each entry indicates the probability of the system moving from one given state
to another state and the sum of rows in the transition matrix should be one.
6) Steady State/Long Run/ Equilibrium State: - a situation or equilibrium condition that does
not change overtime.
1. The system has a finite number of states - the outcomes 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.
Information flow in the Analysis
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.
The set of transition probabilities are necessary for both predictions (time period n, and steady state),
but the initial state is needed for only the first prediction.
E.g.2.8 Currently it is known that 80% of customers shop at store 1 and 20% shop at store 2. In
reviwing the past data, suppose we find that out of all customers who shopped at store 1 in a given
week 90% remains loyal for the next week (store 1 again) 10% switch to store 2 on the other hand
out of all customers who shopped at store 2 in a given week 80% remains loyal for the next week
(store 2 again), 20% switch to store 1.
Required:
a) Write the initial state vector and transition probability matrix
b) What will be the proportion of customers shopping at store 1&2 in each of the next two
weeks?
c) What will be the long run market share of store 1&2
Solution
a) Initial state vector (Vo) = [Market share of Store 1 Market share of Store 2]
Vo = [80% 20%]; Vo = [0.8 0.2]
c. In the long run (V1 V2 ) = P(V1 V2 ) .9V1 +.2(1-V1 ) =V1 since V2 = 1-V1
where: .9V1 + .2 - .2V1 = V1
V1 = Market share of Store 1 in the long run .7V1 + .2 = V1
V2 = Market share of Store 2 in the long run .2 = .3V1
.9 .1
V1 = 2/3 = 0.6667 = 66.67%
(V1 V2 ) = (V1 V2 ) V2 = 1 - V1
.2 .8
= 1 - 2/3
0.9V1 + .2V2 = V1 V2 = 1/3 = 0.3333 = 33.33%
.1V1 + .8V2 = V2 Market share store 1 in the long run = 66.67%
V1 + V2 = 1 Market share store 2 in the long run = 33.33%
-.1V1 + .2V2 = 0
one is the - ve of the other.
.1V1 + -.2V2 = 0
Cramer’s Rule for Solving Linear Equation
Cramer’s rule is a method that is useful primarily for low order system, with two or three unknowns.
Cramer’s rules states that each unknown can be expressed as the ratio of two matrix determinants.
e.g Assume there are two linear equations having two unknown variables.
a11 X1 + a12 X2 = b1
a21 X1 + a22 X2 = b2
Here the unknown are x1 &x2 , the right hand sides are b1 & b2 and the coefficients are a ij
Cramer’s rule requires finding the quotient of the determinants of matrices associated to the system and
can be used when the determinant of the coefficient matrix is none zero.
The coefficient matrix A= a 11 a12
a21 a22
Assume the determinant of A is different from 0 the Cramer’s rule gives the solution for unknown
variables.
Use the Cramer’s rule to solve the 2x2 Use the Cramer’s rule to solve the 3x3 system of linear
system of linear equation equation
e.g. 3x1 + 7x2 = 41 e.g. 4x1 + 2x2 + 7x3 = 35
8x1 + 9x2 = 61 3x1 + x2 +8 x3 = 25
5x1 + 3x2 + x3 = 40
Required: Find the values of the unknown variables for the above all examples?
Solution
Solving 2x2 linear equation system using Cramer’s rule
First change the linear equation system to matrix Find the determinant of the coefficient matrix
form 3 7
A X b 8 9
3 7 X1 41 Det(A) = 3x9-8x7 = 27-56 = -29
8 9 X2 61
Q2. You and your friend each go to your local hardware stores A&B to price items you wish to
purchase. You want to buy 1 hammer, 1 screwdriver and 2 cans of white point and your friend wants
to buy 1 hammer, 2 screwdriver and 3 cans of white point. The prices of these goods are:
Hammer Screwdriver Can of paint
Store A $7 $3 $19
Store B $6 $2 $22
a) Write the requirements matrix R as a 3x2 matrix
b) Write the price matrix P as a 2x3 matrix
c) Find PR
d) What are your costs at store A and your friend’s costs at store B?
e) Should you buy from store A or store B?
Q3. A TV advertising company is conducted foot ball season to promote brand X. for each
several weeks a survey is made and it is found that each week 100% those of use of brand X
continue using brand X. it is also found that of those not using brand X, 20% switch to brand X
while the other 80% continue using other brand.
a) Write the transition matrix assuming the transaction percentage continues to hold for
succeeding week.
b) If 20% of the people are using brand X at the state of advertizing company. What percentage
will be using brand X one week and two weeks later? If the total population using the brand X
and other is 10,000, what is the number of people who use brand X and other brands one week
and two weeks later?
c) What portion of the market using brand x at the end of the season/ long run/steady state/
equilibrium
Q4. A manufacturer makes two type of products X and Y at each of the two different locations A
and B. the materials used to make each of the products are steel, glass and plastic. Suppose it takes
three units of steel, one unit of glass and two units of plastic to make one unit of product X; and
four units of steel, one-half (1/2) unit of glass, and three units of plastic to make one unit of
product Y. Suppose further that steel, glass and plastic cost birr10, 2, and 3 per unit respectively at
location A. At location B, steel, glass and plastic cost birr9, 3, and 4 per unit respectively. Using
matrix algebra, find the material cost of making one unit of each product at each of the two
locations.
Q5. A manufacturer produces three products, A,B,C. each unit of products A,B,C requires the
following amounts of time in hours in each of the indicated departments.
Product
Department A B C
Machining 0.2 0.3 0.5
Assembly 0.4 0.2 0.4
Painting 0.3 0.5 0.2