You are on page 1of 65

Topic 2: Matrices

FIN2009 Management Mathematics


Department of Finance
National Taiwan University

Dr. Sandy Lai


1
Definition of a matrix
A matrix is a rectangular array of numbers, and each of the
numbers in the matrix is called an entry.
Examples of matrices:

4 3 0 6 1 0 7 10 1 12
0 2 4 7 1 3 , 8 0 2 , 4 ,
2
6 1 15 1⁄2 1 0 9 3 0 17
3 1 12 0 9 , 2
Size of a matrix (with n rows and m columns): n×m.
A square matrix: A matrix with the same number of rows and
columns.
A column matrix: A matrix that has a single column.
A row matrix: A matrix that has a single row.
• Column matrices and row matrices are sometimes called
column vectors and row vectors, respectively.
2
Notations
Upper case letters are generally used to refer to matrices, and lower
case letters are generally used to refer to numbers.
The entry in the ith row and jth column of a matrix A is denoted by
𝑎 or 𝐴 .
• In the first notation, the lower case letter we use to denote the
entries of a matrix will always match with the upper case letter
we use to denote the matrix.
Using the lower case notation we can denote a general n×m matrix,
A, as follows,
𝑎 𝑎 … 𝑎 𝑎 𝑎 … 𝑎
𝑎 𝑎 … 𝑎 𝑎 𝑎 … 𝑎
𝐴 ⋮ ⋮ ⋱ ⋮ OR 𝐴 ⋮ ⋮ ⋱ ⋮
𝑎 𝑎 ⋯ 𝑎 𝑎 𝑎 ⋯ 𝑎

Some more compact notations for a matrix are 𝑎 , 𝑎 ,𝐴 .


• We’ll denote the size if needed for whatever we’re doing.
3
There are main exceptions to the upper case/lower case convention
for matrices and their entries as follows:
• Column and row matrices tend to be denoted with a lower
case letter that are boldfaced or has an arrow over it as follows,

𝑎
𝑎
𝐚 𝑎⃑ ⋮ b =𝑏 𝑏 𝑏 … 𝑏
𝑎
• The entries are still denoted with lower case letters that match
the letter that represents the matrix.
In a square matrix, the entries a11, a22 ,…, ann are called the main
diagonal.
𝑎 𝑎 … 𝑎
𝑎 𝑎 … 𝑎
⋮ ⋮ ⋱ ⋮
𝑎 𝑎 ⋯ 𝑎
4
Matrix Partition
Any matrix can be partitioned into smaller submatrices simply by
adding in horizontal and/or vertical lines between selected rows
and/or columns.
Examples:
𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝒓
𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝒓
𝐴 𝐴
𝐴 𝑎 𝑎 𝑎
𝐴 𝐴
,𝐴 𝑎 𝑎 𝑎 𝒄 | 𝒄 | 𝒄 ,𝐴 𝑎 𝑎 𝑎 𝒓
𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝒓
𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝑎 𝒓

• We can partition A into four submatrices: A11 is a 21 submatrix,


A12 is a 22 submatrix, A21 is a 31 submatrix, and A22 is a 32
sub matrix of A.
• The ci in the partitioned matrix are sometimes called the column
matrices (or vectors) of A.
• The ri are sometimes called the row matrices (or vectors) of A.
5
Some special matrices

The zero matrix: It is an n×m matrix whose entries are all zeroes.
It is denoted by 0n×m or just 0 if the size of the matrix is clear from
the context of the problem..
• E.g., 0
0 0 0 0
0 , 𝟎 0 0 0 0 , 𝟎 0
0 0 0 0
0
The identity matrix: It is a square n×n matrix, whose the main
diagonal entries are all ones and the other entries are all zeroes. It
is denoted by In or just I.
1 0
• E.g., 𝐼
0 1

6
Reduced row-echelon form for a square matrix
Theorem 1: If A is an n×n matrix, then the reduced row-echelon
form of the matrix will either contain at least one row of all zeroes
or it will be In, the n×n identity matrix.

7
Matrix arithmetic & operations
Definition 1: If A and B are both n×m matrices, then A = B if
corresponding entries from each matrix are equal, i.e., 𝑎 𝑏 for
all i and j.
Definition 2: If A and B are both n×m matrices, then A± B is a new
n×m matrix, with 𝑨 𝑩 𝒂𝒊𝒋 𝒃𝒊𝒋 , for all i and j.
Definition 3: If A is any matrix and c is any number, then the
product (or scalar multiple), cA, is a new matrix of the same size,
𝒄𝑨 𝒄 𝒂𝒊𝒋 , for all i and j.
• In the field of Linear Algebra, a number is often called a scalar.
Since we are multiplying a matrix by a scalar, we call the
product ‘scalar multiple.’
Definition 4: If A1, A2, …, An are all matrices of the same size, and
c1, c2,…, cn are scalars, then the linear combination of A1, A2, …,
An with coefficients 𝑐 , 𝑐 , … , 𝑐 is, 𝒄𝟏 𝑨𝟏 𝒄𝟐 𝑨𝟐 ⋯ 𝒄𝒏 𝑨𝒏 .

8
Matrix multiplication
Suppose that we have two matrices, a and b. Their product is
defined as,

𝑏
𝑎 𝑎 … 𝑎 𝑏
𝐚 𝐛 , 𝐚𝐛 𝑎 𝑏 +𝑎 𝑏 +…+𝑎 𝑏

𝑏
• This product is defined only if a and b have the same number of
entries.
Definition 5: If A is an n×p matrix and B is a p×m matrix then the
product (or matrix multiplication) is a new matrix with size n×m.
The entry in the ith row and jth column of AB is given by the
following formula,
𝐴 𝐵 𝐴𝐵
𝑛 𝑝 𝑝 𝑚 𝑛 𝑚

𝑨𝑩 𝒊𝒋 𝒂𝒊𝟏 𝒃𝟏𝒋 𝒂𝒊𝟐 𝒃𝟐𝒋 𝒂𝒊𝟑 𝒃𝟑𝒋 ⋯ 𝒂𝒊𝒑 𝒃𝒑𝒋 ∑𝒑𝒌 𝟏 𝒂𝒊𝒌 𝒃𝒌𝒋 .
9
Example: Matrix multiplication
Compute BD and DB for the given matrices, if possible.

3 1 7 1 4 9
𝐵 10 1 8 D 6 2 1
5 2 4 7 4 7

Solution:

10
Matrix multiplication (alternative method 1)
Theorem 2: Assume that A and B are appropriately sized so that
AB is defined. Then, we can use the idea of a partitioned matrix to
derive new ways of finding the product of two matrices.
• Suppose we have two matrices An×p and Bp×m. Then, the product
AB can then be computed as follows.

𝑎 𝑎 … 𝑎 𝒓𝟏 𝑏 𝑏 … 𝑏
𝑎 𝑎 … 𝑎 𝒓𝟐 𝑏 𝑏 … 𝑏
• 𝐴 ⋮ ⋮ ⋱ ⋮ ⋮ ,B ⋮ ⋮ ⋱ ⋮
𝒄𝟏 𝒄𝟐 … 𝒄𝒎
𝑎 𝑎 ⋯ 𝑎 𝒓𝒏 𝑏 𝑏 ⋯ 𝑏

𝒓𝟏 𝒓𝟏 𝐵
𝒓𝟐 𝒓𝟐 𝐵
𝐴𝐵 , 𝐴 𝒄𝟏 𝒄𝟐 … 𝒄𝒎 𝐴𝒄𝟏 𝐴𝒄𝟐 … 𝐴𝒄𝒎
⋮ 𝐵 ⋮
𝐴𝐵
𝒓𝒏 𝒓𝒏 𝐵

• The ith row of AB is given by: [ith row of A] B.


• The jth column of AB is given by: A [jth column of B]. 11
Example: Matrix multiplication
Use both of the new methods for computing products to find AC for
the following matrices.

8 5 3
1 3 0 4 3 10 2
𝐴 C
2 5 8 9 2 0 4
1 7 5
𝑟 1 3 0 4 𝑟 2 5 8 9
Solution:

8 5 3
𝑟𝐶 3 10 2
1 3 0 4 13 53 17
2 0 4
1 7 5

8 5 3
𝑟𝐶 3 10 2
2 5 8 9 56 23 81
2 0 4
1 7 5
𝑟𝐶 13 53 17
𝐴𝐶 12
𝑟𝐶 56 23 81
8 5 3
3 10 2
𝒄 𝒄 𝒄
2 0 4
1 7 5

8
1 3 0 4 3 13
𝐴𝒄
2 5 8 9 2 56
1
5
1 3 0 4 10 53
𝐴𝒄
2 5 8 9 0 23
7
3
1 3 0 4 2 17
𝐴𝒄
2 5 8 9 4 81
5

𝐴𝒄 𝐴𝒄 𝐴𝒄 13 53 17
𝐴𝐶
56 23 81

13
Matrix multiplication (alternative method 2)
We can also write certain kinds of matrix products as a linear
combination of column matrices. Consider A an n×p matrix and x a
p×1 column matrix. We can easily compute this product directly as
follows,
𝑎 𝑎 … 𝑎 𝑥 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥
𝑎 𝑎 … 𝑎 𝑥 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥
𝐴𝐱 ⋮ ⋮ ⋱ ⋮ ⋮ ⋮
𝑎 𝑎 ⋯ 𝑎 𝑥 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥

𝑎 𝑎 𝑎
𝑎 𝑎 𝑎
𝐴𝐱 𝑥 ⋮ 𝑥 ⋮ .. 𝑥 ⋮ 𝑥 𝒄 𝑥 𝒄 ⋯ 𝑥 𝒄
𝑎 𝑎 𝑎

• That is, Ax can be written as the linear combination of the


column matrices of A, with the entries of x as coefficients.
14
Example: Matrix multiplication
Compute Ax directly and as a linear combination for the following
matrices.
2
4 1 2 1
1
𝐴 12 1 3 2 𝐱
6
0 5 10 9
8
Solution:

2
4 1 2 1 4 1 2 1
1
𝐴𝐱 12 1 3 2 2 12 1 1 6 3 8 2
6
0 5 10 9 0 5 10 9
8

8 1 12 8 11
24 1 18 16 9
0 5 60 72 17

15
A system of equations in matrix form (Ax = b)
Matrix multiplication also gives us a very nice and compact way of
writing systems of equations. Specifically, the system can be
written in the following matrix form, Ax = b.
A of n equations and m unknowns can be written as follows:

𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏
𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏

; ⋮ ⋮
;
𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏

𝑎 𝑎 … 𝑎 𝑥 𝑏
𝑎 𝑎 … 𝑎 𝑥 𝑏
⋮ ⋮ ⋱ ⋮ ⋮ .

𝑎 𝑎 ⋯ 𝑎 𝑥 𝑏

16
Transpose, symmetry, and trace
Definition 6 : If A is an n×m matrix, then the transpose of A,
denoted by AT , is an m×n matrix. AT is obtained by interchanging
the rows and columns of A.
𝐴 𝑎
𝐴 𝑎 , with 𝑎 𝑎 for all i and j
• So, the first row of AT is the first column of A, the second row of
AT is the second column of A, etc.
• If A= AT, then A is called symmetric.

Definition 7: If A is a square matrix of size n×n, then the trace of


A, denoted by tr(A), is the sum of the entries on main diagonal.
• That is, tr(A) = 𝑎 + 𝑎 +... + 𝑎 .
• If A is not square, then the trace is not defined.

17
Properties of Matrix Arithmetic
Let a and b are scalars, and A, B, and C be matrices. Assume that
the size of the matrices in each property are such that the operation
in that property is defined.
1. A + B = B + A Commutative law for addition
2. A + (B + C) = (A + B) + C Associative law for addition
3. A(BC) = (AB)C Associative law for multiplication
4. A (B C) = AB AC Left distributive law
5. (B C) A = BA CA Right distributive law
6. a (B C) = aB + aC
7. (a b) C = aC + bC
8. (ab) C = a (bC)
9. a (BC) = (aB) C = B (aC)
<Derivation> These properties follow from the following definitions:
(i) A± B = 𝑎 𝑏 , (ii) cA= 𝑐 𝑎 , and (iii) 𝐴𝐵 ∑ 𝑎 𝑏 .
18
Properties of matrix operations
Zero matrix properties: Suppose A is a matrix, and 0 is the zero
matrix sized appropriately for the indicated operation to be valid.
1. 𝐴 𝟎 𝟎 𝐴 𝐴
2. 𝐴 𝐴 𝟎
3. 𝟎 𝐴 𝐴
4. 𝟎𝐴 𝟎 and 𝐴𝟎 𝟎
Identity matrix property: Suppose A is an n×m matrix. In is an n×n
identity matrix. Then, we have,
𝐼 𝐴 𝐴𝐼 𝐴
If A is a square matrix, then
• 𝐴 𝐼 𝐴 𝐴𝐴 … 𝐴 , 𝑛 0
• 𝐴 𝐴 𝐴
𝑛 𝑡𝑖𝑚𝑒𝑠
, 𝐴 𝐴
• We can plug matrices into polynomials, such as p(x), as follows.
𝑝 𝑥 𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑎
𝑝 𝐴 𝑎 𝐴 𝑎 𝐴 ⋯ 𝑎 𝐴 𝑎 𝐼
19
Example: Matrix polynomials
Evaluate p (A) where p(x) = – 6x3 +10x – 9

<Solution>
𝑝 𝐴 6𝐴 10𝐴 9𝐼
538 174 7 3 1 0
6 10 9
290 74 5 1 0 1
3228 1044 70 30 9 0
1740 444 50 01 0 9
3149 1014
1690 445

20
Properties of the Transpose
Properties of the Transpose
1. 𝐴 𝐴
2. 𝐴 𝐵 𝐴 𝐵
3. 𝑐𝐴 𝑐𝐴
4. 𝐴𝐵 𝐵 𝐴

The fourth property can be naturally extended to more than two


matrices. For example,
• 𝐴𝐵𝐶 𝐶 𝐵 𝐴

21
Inverse Matrices
Definition 8: If A is a square matrix and we can find another
matrix of the same size, say B, such that AB = BA = I, then we call
A invertible and B the inverse of the matrix A.
• If A is not invertible, we call A a singular matrix.
• An invertible matrix is also called a non-singular matrix.
• If B the inverse of A, then A is the inverse of B.

Theorem 3: Suppose that A is invertible and that both B and C are


inverses of A. Then, we can show that B = C. That is, the inverse
of a matrix is unique, denoted by 𝑨 𝟏 .
<Proof>
• BA = AB = I and CA = AC = I  AB  AC =I  I = 0
 A(B  C)=0  BC= 𝐴 0=0  B=C

22
Properties of Inverse Matrices
Definition 9: If A is an invertible matrix (and by definition, it must
be a square matrix), for any integer n > 0, we have
𝐴 𝐴 =𝐴 𝐴 …𝐴

n times
Theorem 4: Suppose that A and B are invertible matrices of the
same size. Then,
• (a) 𝐴𝐵 is invertible and 𝐴𝐵 𝐵 𝐴 .
• (b) 𝐴 is invertible and 𝐴 𝐴.
• (c) 𝐴 is invertible and 𝐴 𝐴 𝐴 , for all integer n >
0.

• (d) 𝑐𝐴 is invertible and 𝑐𝐴 𝐴 , for any non-zero scalar 𝑐.


• (e) 𝐴 is invertible and 𝐴 𝐴 .

Likewise, 𝐴𝐵𝐶 𝐶 𝐵 𝐴 .
23
Properties of Inverse Matrices
Theorem 5: Suppose that A is an invertible matrix and that B, C,
and D are matrices of the same size as A.
• (a) If 𝐴𝐵 𝐴𝐶, then 𝐵 𝐶.
• (b) If 𝐴𝐷 𝟎, then 𝐴𝐷 𝟎.
<Proof>
• 𝐴𝐵 𝐴𝐶 ⟹ 𝐴 𝐴𝐵 𝐴 𝐴𝐶 ⟹ 𝐼𝐵 𝐼𝐶 ⟹ 𝐵 𝐶.
• 𝐴𝐷 𝟎 ⟹ 𝐴 𝐴𝐷 𝐴 𝟎 ⟹ 𝐼𝐷 𝟎⟹𝐷 𝟎.

24
Elementary matrix
Definition 10: A square matrix is called an elementary matrix if
it can be obtained by applying a single elementary row operation to
the identity matrix of the same size.
Examples:
9 0 9𝑅 𝑜𝑛 𝐼

0 1

0 0 0 1
0 1 0 0 𝑅 ↔ 𝑅 𝑜𝑛 𝐼

0 0 1 0
1 0 0 0

1 0 0 0
• 0 1 7 0 𝑅 7𝑅 𝑜𝑛 𝐼
0 0 1 0
0 0 0 1

1 0 0
• 1 · 𝑅 𝑜𝑛 𝐼
0 1 0
0 0 1 25
Elementary matrix and row operations
Theorem 6 : Suppose E is an elementary matrix that is found by
applying an elementary row operation to In . If A is an n×m matrix,
then EA is the matrix that will result by applying the same row
operation to A.
Example: Perform the row operation R1 + 4R2 on matrix A. Find
the elementary matrix, E, for this operation. Verify that EA gives
the same result.
4 5 6 1 1 1 4 0
𝐴 1 2 1 10 3  𝐸 0 1 0
3 0 4 4 7 0 0 1

Solution:
4 5 6 1 1 0 13 10 41 11
𝑅 4𝑅
1 2 1 10 3 1 2 1 10 3

3 0 4 4 7 3 0 4 4 7

1 4 0 4 5 6 1 1 0 13 10 41 11
𝐸𝐴 0 1 0 1 2 1 10 3 1 2 1 10 3
0 0 1 3 0 4 4 7 3 0 4 4 7 26
Inverse row operations
Each row operation has an inverse operation associated with it:
Row Operation Notation Row Operation Notation
(Inverse) (Inverse)
Multiply row i by the constant c Ri Multiply row i by the constant 1/c Ri
c 1/c
Interchange rows i and j Ri ↔ Rj Interchange rows i and j Ri ↔ Rj
Add c times row i to row j Rj + c Ri Add -c times row i to row j Rj  c Ri

Theorem 7: If E is the elementary matrix associated with a


particular row operation, and 𝐸 is the elementary matrix associated
with the inverse operation. Then, E is invertible, and 𝐸 𝐸 .
<Proof>
• Doing these two operations would back to I.
• 𝐸 𝐸 𝐼 and 𝐸𝐸 𝐼. ⟹ 𝐸 𝐸 .

27
Example: Inverse elementary operation
Give the operation that will take the following elementary matrices
back to the original identity matrix.
9 0 9𝑅 𝑜𝑛 𝐼 9 0 𝑅 1 0
0 1 0 1 → 0 1

0 0 0 1 0 0 0 1 1 0 0 0
0 1 0 0 𝑅 ↔ 𝑅 𝑜𝑛 𝐼 0 1 0 0 𝑅 ↔𝑅 0 1 0 0
0 0 1 0 0 0 1 0 → 0 0 1 0
1 0 0 0 1 0 0 0 0 0 0 1

1 0 0 0 1 0 0 0
1 0 0 0
0 1 7 0 𝑅 7𝑅 0 1 0 0
0 1 7 0 𝑅 7𝑅 𝑜𝑛 𝐼 0 0 1 0 0 0 1 0

0 0 1 0
0 0 0 1 0 0 0 1
0 0 0 1
1 0 0 1 0 0 1 0 0
1 · 𝑅 𝑜𝑛 𝐼 1·𝑅
0 1 0 0 1 0 0 1 0

0 0 1 0 0 1 0 0 1
28
Row equivalent matrices
Suppose matrices A and B are of the same. If we can reach B by
applying a finite number of row operations to A, then we say A and B
are row equivalent.
• Note that this also means that we can reach A from B by applying
the inverse operations in the reverse order.

29
Inverse Matrices (Summary)
Theorem 8: If A is an n×n matrix, then the following statements
are equivalent.
• (a) A is invertible.
• (b) The only solution to the system Ax = 0 is the trivial solution.
• (c) A is row equivalent to In.
• (d) A is expressible as a product of elementary matrices.
Proof :
• (b)⇒(c) : Let’s start off by writing down the augmented matrix
for this system.

𝑎 𝑎 … 𝑎 0
𝑎 𝑎 … 𝑎 0

⋮ ⋮ ⋱ ⋮ ⋮
𝑎 𝑎 … 𝑎 0

30
• To solve this system, we will use elementary row operations to
reduce this to reduced row-echelon form. We know that the
solution to this system must be,
𝑥 0, 𝑥 0, … , 𝑥 0
• Therefore, the reduced-row echelon form of this augmented
matrix must be,

1 0 … 0 0
0 1 … 0 0
⋮ ⋮ ⋱ ⋮ ⋮
0 0 … 1 0
• If we take the same set of elementary row operations and apply
them to A, we will get In. So, A is row equivalent to In.
(c)⇒(d): The above statement provides the proof.
(d)⇒(a): Assume that A is expressible as a product of elementary
matrices. As proven earlier, all elementary matrices are invertible.
Therefore, A must be invertible.
31
Finding the inverse matrix
If A is invertible, how to find its inverse matrix 𝐴 ?
• A is invertible, so it is row equivalent to 𝐼 .
• Suppose elementary matrices, 𝐸 , 𝐸 , … , 𝐸 , will get us from 𝐴 to
𝐼 . That is 𝐸 … 𝐸 𝐸 𝐴 𝐼 .
• Then, 𝐸 … 𝐸 𝐸 𝐴𝐴 = 𝐼 𝐴 .
• 𝐴 =𝐸 … 𝐸 𝐸 𝐼 .
Conclusion:
• 𝐸 …𝐸 𝐸 𝐴 𝐼 .
• 𝐸 …𝐸 𝐸 𝐼 𝐴 .

32
Example: Finding the inverse matrix
Determine the inverse of the following matrix.
4 2
𝐴
5 5

Solution:
4 2 1 0 𝑅 𝑅 1 3 1 1 𝑅 5𝑅 1 3 1 1
5 5 0 1 → 5 5 0 1 → 0 10 5 4

𝑅 1 3 1 1 𝑅 3𝑅 1 0
→ 0 1 → 0 1

• 𝐴

33
Example: Finding the inverse matrix
Determine the inverse of the following matrix.
3 1 0
𝐶 1 2 2
5 0 1
<Solution>

34
Example: A singular matrix
Show that the following matrix is singular.
3 3 6
𝐵 0 1 2
2 0 0

Solution:

35
Inverse Matrices
Theorem 9: Suppose that A is a 𝑛 𝑛 square matrix. Then,
• (a) If 𝐵𝐴 𝐼 , then A is invertible and 𝐴 𝐵.
• (b) If 𝐴𝐵 𝐼 , then A is invertible and 𝐴 𝐵.

Some remarks:
• Note that B must be a 𝑛 𝑛 square matrix as well.
• Recall that in our earlier discussion, to show that a matrix B is
the inverse of A, we needed to show that AB = BA = I . This
theorem tells us that we only need to show one of them and we
get the other one for free.

36
Inverse for a matrix
𝑎 𝑏
A is a 2 2 square matrix: 𝐴
𝑐 𝑑

𝑑 𝑏
• It is invertible if ad −bc ≠0, and 𝐴 .
𝑐 𝑎
• It is singular if ad − bc = 0 .

37
Example: Find the inverse matrix
Use the fact to show that the following matrix is an invertible
matrix and find its inverse.
4 2
𝐴
5 5

Solution:

38
Diagonal matrix
Diagonal Matrix: A square matrix is called diagonal if it has the
following form.
𝑑 0 0 … 0
0 𝑑 0 … 0
𝐷 0 0 𝑑 … 0
⋮ ⋮ ⋮ ⋱ ⋮
0 0 0 … 𝑑

Powers of diagonal matrices are also easy to compute. If D is a


diagonal matrix and k is any integer then

𝑑 0 0 … 0
0 𝑑 0 … 0
𝐷 0 0 𝑑 … 0
⋮ ⋮ ⋮ ⋱ ⋮
0 0 0 … 𝑑
39
Powers of diagonal matrix
Theorem 10: Suppose D is a diagonal matrix and 𝑑 , 𝑑 , … , 𝑑 are
the entries on the main diagonal.
• If one or more of the 𝑑 ’s are zero, then the matrix is singular.
• If 𝑑 0 for all i, then the matrix is invertible. The inverse is,
1
0 0
𝑑 … 0
1 … 0
0 0
𝑑
𝐷 1
0 0 … 0
𝑑 ⋱ ⋮
⋮ ⋮ ⋮
1
0 0 0 …
𝑑
<Proof>
• If D is row equivalent to the identity matrix, then D is invertible.
• If none of the 𝑑 ’s are zero, then we can reduce D to the identity simply
dividing each of the rows its diagonal entry. Therefore, in this case D is
invertible, and D-1 is as indicated.
40
Triangular Matrix
Triangular Matrix: There are two kinds of triangular matrix.
• Upper triangular matrix: The matrix must be square, all the
entries below the main diagonal are zero, and the main diagonal
entries and the entries above it may or may not be zero.
• Lower triangular matrix: The matrix must be square, all the
entries above the main diagonal are zero, and the main diagonal
entries and those below it may or may not be zero.
• General forms:
𝑢 𝑢 𝑢 … 𝑢
0 𝑢 𝑢 … 𝑢
𝑈 0 0 𝑢 … 𝑢 Upper Triangular Matrix
⋮ ⋮ ⋮ ⋱ ⋮
0 0 0 … 𝑢
𝑙 0 0 … 0
𝑙 𝑙 0 … 0
L 𝑙 𝑙 𝑙 … 0 Lower Triangular Matrix
⋮ ⋮ ⋮ ⋱ ⋮ 41
𝑙 𝑙 𝑙 … 𝑙
Triangular Matrix
Theorem 11: Suppose A is a triangular matrix with main diagonal
entries 𝑎 , 𝑎 , … , 𝑎 .
• If 𝑎 0 for all i, then the matrix is invertible.
• If 𝑎 0 for some i, the matrix will be singular.
<Proof outline> If 𝑎 0 for all i, we can divide each row by 𝑎 and
that will put a 1 in the main diagonal entry for each row. Then, we
will be able to reduce A to the identity matrix. That is, it is row
equivalent to the identity matrix.

Theorem 12
• (a) The product of lower (upper) triangular matrices will be a
lower (upper) triangular matrix.
• (b) The inverse of an invertible lower (upper) triangular matrix
will be a lower (upper) triangular matrix.
<Proof outline>: The proof of these will pretty much follow from how
products and inverses are found. 42
Symmetric matrix
Symmetric matrix: Matrix A will be called symmetric if A = AT .
• For a matrix to be symmetric, it must be square.
• Example: The following matrices are all symmetric.

6 10 3 0
4 6 10 0 1 4
• 𝐴 𝐵 𝐶 10
6 7 3 1 12 8
0 4 8 5

Theorem 13: If A and B are symmetric matrices of the same size


and c is any scalar then,
• (a) A± B is symmetric.
• (b) cA is symmetric.
• (c) AT is symmetric.
<Proof> This follows from the definition of a symmetric matrix.
43
AAT and ATA
Theorem 14
• (a) If A is an invertible symmetric matrix, then A-1 is symmetric.
• (b) For any matrix A, both AAT and ATA are symmetric.
• (c) If A is invertible, then AAT and ATA are both invertible.

44
Example: Matrix computation
Given the following matrices, compute the indicated quantities.

4 2 1 2 0 3 3 0 0
𝐴 0 9 6 𝐵 0 7 1 𝐶 0 2 0
0 0 1 0 0 5 9 5 4

2 0 4 1 1 2 0
𝐷 1 0 1 6 𝐸 2 3 1
8 2 1 1 0 1 0

(a) 𝐴𝐵
(b) 𝐶
(c) 𝐷 𝐷
(d) 𝐸

45
Solution

46
LU-Decomposition
Definition 11: If A is a square matrix and it can be factored as A =
LU, where L is a lower triangular matrix and U is an upper
triangular matrix, then we say that A has an LU-Decomposition.
Theorem 15: If A is a square matrix and it can be reduced to a
row-echelon form, U, without interchanging any rows, then
A can be factored as A = LU (where L is a lower triangular matrix).
<Proof outline>
• Assume that A is a square matrix and it can be reduced to a
row-echelon form, U, without interchanging any rows. Let
𝐸 , 𝐸 , … , 𝐸 be the elementary matrices corresponding to the row
operations we used to reduce A to U. That is, 𝐸 … 𝐸 𝐸 𝐴 𝑈.
Therefore, we get 𝐴 𝐸 𝐸 … 𝐸 𝑈.
• It can be shown that if we avoid interchanging rows, the
elementary row operations 𝐸 , 𝐸 , … , 𝐸 will all be lower
triangular matrices. Thus, 𝐿 𝐸 𝐸 … 𝐸 is a lower
triangular matrix. Therefore, we get the LU-Decomposition for
47
A, i.e., A = LU.
Example: LU-Decomposition
Determine an LU-Decomposition for the following matrix.
3 6 9
𝐴 2 5 3
4 1 10
Solution:
• Let’s first find U.

3 6 9 1 2 3 1 2 3
𝑅 2𝑅
2 5 3 𝑅 2 5 3 0 1 3

4 1 10 → 4 1 10 4 1 10

1 2 3 1 2 3 1 2 3
𝑅 4𝑅 𝑅 9𝑅 𝑅
0 1 3 0 1 3 0 1 3
→ → →
0 9 2 0 0 29 0 0 1

48
Here are the elementary matrices and their inverses for each of the
operations above.

0 0 3 0 0
𝑅 𝐸 0 1 0 𝐸 0 1 0
0 0 1 0 0 1

1 0 0 1 0 0
𝑅 2𝑅 𝐸 2 1 0 𝐸 2 1 0
0 0 1 0 0 1
1 0 0 1 0 0
𝑅 4𝑅 𝐸 0 1 0 𝐸 0 1 0
4 0 1 4 0 1
1 0 0 1 0 0
𝑅 9𝑅 𝐸 0 1 0 𝐸 0 1 0
0 9 1 0 9 1

1 0 0 1 0 0
𝑅 𝐸 0 1 0 𝐸 0 1 0
0 0 0 0 29

49
Now, we can calculate L as follows:
𝐿 𝐸 𝐸 𝐸 𝐸 𝐸
3 0 0 1 0 0 1 0 0 1 0 0 1 0 0
0 1 0 2 1 0 0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 4 0 1 0 9 1 0 0 29
3 0 0
2 1 0
4 9 29
So, the LU-decomposition of A is:

3 0 0 1 2 3 3 6 9
2 1 0 0 1 3 = 2 5 3 =A
4 9 29 0 0 1 4 1 10

• This alternative LU-decomposition works as well:


1 0 0 3 6 9 3 6 9
1 0 0 1 3 2 5 3
9 1 0 0 29 4 1 10
50
Some remarks about LU-Decompositions
First, given a random square matrix, A, the only way we can
guarantee that A will have an LU-Decomposition is if we can reduce
it to row-echelon form without interchanging any rows.
If we do have to interchange rows then there is a good chance that
the matrix will NOT have an LU-Decomposition.
Second, notice that every time we’ve talked about an LU-
Decomposition of a matrix, we’ve used the word “an” and not “the”
LU-Decomposition. This choice of words is intentional. As the choice
suggests, there is no single unique LU-Decomposition for A.

51
Consistency of a system of equations
Given an n×m matrix A, determine all the m×1 matrices, b, for
which Ax = b is consistent.
• If A is square and invertible, then Ax = b is consistent for all b.
• If A isn’t square or isn’t invertible, we need to use a different
method.
The next two examples illustrate the idea.

52
Example: Consistency of a system of equations
Example: Determine the conditions (if any) on b1, b2 , and b3 in
order for the following system to be consistent.
𝑥 2𝑥 6𝑥 𝑏
𝑥 𝑥 𝑥 𝑏
3𝑥 𝑥 8𝑥 𝑏
Solution:
1 2 6 𝑏 𝑅 𝑅 1 2 6 𝑏
1 1 1 𝑏 𝑅 3𝑅 0 1 5 𝑏 𝑏
3 1 8 𝑏 → 0 5 26 𝑏 3𝑏
1 2 6 𝑏 1 2 6 𝑏
𝑅 𝑏 𝑏 𝑅 5𝑅 𝑏 𝑏
0 1 5 0 1 5
→ →
0 5 26 𝑏 𝑏 0 0 1 𝑏 5𝑏 2𝑏

𝑅 5𝑅 1 2 0 6𝑏 30𝑏 13𝑏 1 0 0 4𝑏 22𝑏 9𝑏


𝑅 6𝑅 0 1 0 5𝑏 26𝑏 11𝑏 𝑅 2𝑅
0 1 0 5𝑏 26𝑏 11𝑏

→ 0 0 1 𝑏 5𝑏 2𝑏 0 0 1 𝑏 5𝑏 2𝑏
53
Example: Consistency of a system of equations
Determine the conditions (if any) on b1, b2 , and b3 in order for the
following system to be consistent.
𝑥 3𝑥 2𝑥 𝑏
𝑥 5𝑥 3𝑥 𝑏
2𝑥 8𝑥 3𝑥 𝑏
Solution:
1 4 9 𝑏 𝑅 𝑅 1 3 2 𝑏
6 2 1 𝑏 𝑅 2𝑅 0 2 1 𝑏 𝑏
7 4 7 𝑏 → 0 14 7 𝑏 2𝑏
1 3 2 𝑏
𝑅 7𝑅 𝑏 𝑏
0 2 1

0 0 0 𝑏 7𝑏 9𝑏

54
Inverse Matrices (Summary)
Theorem 16: If A is an n×n matrix then the following statements
are equivalent.
• (a) A is invertible.
• (b) The only solution to the system Ax = 0 is the trivial solution.
• (c) A is row equivalent to In.
• (d) A is expressible as a product of elementary matrices.
• (e) 𝐴𝐱 𝐛 has exactly one solution for every n×1 matrix b.
• (f) 𝐴𝐱 𝐛 is consistent for every n×1 matrix b.

55
Proof of Theorem 16
< proof of (a)⇒(e)>
• Since A is invertible, its inverse is denoted 𝐴 by convention.
Given 𝐴𝐱 𝐛, we can do the following:
• 𝐴 𝐴𝐱 𝐴 𝐛 ⟹ 𝐼𝐱 𝐴 𝐛 ⟹ 𝐱 𝐴 𝐛
• Since matrix multiplication 𝐴 𝐛 is unique (i.e., you won’t get
two different answers from the multiplication of 𝐴 𝐛), you get
only one solution for 𝐱.
< proof of (e)⇒(f)>
• Given that the system 𝐴𝐱 𝐛 has a solution for every choice of
n×1 matrix b, the system is consistent for every b.
< proof of (f)⇒(a)>
• Let 𝐱 , 𝐱 , … , 𝐱 be the solution to the system 𝐴𝐱 𝐞 , 𝐴𝐱 𝐞 ,
…, 𝐴𝐱 𝐞 , where 𝐞 is the ith column of the identity matrix 𝐼 .
• Let 𝐵 𝐱 𝐱 … 𝐱 . Then, 𝐴𝐵 𝐴𝐱 𝐴𝐱 … 𝐴𝐱 𝐼 .
• Because 𝐴𝐵 𝐼 and 𝐴 is a square matrix, 𝐴 is invertible.
56
Appendix

57
Systems Revisited
For a system of n equations and m unknowns, it can be written in
matrix form as follows.
𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏
𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏

𝑎 𝑥 𝑎 𝑥 ⋯ 𝑎 𝑥 𝑏

𝑎 𝑎 … 𝑎 𝑥 𝑏
𝑎 𝑎 … 𝑎 𝑥 𝑏
⋮ ⋮ ⋱ ⋮ ⋮ ⋮
𝑎 𝑎 ⋯ 𝑎 𝑥 𝑏
𝐴𝐱 𝐛

If A is an invertible square matrix, the solution to Ax = b is unique,


given by: x=A-1b.
58
Example: Solve a system of equations
Use the inverse of the coefficient matrix to solve the following
system.
3𝑥 𝑥 6
𝑥 2𝑥 2𝑥 7
5𝑥 𝑥 10
Solution:

3 1 0
𝐴 1 2 2 𝐴 3 1 2
5 0 1

6
• 𝐱 𝐴 𝐛 3 1 2 7 5
10
• 𝑥 𝑥 5 𝑥
59
A system of equations and LU-Decomposition
If A is a square matrix and has an LU-Decomposition of A = LU, we
can find the solution to the system using the following steps:
• Let’s start with a system Ax = b.
• Find an LU-Decomposition of A = LU. So, LU x = b.
• Calculate y =Ux, which will be an n×1 column matrix.
• It’s very easy to solve Ly = b for y. It’s also very easy to solve Ux
= y for x.

60
Example: Use LU-Decomposition to solve a system
Use the LU-Decomposition method to find the solution to the
following system of equations.
3𝑥 6𝑥 9𝑥 0
2𝑥 5𝑥 3𝑥 4
4𝑥 𝑥 10𝑥 3
Solution:
• Here is the system of equations in matrix form.
3 6 9 𝑥 0
2 5 3 𝑥 4
4 1 10 𝑥 3

• Factor the coefficient matrix A into A = LU.

3 6 9 3 0 0 1 2 3
2 5 3 2 1 0 0 1 3
4 1 10 4 9 29 0 0 1
61
• Solve Ly = b.
3 0 0 𝑦 0
2 1 0 𝑦 4
4 9 29 𝑦 3

3𝑦 0 → 𝑦 0
2𝑦 𝑦 4 → 𝑦 4
4𝑦 9𝑦 29𝑦 3 → 𝑦

• Solve y =Ux.
1 2 3 𝑥 0
0 1 3 𝑥 4
0 0 1 𝑥

𝑥 2𝑥 3𝑥 0 → 𝑥
𝑥 3𝑥 4 → 𝑥
𝑥 → 𝑥
62
Solve multiple systems simultaneously
Suppose that we need so solve a system of equations only there are
two or more sets of the bi’s that we need to look at. Instead of doing
these individually let’s add all of them onto the coefficient matrix.
For instance,
𝐴𝒙 𝒃𝟏 𝐴𝒙 𝒃𝟐 … 𝐴𝒙 𝒃𝒌

𝐴 𝑏 𝑏 … 𝑏

63
Example: Solve multiple systems simultaneously
Find the solution to each of the following systems.
𝑥 3𝑥 4𝑥 12 𝑥 3𝑥 4𝑥 0
2𝑥 𝑥 2𝑥 1 2𝑥 𝑥 2𝑥 5
5𝑥 2𝑥 3𝑥 3 5𝑥 2𝑥 3𝑥 8

Solution:
• Convert 𝐴𝐱 𝐛 and 𝐴𝐱 𝐛 into matrix form.
• A is a square matrix. The solution for the two systems are
• 𝐱 𝐴 𝐛 .
• 𝐱 𝐴 𝐛 .
• We can calculate 𝐴 𝐛 and 𝐴 𝐛 simultaneously.

1 3 4 12 0 𝑅 2𝑅 1 3 4 12 0
2 1 2 1 5 𝑅 5𝑅 0 5 10 25 5
5 2 3 3 8 → 0 13 23 57 8
64
1 1 3 4 12 0 1 3 4 12 0
𝑅 𝑅 13𝑅
5 0 1 2 5 1 0 1 2 5 1

→ 0 13 23 57 8 0 0 3 8 21

1 3 4 12 0 𝑅 2𝑅 1 3 0 28
𝑅 0 1 2 5 1 𝑅 4𝑅 0 1 0 13
→ 0 0 1 7 → 0 0 1 7

1 0 0 11
𝑅 3𝑅
0 1 0 13

0 07 1
Therefore, the solution to the first system is,

𝑥 𝑥 𝑥
and the solution to the second system is,
𝑥 11 𝑥 13 𝑥 7

65

You might also like