You are on page 1of 9

5 The Matrix Vector Product - Matrix Transformations 5-1

5A The Matrix Vector Product


Video 1: https://youtu.be/qpk8mY1C_hU
Recall that two matrices of the same size are added by adding the corresponding entries. It seems reasonable
that two matrices should be multiplied in a similiar way, that is, by multiplying the corresponding entries.
However, this is not useful and therefore not the way we will define matrix multiplication. Instead matrix
multiplication is defined from the point of view of dealing with linear systems, linear combinations
and linear transformations.

 The Row-Column Product


is the product of a row vector and a column vector. It is the most basic form of matrix multiplication

6
Example: 4 2  4  6  2  10  4
10

6
2
5 2 1 3  5  6  2  2  1  6  3 1  31
6
1

2 is undefined since the row and column


5 1 2
3 don’t have the same number of entries.
5 The Matrix Vector Product - Matrix Transformations 5-2

 The Matrix Vector Product Ax of a Matrix A and a Column Vector x

2 7 2
Example: Let A  and let x  .
1 4 3

The product Ax of the matrix A and the vector x is defined in terms of row-column products
of the rows of A and the vector x as follows.
a1
Ax  x where a 1  2 7 and a 2  1 4 are the rows of A.
a2

a1x multiply first row of A with x



a2x multiply second row of A with x

2
2 7
3

2
1 4
3

25 Note that in order for the matrix vector product to be defined,

10 the number of columns of A must equal the number of rows of x.

a1
a2
In general: If A  is an m  n matrix with row vectors a 1 , a 2 , . . . , a m
:
am

x1
x2
and x  is an n  1 matrix, that is, a vector in  n ,
:
xn

then the matrix vector product Ax is defined in terms of row-columnn products as follows:
Note that since A is m  n, each row vector of A
a1 a1x has n entries and since x is a vector in  n , it also
a2 a2x has n entries, so row-column products are defined.
Ax  x
: :
Also, A is m  n and x is n  1, so Ax is m  1.
am amx
mn n1
A x
m1
5 The Matrix Vector Product - Matrix Transformations 5-3

Practice: ind the following matrix vector products provided they are defined.
2
2 3 1 3
4 0 3 5 3 3 5 0 3
(a) 3 5 0 2 (b) (c)
1 4 7 2 1 2 1 0 2
5 3 4 5
4

The matrix vector product Ax plays a key role in linear algebra, especially in regards

to linear combinations, linear systems, linear transformations and computer graphics.

Example: Matrix Vector Product - Linear Combinations

5 The matrix vector product Ax can be


3 2 4 352647
6  expressed as a linear combination of
2 5 1 255617
7 the columns of A with the coefficients
A
x being the components of x, and
3 2 4 viceversa, a linear combination of
5 6 7
2 5 1 vectors can be expressed as a matrix
col 1 A col 2 A col 3 A vector product.

x
2 3 7 1 2 3 7 1
y
3 1 0 1 x 3 y 1 z 0 u 1
z
1 4 2 0 1 4 2 0
u
A col 1 A col 2 A col 3 A col 4 A
x

Matrix-Vector Product - Linear Combinations:


x1
x2
Let A  a 1 a 2 . . . a n  be a matrix with n column vectors a 1 , a 2 , . . , a n and let x 
:
xn
be a vector in  n . Then

x1
x2
Ax  a 1 a 2 . . . a n   x 1 a 1  x 2 a 2 . . . x n a n
:
xn
5 The Matrix Vector Product - Matrix Transformations 5-4

Video 2: https://youtu.be/J-9NKtnejws
Example: An Applications of Linear Combinations and Matrix Vector Product
In a small town there are 10,000 homes. When it comes to TV viewing, the residents have
three choices: They can subscribe to cable, they can pay for satellite service, or they watch no TV.
In any given year, 80% of the cable customers stick with cable, 10% switch to satellite and 10% quit
watching TV.
Over the same period 90% of the satellite viewers continue with satellite service, 5% switch to cable
and 5% quit watching TV.
Of those people who start the year not watching TV, 85% continue not watching, 5% subscribe to
cable and 10% get satellite service.
If the current distribution is 6000 homes with cable, 2500 with satellite service and 1500 with no TV,
how many of each type will there be a year from now? Two years from now? Three years from now?
Solution: The given information is summarized by the following digraph and table.

Start of year
Cable Satellite No TV
End Cable 0.8 0.05 0.05
of Satellite 0.1 0.9 0.1
Year No TV 0.1 0.05 0.85

The first columns of the table give the percentages of homes with cable that switch to cable, satellite
and no TV. Similiarly, the second and third column gives these percentages for homes with satellite and no TV.
Hence, after one year the number of homes with cable, satellite and no TV is given by
0. 8 0. 05 0. 05 5000 Cable
6000 0. 1  2500 0. 9  1500 0. 1  3000 Satellite
0. 1 0. 05 0. 85 2000 No TV after 1 year
Writing the left side as a matrix vector product, we get:
A x0 x1
0. 8 0. 05 0. 05 6000 5000 Cable
0. 1 0. 9 0. 1 2500  3000 Satellite
0. 1 0. 05 0. 85 1500 2000 No TV
after 1 year
Transition matrix initial # of homes # of homes in each

(see above table) in each category category after 1 year


5 The Matrix Vector Product - Matrix Transformations 5-5

Similiarly, we can obtain the vector x 2 with the number of homes in each category after two years
by multiplying x 1 by A, and so on.
Cable
0. 8 0. 05 0. 05 5000 4250
Satellite
x 2  Ax 1  0. 1 0. 9 0. 1 3000  3400
No TV
0. 1 0. 05 0. 85 2000 2350
after 2 years
The number of people in each category after three years is:
Cable (rounded)
0. 8 0. 05 0. 05 4250 3688
Satellite
x 3  Ax 2  0. 1 0. 9 0. 1 3400  3720
No TV (rounded)
0. 1 0. 05 0. 85 2350 2593
after 3 years
5 The Matrix Vector Product - Matrix Transformations 5-6

Video 3: https://youtu.be/uVy81eRNStk

Another reason for the importance of the matrix vector product Ax is that it allows us to

express a linear system of equations in the simple form of a matrix equation Ax  b,

where A is the coefficient matrix, x is the vector of unknowns and b is the vector of

constant terms.

The equation Ax  b is the matrix analog of the algebraic linear equation ax  b.

It is a very convenient notation when dealing with linear systems.

Example: Equivalent Vector Form and Matrix Form Ax  b of a Linear System

Linear system: 5x  4y  z  3
2x  3y  4z  1
x  y  2z  6

Equivalent vector form: 5 4 1 3


x 2 y 3 z 4  1
1 1 2 6

lc of coefficient vectors constant terms


Equivalent matrix form Ax  b
A  coefficient matrix 5 4 1 x 3
x  vector of variables 2 3 4 y  1
1 1 2 z 6
b  vector of constant terms
A x b
A|b  augmented matrix

Note that the system, its vector form and matrix form have the same solutions x, y, z.
5 The Matrix Vector Product - Matrix Transformations 5-7

Homework: (a) Find the equivalent vector form and matrix form of the given linear system.
3x  2y  5z  u  2v  9
x  2z  y  5 . Also, state the coefficient matrix and augmented matrix of the system.
3z  2u  v  2
(b) Write down the equivalent system and vector form corresponding to the following matrix equation
x1
2 3 1 2
x2 
5 0 1 1
x3
5 The Matrix Vector Product - Matrix Transformations 5-8

 The Linearity Properties of the Matrix Vector Product


play a central role in linear transformations which are the basis of
computer graphic.

Linearity Properties of the Matrix Vector Product


Let A be an m  n matrix, u, v and 0 (zero vector) be n  1 vectors (vectors in  n  and let c be a scalar.

Then

(a) A0  0 (b) Au  v  Au  Av (c) Acu  cAu

Proof: To prove these properties, we use the fact that the matrix vector product can be written as a
linear combination (see page 3). Let A  a 1 a 2 . . . a n  where a 1 , a 2 , . . , a n are the columns of A and let
u1 v1 0 cu 1 u1  v1
u2 v2 0 cu 2 u2  v2
u v 0 cu  uv 
: : : : :
un vn 0 cu n un  vn
Then
u1
0
u2
0 Au  a 1 a 2 . . . a n   u 1 a 1  u 2 a 2 . . . u n a n
A0  a 1 a 2 . . . a n  :
:
un
0

 0a 1  0a 2 . . . 0a n v1
0 v2
Av  a 1 a 2 . . . a n   v 1 a 1  v 2 a 2 . . . v n a n
:
vn

u1  v1 cu 1
u2  v2 cu 2
Au  v  a 1 a 2 . . . a n  Acu  a 1 a 2 . . . a n1 
: :
un  vn cu n

 u 1  v 1 a 1  u 2  v 2 a 2 . . . u n  v n a n  cu 1 a 1  cu 2 a 2 . . . cu n a n

 u 1 a 1  u 2 a 2 . . . u n a n   v 1 a 1  v 2 a 2 . . . v n a n   cu 1 a 1   cu 2 a 2  . . . cu n a n 

 Au  Av  cu 1 a 1  u 2 a 2 . . . u n a n   cAu
5 The Matrix Vector Product - Matrix Transformations 5-9

Homework: Verify properties (a), (b) and (c) for


5 4 0
3 2 4
A u 7 v 3 0 0 and c  4.
5 1 2
2 1 0

You might also like