You are on page 1of 72

Matrices and Matrix Operations

Math 114

Math 114 Matrices and Matrix Operations 1 / 23


1 Matrix Notations

2 Special Matrices

3 Matrix Operations

4 Properties of Matrix Operations

Math 114 Matrices and Matrix Operations 2 / 23


m n Matrix Notations


a11 a12 a1n r1

a21 a22 a2n h i r2
A = [aij ] = . = c1 c2 cn = .

.. .. .. .. ..
. . .

amn am2 amn rn

Rmn = Mmn (R) = set of all m n matrices with real entries

aij =entry in the i th row and j th column


cj =j th column vector of A.
ci =i th row vector of A.

Rn = Rn1 = set of all column vectors with n components

Math 114 Matrices and Matrix Operations 3 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a matrix.

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a 2 3 matrix.

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a 2 3 matrix.
2 The (1, 2) entry of A is a12 = .

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a 2 3 matrix.
2 The (1, 2) entry of A is a12 = 3.

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a 2 3 matrix.
2 The (1, 2) entry of A is a12 = 3.

3 The third column of B is

Math 114 Matrices and Matrix Operations 4 / 23


Matrix Notations

Examples

" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

1 A is a 2 3 matrix.
2 The (1, 2) entry of A is a12 = 3.

1

3 The third column of B is b3 = 1

1

Math 114 Matrices and Matrix Operations 4 / 23


Applications

Tabular Display of Data

London Madrid New York Tokyo


0 785 3469 5959 London

785 0 3593 6706 Madrid

D=

3469 3593 0 6757 New York
5959 6706 6757 0 Tokyo

Plant 1 Plant 2 Plant 3 Plant 4



560 360 380 0 Product 1
P=
340 450 420 80 Product 2

280 270 210 380 Product 3

Math 114 Matrices and Matrix Operations 5 / 23


Applications

Graph Theory
2 3

1 4

(
1 if vertex i and j are connected
Incidence matrix aij =
0 otherwise

0 1 0 0

1 0 1 1
A=
0

1 0 1
0 1 1 0

Math 114 Matrices and Matrix Operations 6 / 23


Equality of Matrices

Two matrices are equal if and only if they are of the same size and each
corresponding entries are equal.

Math 114 Matrices and Matrix Operations 7 / 23


1 Matrix Notations

2 Special Matrices

3 Matrix Operations

4 Properties of Matrix Operations

Math 114 Matrices and Matrix Operations 8 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix
diagonal matrix

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix
diagonal matrix
scalar matrix

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix
diagonal matrix
scalar matrix
identity matrix

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix
diagonal matrix
scalar matrix
identity matrix
upper triangular matrix

Math 114 Matrices and Matrix Operations 9 / 23


Special Matrices

(n) (n) (n)


standard basis (column) vectors e1 , e2 , , en
zero m n matrix 0m,n .
square matrix
diagonal matrix
scalar matrix
identity matrix
upper triangular matrix
lower triangular matrix
elementary matrix
partitioned/block matrices

Math 114 Matrices and Matrix Operations 9 / 23


1 Matrix Notations

2 Special Matrices

3 Matrix Operations

4 Properties of Matrix Operations

Math 114 Matrices and Matrix Operations 10 / 23


Matrix Operations: Sum

Math 114 Matrices and Matrix Operations 11 / 23


Matrix Operations: Sum

Need: m n matrices A = [aij ] and B = [bij ]

Math 114 Matrices and Matrix Operations 11 / 23


Matrix Operations: Sum

Need: m n matrices A = [aij ] and B = [bij ]

Sum: m n matrix C = A + B = [cij ]

Math 114 Matrices and Matrix Operations 11 / 23


Matrix Operations: Sum

Need: m n matrices A = [aij ] and B = [bij ]

Sum: m n matrix C = A + B = [cij ]

cij = aij + bij

for all 1 i m and 1 j n.

Math 114 Matrices and Matrix Operations 11 / 23


Matrix Operations: Scaling

Math 114 Matrices and Matrix Operations 12 / 23


Matrix Operations: Scaling

Need: m n matrix A = [aij ], and r R

Math 114 Matrices and Matrix Operations 12 / 23


Matrix Operations: Scaling

Need: m n matrix A = [aij ], and r R

Scalar Multiple: m n matrix C = rA = [cij ]

Math 114 Matrices and Matrix Operations 12 / 23


Matrix Operations: Scaling

Need: m n matrix A = [aij ], and r R

Scalar Multiple: m n matrix C = rA = [cij ]

cij = raij

for all 1 i m and 1 j n.

Math 114 Matrices and Matrix Operations 12 / 23


Matrix Operations: Transpose

Math 114 Matrices and Matrix Operations 13 / 23


Matrix Operations: Transpose

Need: m n matrix A = [aij ]

Math 114 Matrices and Matrix Operations 13 / 23


Matrix Operations: Transpose

Need: m n matrix A = [aij ] Transpose of A: n m matrix C = AT = [cji ]

Math 114 Matrices and Matrix Operations 13 / 23


Matrix Operations: Transpose

Need: m n matrix A = [aij ] Transpose of A: n m matrix C = AT = [cji ]

cji = aij

for all 1 i m and 1 j n.

Math 114 Matrices and Matrix Operations 13 / 23


Matrix Operations: Product

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Product

Need: m r matrix A = [aik ] and r n matrix B = [bkj ]

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Product

Need: m r matrix A = [aik ] and r n matrix B = [bkj ]

Product: m n matrix C = AB = [cij ]

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Product

Need: m r matrix A = [aik ] and r n matrix B = [bkj ]

Product: m n matrix C = AB = [cij ]



b1j

h i b2j
cij = ai1 ai2 air .

..

brj

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Product

Need: m r matrix A = [aik ] and r n matrix B = [bkj ]

Product: m n matrix C = AB = [cij ]



b1j

h i b2j
cij = ai1 ai2 air . = ai1 b1j + ai2 b2j + + air brj

..

brj

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Product

Need: m r matrix A = [aik ] and r n matrix B = [bkj ]

Product: m n matrix C = AB = [cij ]



b1j

h i b2j Xr
cij = ai1 ai2 air . = ai1 b1j + ai2 b2j + + air brj = aik bkj

..
k=1
brj

for all 1 i m and 1 j n.

Math 114 Matrices and Matrix Operations 14 / 23


Matrix Operations: Powers

Math 114 Matrices and Matrix Operations 15 / 23


Matrix Operations: Powers

Need: n n matrix A = [aij ] and a positive integer k

Math 114 Matrices and Matrix Operations 15 / 23


Matrix Operations: Powers

Need: n n matrix A = [aij ] and a positive integer k

k th Power: n n matrix C = Ak = |A A{z A}


k copies

Math 114 Matrices and Matrix Operations 15 / 23


Examples


" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

3 1 2 " # 1

1
1 0
C =
0 2
1 D= x =
4

0 2
0 0 4 3

Math 114 Matrices and Matrix Operations 16 / 23


Examples


" # 1 4 1 2
1 3 4
A = [aij ] = B = [bkl ] =
1 0 1 0
2 1 0
2 3 1 0

3 1 2 " # 1

1
1 0
C =
0 2
1 D= x =
4

0 2
0 0 4 3

(a) Find AB.


(e) Find AT A and AAT .
(b) Find CAT .
(f) Find (xT x)xxT .
(c) Find AC + 3DA
(g) Find C 2 + I3 .
(d) Find (CB)T .

Math 114 Matrices and Matrix Operations 16 / 23


1 Matrix Notations

2 Special Matrices

3 Matrix Operations

4 Properties of Matrix Operations

Math 114 Matrices and Matrix Operations 17 / 23


Properties of Matrix Sum and Scaling

Let A, B and C be m n matrices, and r , s R.

Math 114 Matrices and Matrix Operations 18 / 23


Properties of Matrix Sum and Scaling

Let A, B and C be m n matrices, and r , s R.


(a) A + B = B + A
(b) (A + B) + C = A + (B + C )
(c) A + 0m,n = A
(d) r (A + B) = rA + rB
(e) (r + s)A = rA + sA
(f) r (sA) = (rs)A

Math 114 Matrices and Matrix Operations 18 / 23


Matrix Transpose

Assume r R and A, B have appropriate sizes for the operations to be defined.

Math 114 Matrices and Matrix Operations 19 / 23


Matrix Transpose

Assume r R and A, B have appropriate sizes for the operations to be defined.


1 (AT )T = A
2 (A + B)T = AT + B T
3 (rA)T = rAT

Math 114 Matrices and Matrix Operations 19 / 23


Matrix Product

Assume A, B and C have appropriate sizes for the operations defined below.

Math 114 Matrices and Matrix Operations 20 / 23


Matrix Product

Assume A, B and C have appropriate sizes for the operations defined below.
1 Matrix product is not commutative. In general, AB 6= BA.

Math 114 Matrices and Matrix Operations 20 / 23


Matrix Product

Assume A, B and C have appropriate sizes for the operations defined below.
1 Matrix product is not commutative. In general, AB 6= BA.
2 A(BC ) = (AB)C
3 A(B + C ) = AB + AC
4 (B + C )A = BA + CA
5 r (AB) = (rA)B = A(rB) for any r R
6 rA = (rIm )A = A(rIn ) for any r R

Math 114 Matrices and Matrix Operations 20 / 23


Matrix Product

Assume A, B and C have appropriate sizes for the operations defined below.
1 Matrix product is not commutative. In general, AB 6= BA.
2 A(BC ) = (AB)C
3 A(B + C ) = AB + AC
4 (B + C )A = BA + CA
5 r (AB) = (rA)B = A(rB) for any r R
6 rA = (rIm )A = A(rIn ) for any r R
7 (AB)T = B T AT .
8 It is possible that AB = 0m,n but A, B 6= 0. No cancellation law for matrix
products!

Math 114 Matrices and Matrix Operations 20 / 23


Matrix Product

Assume A, B and C have appropriate sizes for the operations defined below.
1 Matrix product is not commutative. In general, AB 6= BA.
2 A(BC ) = (AB)C
3 A(B + C ) = AB + AC
4 (B + C )A = BA + CA
5 r (AB) = (rA)B = A(rB) for any r R
6 rA = (rIm )A = A(rIn ) for any r R
7 (AB)T = B T AT .
8 It is possible that AB = 0m,n but A, B 6= 0. No cancellation law for matrix
products!

Math 114 Matrices and Matrix Operations 20 / 23


Matrix-Vector Product

A = [aij ] Rmn
x = [xj ] Rn

a11 a12 a1n x1

a21 a22 a2n x2
Ax = .

. .. .. ..
.. . . . .
.
amn am2 amn xn

Math 114 Matrices and Matrix Operations 21 / 23


Matrix-Vector Product

A = [aij ] Rmn
x = [xj ] Rn

a11 a12 a1n x1 row1 (A) x

a21 a22 a2n
x2
row2 (A) x
Ax = =

. .. .. .. . ..
.. .

. . . .

.

amn am2 amn xn rowm (A) x

Math 114 Matrices and Matrix Operations 21 / 23


Matrix-Vector Product

A = [aij ] Rmn
x = [xj ] Rn

a11 a12 a1n x1 row1 (A) x

a21 a22 a2n x2
row2 (A) x
Ax = =

. .. .. .. . ..
.. .

. . . .

.

amn am2 amn xn rowm (A) x

x1 a11 x2 a12 xn a1n

x1 a21 x2 a22 xn a2n
=

. .. .. ..
.. . . .

x1 amn x2 am2 xn amn

Math 114 Matrices and Matrix Operations 21 / 23


Matrix-Vector Product

A = [aij ] Rmn
x = [xj ] Rn

a11 a12 a1n x1 row1 (A) x

a21 a22 a2n x2
row2 (A) x
Ax = =

. .. .. .. . ..
.. .

. . . .

.

amn am2 amn xn rowm (A) x

x1 a11 x2 a12 xn a1n a11 a12 a1n

x1 a21 x2 a22 xn a2n a21 a22 a2n
= = x1 . + x2 . + + xn .

. .. .. ..
.. . . . . . ..
. .


x1 amn x2 am2 xn amn amn am2 amn

Math 114 Matrices and Matrix Operations 21 / 23


Matrix-Vector Product

A = [aij ] Rmn
x = [xj ] Rn

a11 a12 a1n x1 row1 (A) x

a21 a22 a2n x2
row2 (A) x
Ax = =

. .. .. .. . ..
.. .

. . . .

.

amn am2 amn xn rowm (A) x

x1 a11 x2 a12 xn a1n a11 a12 a1n

x1 a21 x2 a22 xn a2n a21 a22 a2n
= = x1 . + x2 . + + xn .

. .. .. ..
.. . . . . . ..
. .


x1 amn x2 am2 xn amn amn am2 amn

Ax is a linear combination of column of A using the components of x as scalars!

Math 114 Matrices and Matrix Operations 21 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ?

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ?

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ? Ans: A

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ? Ans: A
4 If x is an m 1 matrix, what is Im x?

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ? Ans: A
4 If x is an m 1 matrix, what is Im x? Ans: x

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ? Ans: A
4 If x is an m 1 matrix, what is Im x? Ans: x
5 What is Im A?

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by the identity matrix

Let A be m n.
h i
1 Note that for any m k matrix B = b1 bk
h i
AB = Ab1 Abk

(n)
2 What is Aei ? Ans: i th column of A
3 What is AIn ? Ans: A
4 If x is an m 1 matrix, what is Im x? Ans: x
5 What is Im A? Ans: A

Math 114 Matrices and Matrix Operations 22 / 23


Multiplication by an Elementary Matrix

Question: If E is an elementary matrix, what can we say about EA? AE ?

Math 114 Matrices and Matrix Operations 23 / 23


Multiplication by an Elementary Matrix

Question: If E is an elementary matrix, what can we say about EA? AE ?


Example:

3 1 0 1 2 0 0 1 0 1 0 0

A=
1 4 1
E1 =
0 1 0
E2 =
1 0 0
E3 =
0 1 0
2 3 3 0 0 1 0 0 1 0 0 3

Math 114 Matrices and Matrix Operations 23 / 23


Multiplication by an Elementary Matrix

Question: If E is an elementary matrix, what can we say about EA? AE ?


Example:

3 1 0 1 2 0 0 1 0 1 0 0

A=
1 4 1
E1 =
0 1 0
E2 =
1 0 0
E3 =
0 1 0
2 3 3 0 0 1 0 0 1 0 0 3

Theorem
If E is an elementary matrix, the effect of multiplying E to the left of A is the
same as the effect of applying the corresponding row operation on A. The effect
of multiplying E to the right of A is the same as applying a corresponding
column operation on A.

Math 114 Matrices and Matrix Operations 23 / 23


Multiplication by an Elementary Matrix

Question: If E is an elementary matrix, what can we say about EA? AE ?


Example:

3 1 0 1 2 0 0 1 0 1 0 0

A=
1 4 1
E1 =
0 1 0
E2 =
1 0 0
E3 =
0 1 0
2 3 3 0 0 1 0 0 1 0 0 3

Theorem
If E is an elementary matrix, the effect of multiplying E to the left of A is the
same as the effect of applying the corresponding row operation on A. The effect
of multiplying E to the right of A is the same as applying a corresponding
column operation on A. (CAUTION: Type III row vs. column operations)

Math 114 Matrices and Matrix Operations 23 / 23

You might also like