You are on page 1of 39

# Section Two: Matrices

## Textbook: Ch. 1.6

GOALS OF THIS CHAPTER
- define matrix multiplication

## - figure out when matrix multiplication fails

- matrix multiplication as linear combinations - see properties of sigma notation - see properties of matrix multiplication

MULTIPLICATION OF MATRICES
Matrix multiplication is NOTHING like regular multiplication! If A is an m x p matrix and B is a p x n matrix, then we can do the following preliminary steps:
STEP ONE: Check to see if the number of columns of the first matrix is equal to the number of rows of the second matrix. If not, the multiplication doesnt exist.

Am x p

Bp x n

## Since these numbers are equal, we move onto step two.

MULTIPLICATION OF MATRICES
Matrix multiplication is NOTHING like regular multiplication! If A is an m x p matrix and B is a p x n matrix, then we can do the following preliminary steps:
STEP TWO: The other two letters or numbers will tell you the size of the new matrix AB.

Am x p

Bp x n

## Read off these letters from left to right. The matrix AB is m x n.

MULTIPLICATION OF MATRICES

If steps one and two make sense, then we calculate the entries of AB by doing a summation. If we label the entries of AB, A and B as abij, aij, bij, respectively, then:
p

ab ij

= k=1

a ik b kj

This just means that the (i,j) entry of AB uses all the information from row i of A and all the information from column j of B. We will revisit this again later.

MULTIPLICATION OF MATRICES
These couple calculations are the most important. I will show you how to break bigger multiplications down into these ones.

## Ex. 1 Row and column matrices

-1

1
=

-1

B B1 x 3 B1 x 3

3 -5 0

0 10

Calculate BC:

C3 x 1 C3 x 1

BC exists

BC is 1 x 1

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

BC

3 -5 0

-1 0 10

3*(-1) +

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

BC

3 -5 0

-1 0 10

3(-1) + (-5)*0 +

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

BC

3 -5 0

-1 0 10

## 3(-1) + (-5)0 + 0*(10)

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

BC

3 -5 0

-1 0 10

## 3(-1) + (-5)0 + 0(10)

-3

MULTIPLICATION OF MATRICES
These couple calculations are the most important. I will show you how to break bigger multiplications down into these ones.

## Ex. 1 Row and column matrices

-1 3 -5 0

1
=

0 10

-1

Calculate AB:

A2 x 1 A2 x 1

B1 x 3 B1 x 3

AB exists

AB is 2 x 3

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices Recall that the (1,1) entry of AB comes from all the information in row one of A and column one of B.

3 -5 0

AB

-1
=

1*3

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
=

The (1,2) entry of AB comes from all the information in row one of A and column two of B.

1*3

1*(-5)

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
=

The (1,3) entry of AB comes from all the information in row one of A and column three of B.

1*3

1*(-5) 1*0

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
1*3 (-1)*3 1*(-5) 1*0

The (2,1) entry of AB comes from all the information in row two of A and column one of B.

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
1*3 1*(-5) 1*0

(-1)*3 -1*(-5)

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
1*3 1*(-5) 1*0

## (-1)*3 -1*(-5) (-1)*0

MULTIPLICATION OF MATRICES
Ex. 1 Row and column matrices

3 -5 0

AB

-1
3 -5 0 0

-3 5

MULTIPLICATION OF MATRICES
These couple calculations are the most important. I will show you how to break bigger multiplications down into these ones.

## Ex. 1 Row and column matrices

-1 3 -5 0

1
=

0 10

-1

Calculate AC:

A2 x 1

C3 x 1

These numbers are not equal, so we say AC is not defined or AC does not exist.

MULTIPLICATION OF MATRICES
Next we will break down a larger multiplication into a row/column matrix multiplication.

## Ex. 2 Some larger matrices

2 1

-1 4

-2

5 -3 1

B B3 x 2 B3 x 2

4 2

Calculate AB:

A2 x 3 A2 x 3

AB exists

AB is 2 x 2

MULTIPLICATION OF MATRICES
Ex. 2 Some larger matrices

-2 2 1 -1 4 4 2

5 -3 1

AB
1 2

1
=

3
-1 -2 4

MULTIPLICATION OF MATRICES
Ex. 2 Some larger matrices

-2 2 1 -1 4
1 2

5 -3 1
-1 5 -3

AB
1 2

1
=

4 2

3
-1 -2 4

MULTIPLICATION OF MATRICES
Ex. 2 Some larger matrices

-2 2 1 -1 4
1 2

5 -3 1
-1 5 -3

AB
1 2

1
=

4 2

3
-1 -2 4

2 3 1 4 -2
4 2

MULTIPLICATION OF MATRICES
Ex. 2 Some larger matrices

-2 2 1 -1 4
1 2

5 -3 1
-1 5 -3

AB
1 2

1
=

4 2

3
-1 -2 4

2 3 1 4 -2
4 2

1 3 1 4 5
-3 1

MULTIPLICATION OF MATRICES
Ex. 2 Some larger matrices

1(-2)+2*4+(-1)2

1*5+2(-3)+(-1)1
3*5+1(-3)+4*1

AB

3(-2)+1*4+4*2 4
=

-2 16

## THE IDENTITY MATRIX

Recall that the identity matrix is the square matrix with only ones on the main diagonal.

I=

1
0

0
1

When we multiply numbers, any number multiplied by the number 1 is just itself.

When we multiply a matrix by an identity matrix of the right size, we get the matrix we started with (provided the multiplication makes sense)!

## THE IDENTITY MATRIX

Lets say that I is a 2x2 matrix, A is a 2x3 matrix and B is a 3x2 matrix.

I=

1
0

0
1

2
1

-1
4

-2

5 -3 1

4 2

When multiplying with I, all you really have to do is check that the multiplication makes sense:
Calculate AI:

A2 x 3

I2 x 2

## THE IDENTITY MATRIX

Lets say that I is a 2x2 matrix, A is a 2x3 matrix and B is a 3x2 matrix.

I=

1
0

0
1

2
1

-1
4

-2

5 -3 1

4 2

Calculate IA:

I2 x 2 I2 x 2

A2 x 3 A2 x 3

IA exists

IA is 2 x 3

## THE IDENTITY MATRIX

Lets say that I is a 2x2 matrix, A is a 2x3 matrix and B is a 3x2 matrix.

I=

1
0

0
1

2
1

-1
4

-2

5 -3 1

4 2

In fact, IA is just equal to A (you should check this)! So provided the multiplication makes sense, multiplying by I is pretty easy.

IA=A

## THE IDENTITY MATRIX

Lets say that I is a 2x2 matrix, A is a 2x3 matrix and B is a 3x2 matrix.

I=

1
0

0
1

2
1

-1
4

-2

5 -3 1

4 2

## What side can we multiply I on when dealing with the matrix B?

IB = B
BI = B

Since B is 3x2, we must multiply by I on the right for the multiplication to make sense!

## MATRIX MULTIPLICATION AS LINEAR COMBINATIONS

Let A be an mxn matrix and let x be an n-vector (or an nx1 column matrix). Consider the multiplication Ax:

a11 a21

a12 a22

a1n a2n

x1 x2

am1 am2

amn

xn

a11
a21

a12
a22

a1n

= x1

am1

+ x2

am2

+ + xn

a2n amn

## MATRIX MULTIPLICATION AS LINEAR COMBINATIONS

By re-labeling the n-vectors as c1, c2, , cn (the subscript denotes the column of A), we express the multiplication Ax as a linear combination of the column vectors of the matrix A.

a11
a21

a12
a22

a1n

Ax = x1

am1

+ x2

am2

+ + xn

a2n amn

## MATRIX MULTIPLICATION AS LINEAR COMBINATIONS

We have shown that the product of an mxn matrix A and a column vector x is a linear combination of the columns of A.
Linear combinations play an important role in higher linear algebra courses and are a fundamental tool in digital music.

We could generalize this finding to a matrix A that is mxn and a matrix B that is nxp. The product AB is a linear combination of the columns of A as well! (see page 69-70 of the text for more info)

## MATRIX MULTIPLICATION AS LINEAR COMBINATIONS

Ex. 4 - Lets see an example of this:

1 7

-3

-1
0 10 1
= -1 =

-31 51 93 0
+ 0

-1 2

10 4

-31 51 93

-3
+ 10

-1

10

SIGMA NOTATION

Let A be an mxn matrix, and let B be an nxp matrix. We have shown that the product AB is defined and is of size mxp. To figure out the (i,j) entry of the matrix AB, we could use the formula:
p

ab ij

= k=1

a ik b kj

## We call this sigma notation, but how exactly does it work?

SIGMA NOTATION
Lets say we want the (1,1) entry of AB. This means we fill in i=1 and j=1 in our formula:
p

ab 11

= k=1

a1kbk1

Next, we let the variable k=1 to start, then we add the term k=2, k=3, all the way up to k=p:

ab 11

## a11b11 + a12b21 + + a1pbp1

k=1 k=2 ... k=p

SIGMA NOTATION
Ex. 6 Sum of the first five squares - done on overhead

## Thm. 7 Facts about sigma notation

- done on overhead - no proof required

## PROPERTIES OF MATRIX MULTIPLICATION

Thm. 8 Properties of matrix multiplication

Provided that A, B and C are matrices of the right size for multiplication, and that r is any number, we have the following:

## (2) A(B+C) = AB+AC

(3) (A+B)C = AC+BC (4) A(rB) = r(AB) (5) (AB)T = BTAT