Professional Documents
Culture Documents
Chapter Two-Matrices
A matrix: - is a rectangular array of real numbers arranged in m rows & n columns.
- It is enclosed by a bracket and
- It is written in the form of
a11 a12 a1n
A a 21 a 22 a 2 n In which all the elements in the array are real numbers.
a m1 a m 2 a mn
Each number appearing in the array is said to be an elements or components of the matrix.
Elements of a matrix are subscripted as a ij, to give the row & column location of the element
within the array. The first subscript always refers to the row location of the element; the second
subscript always refers to its column location.
The number of rows (m) & the number of columns (n) of the array give its order of matrices or
its dimension; m x n (reads “m” by “n”). The following are examples of matrices
1 7 element a 12 = 7
A= 5 3 this is 3 x 2 matrix a21 = 5
4 2 a32= 2
Types of Matrices
There are different types of matrices. These are
1. Vector matrix
2. Square matrix
3. Zero matrix
4. Diagonal Matrix
5. Identity matrix
6. Scalar matrix
1. Vector matrix: – is a matrix, which consists only one row or one column. It is an m x 1 or
1 x n matrix.
Row vector: is a 1 x n matrix i.e. a matrix with 1 row
eg. W = -1 0 6 1x3
eg. 0
Z= 20
5 3x1
2. Square matrix: - It is an n by n matrix a matrix that has the same number of rows &
columns.
E.g. 1 2 3
A= 2 4 5
7 8 4 3x3
3. Null or zero matrix: - is a matrix that has zero for every entry.
0000
A= 0000
0000
4. Diagonal matrix- It is a square matrix having all zero elements except on its main diagonal.
e.g. 1 0 0
A= 0 4 0
0 0 4 3x3
5. Identity (unit) matrix: - a square matrix with 1 as the element in each position on the main diagonal
(upper left to lower right) and 0 has the element in all other positions and it is denoted by I. It is a scalar
matrix of one or it has one on the main diagonal.
e.g. 1 0 0
A= 0 1 0
0 0 1 3x3
The above matrices are comfortable for addition and subtraction because they have the same
dimension.
eg. –2 7 2 8 7
4 6 9 + 6 4
The above matrices are not comfortable for addition and subtraction because they do not have
same dimension. Two matrices of the same dimension are said to be CONFORMABLE FOR
ADDITION AND SUBSTRACTION. Adding/Subtracting corresponding elements from the two
matrices & entering the result in the same raw -column position of a new matrix perform the
addition and subtraction.
Matrix Multiplication
a) Scalar multiplication
It is 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 = Kaij (m x n)
eg. X = 6 5 7, then 2X = ( 2 x 6) (2 x 5) ( 2 x 7)
2X = 12 10 14
The two supply companies being considered, Western and Coastal, can each supply all of these
materials, but at different prices per unit, as described in the following table.
Western Coastal
Steel 300 290
Wood 100 90
Plastic 145 180
The price from each supplier for each division is found from the product AB.
AB = 20 30 8 300 290
22 25 15 x 100 90
145 180
Note- When the columns and rows of matrix A are interchanged to create a matrix B, and vice
versa, we say that A and B are transposes of each other and write AT = B and BT = A.
Inverse of Matrix
The inverse of an n x n matrix A is the matrix A-1 such that AA-1 = I = A-1A
A matrix which has an inverse is called nonsingular
A matrix that does not have an inverse is singular.
An inverse of 2 x 2 matrix A exists if ad-bc≠ 0
If the product of A and B is the identity matrix, I, we say that B is the inverse of A and A is the
inverse of B. The matrix B is called the inverse matrix of A, denoted A-1.
We can find the inverse of a matrix by using elementary row operations. These operations are
If A= a b then A-1= 1 d -b this formula works only for2x2 matrix. And ad –bc
Finding the inverse of a square matrix
Procedure Example
To find the inverse of the square matrix A: Find the inverse of matrix A = 1 2
1 1
1. Form the augmented matrix [A / I ], 1 2 1 0
where A is the n x n matrix and I is the n x n 1 1 0 1
identity matrix.
R2 = -1xR1 + R2 1 2 1 0
2. Perform elementary row operations on [A 0 -1 -1 1
/ I] until we have an augmented matrix of R2 = -R2 1 2 1 0
the form [I / B]—that is, until the matrix A 0 1 1 -1
on the left is transformed into the identity R1 = (-2) R2 + R1 1 0 -1 2
matrix. 0 1 1 -1
The inverse of A is B = -1 2
1 -1
3. The matrix B (on the right) is the inverse
of matrix A.
Solution- To find the inverse of matrix A, we induce A in [A / I] (the matrix A augmented with
the identity matrix I)
2 5 4 1 0 0
1 4 3 0 1 0
1 -3 -2 0 0 1
When the left side becomes an identity matrix, the inverse is in the augment.
1 4 3 0 1 0
Switch R1 and R2 2 5 4 1 0 0
1 -3 -2 0 0 1
1 4 3 0 1 0
R2 = -2R1 + R2 0 -3 -2 1 -2 0
R3 = -R1 + R3 0 -7 -5 0 -1 1
1 4 3 0 1 0
R2 = -R2/3 0 1 2/3 -1/3 2/3 0
0 -7 -5 0 -1 1
R1 = -4R2 + R1 1 0 1/3 4/3 -5/3 0
0 1 2/3 -1/3 2/3 0
R3 = 7R2 + R3 0 0 -1/7 -7/3 11/3 1
1 0 1/3 4/3 -5/3 0
0 1 2/3 -1/3 2/3 0
R3 = -3R3 0 0 1 7 -11 -3
R1 = -1/3R3 + R1 1 0 0 -1 2 1
R2 = -2/3R1 + R2 0 1 0 -5 8 2
0 0 1 7 -11 -3
-1 2 1
-1
A = -5 8 2
7 -11 -3
Application of Matrix
I. Solving Systems of Equations
We can use matrices to solve systems of linear equations by performing the same operations
on the rows of a matrix to reduce it as we do on equations in a linear system.
The three different operations we can use to reduce the matrix are called elementary row
operations.
There are two well recognized methods for solving linear equations:
Steps 1. Change the system of linear equation into matrix form. The result will be 3
3. Multiply the inverse of coefficient matrix with the vector of constant, and the
2 3 = Coefficient matrix
1 2
- Using the unknown variables construct unknown matrix & it is a column vector (a matrix
which has one column)
X = vector of unknown
Y
2x + 5y + 4z = 4
x + 4y + 3z = 1 find the value of x, y & z
x - 3y - 2z = 5
The first step under this method is to separate the equation.
2 5 4 X 4
1 4 3 x Y = 1
1 -3 -2 Z 5
Let the first matrix be called A the second X and the last one B. Then
For the above example X= A-1B the solution of A inverse is solved in the above example.
Which is:
-1 2 1 4
-1
A = -5 8 2 and B= 1
7 -11 -3 3x3 5 3x1
Then -1 2 1 4 3
X= -5 8 2 x 1 which will give -2
7 -11 -3 5 2
X=3 Y = -2 Z=2
2) Gauss Jordan method
This method is very general because it is used on circumstances where the numbers of equations
and the number of variables are equal, or different.
It is developed by a mathematician Karl F. Gauss (1777-1855). It helps to solve systems of linear
equations with different solution approaches i.e. unique solution, No solution and infinite
solution cases.
E.g.1
x + 2y + 3z = 6
x -z = 0
x -y -z = 4
step 0ne 1 2 3 X 6
1 0 -1 Y = 0
1 -1 -1 Z 4
Step two 1 2 3 6
1 0 -1 0
1 -1 -1 4
Step three implement ERO then it will give you
1 0 0 -0.5
0 1 0 4
0 0 1 -0.5 this have unique solution X= -0.5 Y= 4 Z= -0.5
Use matrices to solve the system
2x + 5y + 4z = 4
x + 4y + 3z = 1
x - 3y - 2z = 5
first step 2 5 4 X 4
1 4 3 Y = 1
1 -3 -2 Z 5
Second step 2 5 4 4
1 4 3 1
1 -3 -2 5
Third step ERO
1. An m by n identifying matrix above m – n bottom rows that are all zeros, giving the
unique solution:
1 0 0 3 3X1 + 2X2 + X3 = 23
0 1 0 -5 X1 + 3X2 + 2X3 = 26
0 0 1 4 2X1 + X2 + 2X3 = 10 3, 5, 4
0 0 0 0 4X1 + 5X2 + 3X3 = 49
2. A row that is m – n bottom raw is all zeros except in the constant column, indicating that there
are no solutions
eg. 1 0 0 3 2X1 + X2 = 30
0 1 0 -5 X1 + 2X2 = 24
0 0 1 7 4X1 + 5X2 = 72
0 0 0 1
3. A matrix in a form different from (1) & (2), indicating that there are an unlimited
number of solutions
Example
Currently its known that 80% of customers shop at store 1 & 20% shop at store 2. In reviewing a
past data suppose we find that out of all customer who shopped at store 1 in a given week 90%
remain loyal for the next week (store one 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. What will be the proportion of customers shopping at
store 1 & 2 in each of the next two weeks?
Solution
Let S1 be the proportion of store 1
S2 be the proportion of store 2
Initial state/current state probability matrix for store one and two will be:
V12 = (0.8 0.2)
To the next weekly shopping period
from one S1 S2 Transition probability matrix
week S1 0.9 0.1 is a square matrix such that each
shopping S2 0.2 0.8 entry indicates the prob. Of the
period system moving from a given state to
another state.
The sum of rows in the transition matrix should be 1
We have to be consistent in writing the elements
Markov Chain Formula
a) Vij (n) = Vij (n – 1) x P where P = Transition matrix
Vij (n) = Vector for period n
Vij (n – 1) = Vector for period n – 1
V12 (0) = (0.8 0.2) current share
V12 (1) = V12 (1 –1 ) x P
= V12 (0) x P
(0.8 0.2) 0.9 0.1
0.2 0.8
= (0.8 x 0.9) + (0.2 x 0.2) (0.8 x 0.1) + (0.2 x 0.8)
= 0.72 + 0.04 0.08 + 0.16
= 0.76 0.24
V12 (1) = (0.76 0.24)
V12 (2) = V12 (2 – 1) x P
= V12 (1) x P
(0.76 0.24) 0.9 0.1
0.2 0.8
(0.76x 0.9) + (0.24 x 0.2) 0.76 (0.1) + (0.24 x 0.8)
(0.732 0.268)
b) Long run market share
Assumption
In the log run the share of the systems is assumed to be constant.
Let - the share of store 1 in the long run be V1
- the share of store 2 in the long run be V2
n p n+1
(V1 V2) 0.9 0.1 = (V1 V2)
0.2 0.8
0.9V1 + 0.2V2 = V1
0.1V1 + 0.8V2 = V2
-V1 + 0.9V1 + 0.2V2 = 0
0.1V1 + 0.8V2 – V2 = 0
-0.1V1 + 0.2V2 = 0
0.1V1 + (0.2V2) = 0
Worksheet
1. Mandela has a total of br. 30,000 invested in two accounts that yields of 8% and 10%
interest per year respectively. If the interest Mandela receives from the two accounts in a
year is br. 2640, how much does he have invested in each account? ( solve by using both
inverse and Gaussian methods)
2. The total number of passengers riding a certain city bus during the morning shift is 1000.
If the child’s fare is br. 0.50, the adult fare is br. 1.50, and the total revenue from the fares
in the morning shift is br. 1300, how many children and how many adults rode the bus
during the morning shift? ( solve by using both inverse and Gaussian methods)
3. Two sociologists have grant money to study school busing in a particular city. They wish
to conduct an opinion survey using 600 telephone contacts and 400 house contacts.
Survey Company A has personnel to do 30 telephone and 10 house contacts per hour;
survey company B can handle 20 telephone and 20 house contacts per hour. How many
hours should be scheduled for each firm to produce exactly the number of contacts
needed? ( solve by using both inverse and Gaussian methods)
4. Kebede carpet co. has an inventory of 1,500 square yards of wool & 1,800 square yards
of nylon to manufacture carpeting. Two grades of carpeting are produced. Each roll of
superior grade carpeting requires 20 sq. yards of wool & 40sq. yards of nylon. Each roll
of quality-grade carpeting requires 30 square yards of wool & 30 square yard of nylon. If
Kebede would like to use all the material in inventory, how many rolls of superior & how
may rolls of quality carpeting should be manufactured? ( solve by using both inverse and
Gaussian methods)
5. A certain manufacturer produces two product P & q. Each unit of product P requires 20
units of row material A & 10 units of row material B. Each unit of product of requires 30
units of raw material A & 50 units of raw material B. there is a limited supply of 1200
units of raw material A & 950 units of raw material B. How many units of P & Q can be
produced if we want to exhaust the supply of raw materials? ( solve by using both inverse
and Gaussian methods)
6. Attendance records indicate that 80,000 South Koreans attended the 2002 world cup at its
opening ceremony. Total ticket receipts were Birr 3,500,000. Admission prices were Birr
37.5 for the second-class and Birr 62.50 for the first class. Determine the number of
South Koreans who attended the football game at first class and second class. ( solve by
using both inverse and Gaussian methods)
7. Getahun invested a total of br. 10,000 in three different saving accounts. The accounts
paid simple interest at an annual rate of 8%, 9% & 7.5% respectively. Total interest
earned for the year was br. 845. The amount in the 9% account was twice the amount
invested in the 7.5% account. How much did Getahun invest in each account? ( solve by
using both inverse and Gaussian methods)
8. A division of the ministry of public health has conducted a simple survey on the public
attitude towards smoking. From the results of the survey the department concluded that
currently only 20% of the population smokes cigarette & every month 10% of non-
smokers become smokers where as 5% of smokers discontinue smoking. Required:-
a) Write the current & transition matrices
b) b. What will be the proportion of the non-users (non-smokers) & users
(smokers) in the long run?
9. A vigorous television advertising campaign is conducted during the football reason to
promote a well-known brand X shaving cream. For each of several weeks, a survey is
made & it is found that each week 80% of those using brand X continue to use it & 20%
switch. It is also found that those not using brand X, 20% switch to brand X while the
other 80% continue using another brad.
a) Write the transition matrix, assuming the transition percentage continue to hold
for succeeding weeks.
b) b) If 20% of the people are using brand X at the start of the advertising
campaign, what percentage will be brand X 1week later? Two weeks later?
10. Populations of 100,000 consumers make the following purchases during a particular
week: 20,000 purchases Brand A, 35,000 Brand B & 45,000 purchase neither Brand.
From a market study, it is estimated that of those who purchase Brand A, 80% will
purchase it again next week, 15% will purchase brand B next week, & 5% will purchase
neither brand. Of those who purchase B, 85% will purchase it again next week, 12% will
purchase brand A next week, & 3% will purchase neither brand. Of those who purchase
neither brand, 20% will purchase A next week, 15% will purchase Brand B next week, &
65% will purchase neither brand next week. If this purchasing pattern continues what will
be the proportion in the next two weeks and in the long run?