Beruflich Dokumente
Kultur Dokumente
MATRIX: Definitions
Matrix: a rectangular array of numbers which we
double lines Denoted by bold capital letters Matrix has m rows and n columns
Definitions
Matrix: a rectangular array of numbers which we
treat as a single (collective) object Order of matrix = row X column Element of a matrix = element row column
Notation
Matrices are usually denoted using upper-case
letters, while the corresponding lower-case letters, with two subscript indices, represent the entries. In addition to using upper-case letters to symbolize matrices, many authors use a special typographical style, commonly boldface upright (non-italic), to further distinguish matrices from other mathematical objects. An alternative notation involves the use of a double-underline B name, with or without boldface with the variable style, e.g.,.
4
Definitions
Matrix Short notation
a11
a12
Types of Matrices
Square Matrix; Row Matrix; Column Matrix;
Diagonal Matrix; Unit Matrix; Zero Matrix; Scalar Matrix; Sub Matrix; Symmetric Matrix
Definition
A square matrix is a matrix with the same number
of rows and columns. An n-by-n matrix is known as a square matrix of order n. Any two square matrices of the same order can be added and multiplied. A square matrix A is called invertible or non-singular if there exists a matrix B such that AB = In.
Definitions
Vector: a matrix containing a single row (row
vector) or single column (column vector) Square matrix: same # rows and columns
Definitions
Diagonal matrix: one or more non-zero values on
1 0 0 0 5 0 0 0 8
9
Definitions
Scalar matrix: diagonal matrix with same non-
5 0 0 0 5 0 0 0 5
10
Definitions
Unity or identity matrix is special case of scalar
1 0 0 0 1 0 0 0 1
11
Definitions
Symmetric Matrix: matrix remains unchanged
12
Definitions
Equality: two matrices of same order and with all equal elements
AssumeA =
1 2 3 2
and B =
y 2
13
Matrix Operations
In matrix algebra, an ordinary number is called a scalar.
scalar.
The scalar often known as scaling factor
12
14
3 -1 6 4
36 - 12 72 48
4 3 2 4 6 =? 4 5 3 7 2 4 3 2 4 6 2 =? 4 5 3 7 2 1
15
16
Matrix Multiplication
Scalar can be used to multiply a matrix of any
dimension Multiplication of two matrices is contingent upon the satisfaction of different dimensional requirement
Given two matrices A and B and we want to find AB.
The conformability condition for multiplication is that the column of A (lead matrix) must be equal to the row dimension of B (lag matrix)
17
Amn B pq = Cmq [m = p] A = a11 a12 b13 b23 a11b12 + a12b22 a11b13 + a12b23
B=
C = AB = a11b11 + a12b21
18
Example
1 3 A= 2 8 4 0 B= 5 2 9 3 A B = ?
19
Laws
A commutative law for matrix multiplication
hold
A (B C) = (A B) C = A B C
The product of any matrix and the zero matrix is
zero matrix
A O = O A= O
20
Identity Matrix
A I = A and
I A=A The role of identity (I) matrix is analogous to the role of the number 1.
1 0 0 1
2 1 0 5
2 1 0 5
21
15.
17.
22
Problem 21
Interest at the rates 0.06, 0.07, and 0.08 is
earned on respective investments of $3000, $2000 and $4000. Compute the total interest by matrix multiplication.
23
Problem 22
Two canned meat spreads, Regular and Superior, are made by
grinding beef, pork and lamb together. The numbers of pounds of each meat in a 15-pound batch of each brand are in the following table. Suppose we wish to make 10 batches of Superior and 20 of Regular. Multiply the meat matrix in the table and the batch vector ( 10 20) and interpret the result. Suppose that the per pound prices of beef, pork, and lamb are $2.50, $2.00, and $3.00, respectively. Multiply the price vector and the meat matrix and interpret the results.
Brand Beef Superior Regular
24
Basic Operations
Transposition of vector or matrix from A to A': a11
a c
25
b d
b d
Transpose
Transpose: Swap rows with columns
a M = d g b e h c f i
a MT = b c
V T = [x
d e f
g h i
z]
V=
x y z
26
Basic Operations
Transposition of vector or matrix from A to A': a11
a c
27
b d
b d
Transpose
Transpose: Swap rows with columns
a M = d g b e h c f i
a MT = b c
V T = [x
d e f
g h i
z]
V=
x y z
28
Transpose of a Matrix
A matrix obtained by interchanging rows and columns.
29
Inverse of a Matrix
a(a ) = 1 a -1 is the multiplica tive inverse of a because the product of a and a -1 is the identity. Two square matrices are inverses of each other if their productis the identity matrix I. AA = I
30
-1
-1
1 0 0 1
a b
31
3 2 -1 A = 1 -1 0 2 0 -1
32
1 2 -1 1 -1 A = 1 -1 -1 3 2 4 -5
Conditions of Inverse
It is a square matrix
33
What is determinants?
A useful number associated with an n n matrix
Cij (1)
M ij
Mij is the determinant obtained by deleting the ith row and jth column of A.
35
(- 1)
i+ j
+
+ + +
+ +
+ + -
+ +
+ +
+ i+ j
Cij = (-1) M ij
36
adjoint of A is defined to be transpose of matrix [Aij]nxn, where Aij is co-factor of aij in |A|.
37
Example
4 A= 0 3 4 B = -2 3
38
1 3 0 1 3 -1
-1 2 7 -5 1 4
Inverse of a Matrix
Inverse of a square
matrix is:
1 A AdjA A
1
det( A) 0
39
Solution of Equation
Transform the equations in matrices Ax = d A = coefficient matrix x = variable matrix d = RHS values Calculate the determinant of A .|A| Calculate the cofactor matrix Calculate the Adj. A (Transpose of cofactor matrix) 8. Find the inverse of a matrix A-1= Adj A/|A| 9. Solve x = A-1d
1. 2. 3. 4. 5. 6. 7.
40
Example
A manufacturer produces three products: P, Q and R which he sells in two markets. Annual sales volume are indicated as follows:
Market . I II . P 10,000 6,000 Product Q 2,000 20,000 R 18,000 8,000 . . .
(i) If unit sale prices of P, Q, and R are Tk. 2.50, 1.25 and 1.50 respectively, find the total revenue in each market with the help of matrix algebra. (ii)If the unit costs of the above 3 commodities are Tk. 1.80, 1.20 and 0.80 respectively, find the gross profit.
41
Basic Applications
Consider 2 equations, 2 unknowns:
2x + 3y = 5 3x + 2y = 5
a=
42
2 3
,b =
3 2
,c =
5 5
Basic Applications
Why this works:
Recall matrix (vector) addition rule
2x
3y
(2 x + 3 y )
43
x+ y+z =6 4x - 2 y + z = 9 3x - y + z = 4
44
Inverse of a Matrix
Inverse of a square
matrix is:
1 A = adj A A
1
45
Solution of Equation
Ax = d x = dA
1
1.
2. 3. 4. 5. 6. 7. 8. 9.
46
Transform the equations in matrices Ax = d A = coefficient matrix x = variable matrix d = RHS values Calculate the determinant of A .|A| Calculate the cofactor matrix Calculate the Adj. A (Transpose of cofactor matrix) Find the inverse of a matrix A-1= Adj A/|A| Solve x = A-1d
Example
2 x1 - 3x 2 = 6 x1 + 5 x2 = 29 3x1 - 4x 2 = 11
47
Markov Process
Markov Property: The state of the system at time t+1 depends only on the
Pr [X t +1 = xt +1 | X 1 X t = x1 xt ] = Pr [X t +1 = xt +1 | X t = xt
X1 X2 X3 X4 X5
48
Markov Process
Simple Example
Weather: raining today 40% rain tomorrow 60% no rain tomorrow not raining today
0.6
0.8
rain
0.2
no rain
49
Markov Process
Simple Example
Weather: raining today 40% rain tomorrow 60% no rain tomorrow not raining today
P=
Stochastic matrix: Rows sum up to 1 Double stochastic matrix: Rows and columns sum up to 1
50
Markov Process
Gamblers Example Gambler - At
0
1-p
1
1-p
2
1-p 1-p
99
100
Start (10$) 51
Markov Process
Markov process - described by a stochastic FSM
0
1-p
1
1-p
2
1-p 1-p
99
100
Start (10$)
52
Markov Process
Coke vs. Pepsi Example Given that a persons last cola purchase was Coke, there is a 90% chance that his next cola purchase will also be Coke. If a persons last cola purchase was Pepsi, there is an 80% chance that his next cola purchase will also be Pepsi.
transition matrix:
0.9 coke
0.8
P=
Markov Process
Coke vs. Pepsi Example (cont)
Given that a person is currently a Pepsi purchaser, what is the probability that he will purchase Coke two purchases from now?
0.2 * 0.9
0.8 *
0.2
= 0.34
0 . 9 0 . 1 2 P = P 0.2 0.8
Pepsi ?
Markov Process
Coke vs. Pepsi Example (cont)
Given that a person is currently a Coke purchaser, what is the probability that he will purchase Pepsi three purchases from now?
P =
55
Markov Process
Coke vs. Pepsi Example (cont)
Assume each person makes one cola purchase per week Suppose 60% of all people now drink Coke, and 40% drink Pepsi What fraction of people will be drinking Coke three weeks from now?
P=
P =
56
Markov Process
Coke vs. Pepsi Example (cont)
Simulation:
2/3
[
Pr[Xi = Coke]
= [2 3
stationary distribution
0.9
0.1
0.8
coke
0.2
pepsi
week - i
57
Steady State
A steady state vector is the state vector that
58
Example
What is steady state
matrix?
v1 v2
v1 + v2 = 1
59
Example
Absorbing Markov
Stationary Markov
.6 .4
60