Professional Documents
Culture Documents
Review of Vectors and Matrices: Appendix D
Review of Vectors and Matrices: Appendix D
Review of Vectors
and Matrices
D.1 VECTORS
D.1.1 Definition of a Vector
Let p1, p2, Á , pn be any n real numbers and P an ordered set of these real numbers—
that is,
P = 1p1, p2, Á , pn2
Then P is an n-vector (or simply a vector). The ith component of P is given by pi. For
example, P = 11, 22 is a two-dimensional vector.
P + Q = Q + P 1Commutative law2
1P ; Q2 ; S = P ; 1Q ; S2 1Associative law2
P + 1-P2 = 0 1zero or null vector2
CD-145
CD-146 Appendix D Review of Vectors and Matrices
a ujPj = 0 Q uj = 0, j = 1, 2, Á , n
j=1
If
n
then the vectors are linearly dependent. For example, the vectors
P1 = 11, 22, P2 = 12, 42
are linearly dependent because for u1 = 2 and u2 = -1,
u1P1 + u2P2 = 0
D.2 MATRICES
D.2.1 Definition of a Matrix
A matrix is a rectangular array of elements. The element aij of the matrix A occupies
the ith row and jth column of the array. A matrix with m rows and n columns is said to
be of size (or order) m * n. For example, the following matrix is of size 14 * 32.
¥ = 7aij 7 4 * 3
a a22 a23
A = § 21
a31 a32 a33
a41 a42 a43
D.2.2 Types of Matrices
1. A square matrix has m = n.
2. An identity matrix is a square matrix in which all the main diagonal elements
equal 1 and all the off-diagonal elements equal zero. For example, a 13 * 32
identity matrix is given by
1 0 0
I3 = £ 0 1 0 ≥
0 0 1
D.2 Matrices CD-147
A = a b, B = a b
1 3 5 7 9
2 4 6 8 0
we have
11 * 5 + 3 * 6211 * 7 + 3 * 8211 * 9 + 3 * 02
D = a ba b = a b
1 3 5 7 9
2 4 6 8 0 12 * 5 + 4 * 6212 * 7 + 4 * 8212 * 9 + 4 * 02
= a b
23 31 9
34 46 18
B11 B12
A = a b, B = £ B21 B22 ≥
A 11 A 12 A 13
A 21 A 22 A 23
B32 B32
The partitioning assumes that the number of columns of A ij is equal to the number of
rows of Bij for all i and j. Then
A * B = a b
A 11B11 + A 12B21 + A 13B31 A 11B12 + A 12B22 + A 13B32
A 21B11 + A 22B21 + A 23B31 A 21B12 + A 22B22 + A 23B32
For example,
112142 + 12 32a b
1 4 + 2 + 24
12 3 4 30
8
£1 0 5≥ £1≥ = § ¥ = § ¥ = £ 44 ≥
a b142 + a ba b a b + a b
1 0 5 1 4 40
25 6 8 61
2 5 0 8 8 53
such that each column and each row of A is represented exactly once among the sub-
scripts of j1, j2, Á , and jn. Next, define
H j1j2 Ájn = e
1, j1 j2 Á jn even permutation
0, j1 j2 Á jn odd permutation
D.2 Matrices CD-149
Let r represents the summation over all n! permutations, then the determinant of
A, det A or ƒ A ƒ , is computed as
As an illustration, consider
a11 a12 a13
A = £ a21 a22 a23 ≥
a31 a32 a33
Then
ƒ A ƒ = a111a22 a33 - a23 a322 - a121a21 a33 - a31 a232 + a131a21 a32 - a22 a312
The properties of a determinant are:
1. The value of the determinant is zero if every element of a row or a column is zero.
2. ƒ A ƒ = ƒ AT ƒ .
3. If B is obtained from A by interchanging any two rows or any two columns, then
ƒBƒ = - ƒAƒ.
4. If two rows (or two columns) of A are multiples of one another, then ƒ A ƒ = 0.
5. The value of ƒ A ƒ remains the same if scalar a times a column (row) vector is
added to another column (row) vector.
6. If every element of a column or a row of a determinant is multiplied by a scalar
a, the value of the determinant is multiplied by a.
7. If A and B are two n-square matrices, then
ƒ AB ƒ = ƒ A ƒ ƒ B ƒ
Definition of the Minor of a Determinant. The minor Mij of the element aij in the
determinant ƒ A ƒ is obtained from the matrix A by striking out the ith row and jth
column of B. For example, for
a11 a12 a13
A = £ a21 a22 a23 ≥
a31 a32 a33
Definition of the Adjoint Matrix. Let A ij = 1-12i + jMij be defined as the cofactor of
the element aij of the square matrix B. Then, the adjoint matrix of A is the transpose of
7A ij 7, and is defined as:
A 11 A 21 Á A n1
adj A = 7A ij 7 T
A A 22 Á A n2
= § 12 ¥
o o o o
A 1n A 2n Á A nn
CD-150 Appendix D Review of Vectors and Matrices
For example, if
1 2 3
A = £2 3 2≥
3 3 4
1 2 3
A = £2 3 4≥
3 5 7
a b = -1 Z 0
1 2
2 3
Theorem. If BC = I and B is nonsingular, then C = B-1, which means that the inverse
is unique.
Proof. By assumption,
BC = I
then
B-1BC = B-1I
or
IC = B-1
D.2 Matrices CD-151
or
C = B-1
where xi represents the unknowns and aij and bi are constants. These n equations can
be written in matrix form as
AX = b
Because the equations are independent, A must be nonsingular. Thus
A-1AX = A-1b
or
X = A-1b
1
TORA’s inverse module is based on LU decomposition method. See Press and Associates (1986)
CD-152 Appendix D Review of Vectors and Matrices
Hence
6 1 -5 - 67 - 17 5
7
1
A-1 = £ -2 -5 4 ≥ = £ 72 5
7 - 47 ≥
-7 3
-3 3 -1 7 - 37 1
7
1 2 3 x1 3
£2 3 2 ≥ £ x2 ≥ = £ 4 ≥
3 3 4 x3 5
The solution of X and the inverse of the basis matrix can be obtained directly by
considering
A-11A I b2 = 1I A-1 A-1b2
Iteration 0
1 2 3 1 0 0 3
£2 3 230 1 0 3 4≥
3 3 4 0 0 1 5
Iteration 1
1 2 3 1 0 0 3
£0 -1 -4 3 -2 1 0 3 -2 ≥
0 -3 -5 -3 0 1 -4
Iteration 2
1 0 -5 -3 2 0 -1
£0 1 43 2 -1 0 3 2≥
0 0 7 3 -3 1 2
Iteration 3
6
1 0 0 -7 - 17 5
7
3
7
£0 1 0 3 72 5
7 - 47 3 67 ≥
0 0 1 3 2
7 - 37 1
7 7
D.2 Matrices CD-153
This gives x1 = 37, x2 = 67, and x3 = 27. The inverse of A is given by the right-hand-side
matrix, which is the same as obtained by the method of adjoint matrix.
Product Form of the Inverse. Suppose that two nonsingular matrices, B and Bnext, dif-
fer exactly in one column. Further, assume that B-1 is given. Then the inverse Bnext
-1
can
be computed using the formula
Bnext
-1
= EB-1
The matrix E is computed in the following manner. If the column vector Pj in B is re-
placed with the column vector Pr to produce Bnext, then E is constructed as an m-iden-
tity matrix with its rth column replaced by
-1B-1Pj21
-1B-1Pj22
, 1B-1Pj2r Z 0
1 o
¶ ∂
1B-1Pj2r
j =
+1 ; rth place
o
-1B-1Pj2m
Because Bnext differs from B only in that its rth column is replaced with Pj, then
Bnext = BF
Thus,
Bnext
-1
= 1BF2-1 = F -1B-1
In general, if we construct Bi as an identity matrix with its first i columns replaced with
the first i columns of B, then
Bi-1 = EiBi-1
- 1 = E iE i - 1Bi - 2 =
-1 Á = EiE i - 1 Á E1
The following example illustrates the application of the product form of the in-
verse. Consider
2 1 0
B = £0 2 0≥
4 0 1
Iteration 0
1 0 0
B0 = B0-1 = £0 1 0≥
0 0 1
Iteration 1
2 0 0
B1 = £ 0 1 0≥
4 0 1
2 ;r = 1
B0-1P1 = P1 = £ 0 ≥
4
+ 12 0 0
E1 = £ - 02 1 0≥
- 42 0 1
1
2 0 0
B1-1 = £ 0 1 0≥
-2 0 1
Iteration 2
2 1 0
B2 = £ 0 2 0≥ = B
4 0 1
1 1
2 0 0 1 2
B1-1P2 = £ 0 1 0≥ £2≥ = £ 2≥ ; r = 2
-2 0 1 0 -2
1
2
1 - 0
2 1 - 14 0
E2 = § 0 + 12 0¥ = £0 1 0≥
2
0 - -22 1 0 1 1
1 - 14 0 1
2 0 0 1
2 - 14 0
B -1
= B2-1 = E2B1-1 = £0 1 0 ≥£ 0 1 0≥ = £ 0 1 0≥
2 2
0 1 1 -2 0 1 -2 1 1
D.2 Matrices CD-155
Partitioned Matrix Method. Suppose that the two n-nonsingular matrices A and B be
partitioned as shown as follows:
A 11 A 12
1p * p2 1p * q2
A = § ¥ , A 11 nonsingular
A 21 A 22
1q * p2 1q * q2
B11 B12
1p * p2 1p * q2
B = § ¥
B21 B22
1q * p2 1q * q2
A 11B11 + A 12B21 = I p
A 11B12 + B12A 22 = 0
B21A 11 + B22A 21 = 0
B21A 12 + B22A 22 = I q
Because A 11 is nonsingular, A 11
-1
exists. Solving for B11, B12, B21, and B22, we get
B11 = A 11
-1
+ 1A 11
-1
A 122D -11A 21 A 11
-1
2
B12 = -1A 11 A 122D
-1 -1
B21 = -D -11A 21 A 11
-1
2
B22 = D -1
where
D = A 22 - A 211A 11
-1
A 122
12 3
A = £2 3 2≥
33 4
such that
In this case, A 11
-1
= 1 and
D = a b - a b11212, 32 = a b
3 2 2 -1 -4
3 4 3 -3 -5
5
- 47
D -1 = - 17 a b = a 73 1b
-5 4
3 -1 -7 7
Thus,
B11 = A - 67 B , B12 = A - 17 5
7 B
2 5
- 47
B12 = a 73 b, B22 = a 7
1b
7 - 37 7
1. Transpose.
2. Multiplication.
3. Inverse of a nonsingular matrix.
4. Determinant value of a nonsingular matrix.
In Example 2, the elements of the input matrices A and B are entered in the re-
spective ranges A10:C13 and A16:A18. The output matrix is in the (user-selected)
range E10:E13. Next enter the formula = MMULT(A10:C13,A16:A18) in cell E10
and follow steps 2 through 4 exactly as in Example 1 (replacing E4:F6 with E10:E13).
Notice that MMULT(A16:A18,A10:C13) is undefined. In Example 3, the inverse of
the matrix in the range A22:C24 is assigned to the range E22:G24 by entering the
formula = MINVERSE1A22 : C242 in cell E22, then following steps 2, 3, and 4 as in Ex-
ample 1. Finally, in Example 4, the determinant of the matrix in the range A28:C30 is ob-
tained by entering the formula = MDETERM1A28 : C302 in the user-selected cell E28.
D.3 Quadratic Forms CD-157
FIGURE D.1
Matrix manipulations using Excel (file excelMatManip.xls)
is called a quadratic form. The matrix A can always be assumed symmetric because
1a ij + a ji2
each element of every pair of coefficients aij and aij 1i Z j2 can be replaced by 2
without changing the value of Q(X).
As an illustration, the quadratic form
1 0 1 x1
Q1X2 = 1x1, x2, x32 £ 2 7 6 ≥ £ x2 ≥
3 0 2 x3
is the same as
1 1 2 x1
Q1X2 = 1x1, x2, x32 £ 1 7 3 ≥ £ x2 ≥
2 3 2 x3
Note that A is symmetric in the second case. We will assume henceforth that A is al-
ways symmetric.
The quadratic form is said to be
It can be proved that the necessary and sufficient conditions for the realization of
the preceding cases are
†
The kth principal minor determinant of A n * n is defined by
PROBLEMS
1. Show that the following vectors are linearly dependent.
1 -2 1
(a) £ -2 ≥ £ 4 ≥ £ -2 ≥
3 -2 -1
2 4
-3 -6
(b) § ¥ § ¥
4 8
5 10
2. Given
1 4 9 7 -1 2
A = £2 5 -8 ≥, B = £ 9 4 8≥
3 7 2 3 6 10
find
(a) A + 7B
(b) 2A - 3B
(c) 1A + 7B2T
3. In Problem 2, show that AB Z BA
4. Consider the partitioned matrices
1 5 7
2 3 -4 5
2 -6 9
A = § ¥, B = £1 2 6 7≥
3 7 2
3 1 0 9
4 9 1
6. Consider
5
2 1 2 4 - 58 - 38
1 1
B = £0 2 1 ≥, B = £ 2
-1
4 - 14 ≥
1 1
4 0 5 -1 2 2
Suppose that the third vector P3 is replaced with the V3 = P1 + 2P2. This means that the
resulting matrix is singular. Show how the product form of the inverse discovers the singu-
larity of the matrix.
7. Use the product form of the inverse to verify whether each of the following equations
has a unique solution, no solution, or an infinity of solutions.
(a) x1 + 2x2 = 3
x1 + 4x2 = 2
(b) x1 + 2x2 = 5
-x1 - 2x2 = -5
(c) x1 + 7x2 + x3 = 5
4x1 + x2 + 3x3 = 8
x1 + 3x2 - 2x3 = 3
8. Verify the formulas given in Section B.2.7 for obtaining the inverse of a partitioned matrix.
9. Find the inverse of
A = a b, B nonsingular
1 G
H B
12. Show that the function f1x2 = ex is strictly convex over all real values of x.
13. Show that the quadratic function
is strictly convex.
14. In Problem 13, show that -f1x1, x2, x32 is strictly concave.
SELECTED REFERENCES
Hadley, G., Matrix Algebra, Addison-Wesley, Reading, MA, 1961.
Hohn, F., Elementary Matrix Algebra, 2nd ed., Macmillan, New York, 1964.
Press, W., B. Flannery, B. Teukolsky, and W. Vetterling, Numerical Recipes: The Art of Scientific
Computing, Cambridge University Press, Cambridge, England, 1986.