Matrix
Matrix
TOPIC 3
https://www.coursera.org/lecture/machine-
learning/matrices-and-vectors-38jIT
Objectives of the Topic
2
Addition of Matrix
Product of Matrix
Inverse of Matrix
Application in Simultaneous Linear Equation, Brand
Switching, HRP, Input-Output Analysis
Definition
4
2 3 1
5 4 2
This is a 2 × 3 matrix because it has 2 rows and 3
columns.
Some types of Matrix
5
a11 a12
a11 a22 a12 a21
a21 a22
a11 a12 a13
a21 a22 a23
a31 a32 a33
a22 a23 a21 a23 a21 a22
a11 a12 a13
a32 a33 a31 a33 a31 a32
Determinant
7
p q q r r p p q r
(i ) q r r p p q 2 q r p,
r p p q q r r p q
1 1 1 x y z
ii x y z x2 y2 z2
yz zx xy 1 1 1
Addition of Two Matrix
10
2 3 1 1 3 2
1 0 2 1 1 1
Scalar Multiplication
11
8 4 0 x 3x x 2 3x 1 3 y 3w
4 A , xB
, A 3C
12 20 12 5 x 6 x 0 3 3z 3t 8 6
Properties of Matrix Addition
12
13
2 1 5
2 3
1 1
3 1 0
5 0
Product of Two Matrix
14
The product AB of a row The Product of Two
matrix A and a column Matrices: General Case
matrix B is a 1 × 1 In general for matrices A
matrix. The length of the and B, we can take the
row in A must match the product AB only if the
length of the column in B for
the product to be defined. To number of columns of A
find the product, multiply equals the number of rows
of B (so that we can multiply
each entry in A (going from the rows of A by thecolumns
left to right) by the of B as above).
corresponding entry in B The product AB is then
(going from top to bottom) obtained by taking its i jth
and then add the results. entry to be:
i jth entry of AB = Row i of
A × Column j of B
Multipication Example
15
The A-Plus auto parts store had the following sales in its
Vancouver store:
Vancouver
Wiper 20
blades
Cleaning 10
Fluid Bottle
Floormat 8
The store sells wiper blades for $7.00 each, cleaning fluid
for $3.00 per bottle, and floor mats for $12.00 each. Use
matrix multiplication to find the total revenue generated
by sales of these items.
Ans 266
Application of Product of Matrix
16
Products
Markets A B C
I 8000 10000 15000
II 10000 2000 20000
2.25
Total Revenue 8000 10000 15000 59250
1.50
10000 2000 20000 1.75 60500
2.25 1.6
Total gross profit 8000 10000 15000 20950
1.50 1.20
10000 2000 20000 1.75 0.9 24100
Brand Switching Problem
18
At equilibrium state
0.5P1+0.2P2+0.1(1-P1-P2)=P1 (1)
0.4P1+0.7P2+0.2(1-P1-P2)=P2 (2)
0.1P1+0.1P2+0.7P3=P3 (3)
P1 =0.25, P2=0.5, P3=0.25
Brand Switching Problem
20
A0.9 0.1
From
B 0.5 0.5
What will be market share after 2 years
Determine their market share in steady state.
P1=0.8333 P2=0.167
An Application to Manpower Planning
21
A finance company has offices location in every division, every
district and every taluq in a certain state in India. Assume there are
five divisions, thirty districts and 200 taluqs in the state. Each office
has one head clerk, one cashier, one clerk and one peon. A division
office has in addition one office superintendent, two clerks, one
typist and one peon. A district office has in addition, one clerk and
one peon. Record the set up in matrix form
5 30 200
Division District Taluq 13
Division 1 0 1 1 1 1 2 11
District 0 0 1 1 11 11
Taluq 0 0 1 1 1 1
Superitend ent Typist Head clerk Cashier clerk Peon 36
The total number of posts of each kind in all offices taken together.
Division 1675
District 875
625
Taluq 31
23
In 2003, the population of the U.S., broken down by regions, was 53.3 million in the
Northeast, 64.0 million in the Midwest, 101.6 million in the South, and 65.4 million
in the West.14 The matrix P below shows the population movement during the
period 2003–2004. (Thus, 98.79% of the population in the Northeast stayed there,
while 0.20% of the population in the Northeast moved to the Midwest, and so on.)
To To To To
NE MW S W
P= From NE 0.9879 0.0020 0.0081 0.0019
From MW 0.0014 0.9895 0.0063 0.0028
From S 0.0027 0.0025 0.9927 0.0022
FromW 0.0010 0.0030 0.0050 0.9909
Set up the 2003 population figures as a row vector. Then use matrix multiplication
to compute the population in each region in 2004.
25
3 5 1
Cofactor of matrix A 3 3 3
6 4 2
3 3 6
Adjoint A Transpose of cofactor matrix 5 3 4
1 3 2
3 3 6 0.5 0.5 1
adj A 1
A -1 5 3 4 0.8333 0.5 0.67
A 6
1 3 2 0.167 0.5 0.33
Solving simultaneous equation
29
Suppose an economic system has several different industries, each of which has
certain input requirements, as well as some sort of product or output. Let us
consider three producers farmers (food), carpenters (tools) and Tailors
(clothes). Assume for convenience that each group produces 1 unit per year of
whatever they produce. Suppose that during the year, the portion of each
commodity consumed by each group is given by
Goods Produced by
Farmers Carpenters Tailors
Goods
Consume Farmers 7/16 1/2 3/16
d by
Carpenters 5/16 1/6 5/16
Tailors 1/4 1/3 1/2
Input-Output Analysis
32
An economy produces only coal and steel. The two commodities serve as an
intermediate inputs in each other’s production. 0.4 tonne of steel and 0.1
tonne of coal are needed to produce a tone of steel. Similarly, 0.7 tonne of
steel and 0.6 tonne of coal are required to produce a tone of coal. No
capital inputs are needed. Do you think that the system is viable? 10 and 3
labour days are required to produce a tonne of coal and steel respectively. If
the external economy needs 400 tonne of steel and 200 tonne of coal,
calculate the gross output of the two commodities and total labour
required.
Since determinant is positive and diagonal elements are non-zero. So the
system is viable. The total output of steel and coal will be
Input-Output Analysis-Open
36
1
Steel 0.6 0.1 400
Coal 0.7 0.4 200
Steel = 1058.324
Coal=2352.941
Input-Output Analysis
37