Docsity

Matrix Vector Multiplication - Lecture Notes | MATH 561, Study notes of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Lecture 1. Matrix-Vector Multiplication
You already know the formula for matrix-vector multiplication. Nevertheless,
the purpose of this rst lecture is to describe a wayofinterpreting such pro d-
ucts that may be less familiar. If
b
=
Ax
,then
b
is a linear combination of
the columns of
A
.
Familiar Denitions
Let
x
be an
n
-dimensional column vector and let
A
be an
m
n
matrix (
m
rows,
n
columns). Then the matrix-vector product
b
=
Ax
is an
m
-dimensional
column vector dened as follows:
b
i
=
n
X
j
=1
a
ij
x
j
i
=1
:::m
. (1
:
1)
Here
b
i
denotes the
i
th entry of
b
,
a
ij
denotes the
i j
entry of
A
(
i
th row,
j
th column), and
x
j
denotes the
j
th entry of
x
.For simplicity,we assume in
all but a few lectures of this book that quantities such as these belong to C,
the eld of complex numbers. The space of
m
-vectors is C
m
, and the space of
m
n
matrices is C
m
n
.
The map
x
7!
Ax
is
linear
, which means that, for any
x y
2
C
n
and any
2
C,
A
(
x
+
y
) =
Ax
+
Ay
,
A
(
x
) =
Ax
.
3
pf3
pf4
pf5
pf8

Partial preview of the text

Download Matrix Vector Multiplication - Lecture Notes | MATH 561 and more Study notes Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Lecture  MatrixVector Multiplication

You already know the formula for matrixvector multiplication Nevertheless the purp ose of this rst lecture is to describ e a way of interpreting such pro d ucts that may b e less familiar If b  Ax then b is a linear combination of the columns of A

Familiar Denitions

Let x b e an ndimensional column vector and let A b e an mn matrix m rows n columns Then the matrixvector pro duct b  Ax is an mdimensional column vector dened as follows

bi 

X^ n

j 

aij xj i      m 

Here bi denotes the ith entry of b aij denotes the i j entry of A ith row j th column and xj denotes the j th entry of x For simplicity we assume in all but a few lectures of this b o ok that quantities such as these b elong to C the eld of complex numb ers The space of mvectors is Cm^  and the space of m n matrices is Cmn^  The map x  Ax is linear  which means that for any x y  Cn^ and any   C

Ax y   Ax Ay  Ax  Ax

Part I Fundamentals

Conversely every linear map from Cn^ to Cm^ can b e expressed as multiplication by an m n matrix

A Matrix Times a Vector

Let aj denote the j th column of A an mvector Then  can b e rewritten

b  Ax 

X^ n

j 

xj aj   

This equation can b e displayed schematically as follows

b

a a    an

x x   xn

 ^ x

a

x

a

   xn

an

In   b is expressed as a linear combination of the columns aj  Nothing but a slight change of notation has o ccurred in going from  to   Yet thinking of Ax in terms of the form   is essential for a prop er understanding of the algorithms of numerical linear algebra One way to summarize these di erent ways of viewing matrixvector pro d ucts is like this As mathematicians we are used to viewing the formula Ax  b as a statement that A acts on x to pro duce b The formula   by contrast suggests the interpretation that x acts on A to pro duce b

Example  Fix a sequence of numb ers fx    xm g If p and q are p olyno mials of degree  n and  is a scalar then p q and  p are also p olynomials of degree  n Moreover the values of these p olynomials at the p oints xi satisfy the following linearity prop erties

p q xi   pxi  q xi   pxi    pxi 

Thus the map from vectors of co ecients of p olynomials p of degree  n to vectors  px  px     pxm  of sampled p olynomial values is linear Any linear map can b e expressed as multiplication by a matrix this is an example In fact it is expressed by an m n Vandermonde matrix

A 

 x x    xn  x x    xn  

 xm x m    xn m

 Part I Fundamentals

and  b ecomes

bj  Acj 

X^ m

k 

ck j ak  

Thus bj is a linear combination of the columns ak with co ecients ck j 

Example  A simple example of a matrixmatrix pro duct is the outer product  This is the pro duct of an mdimensional column vector u with an ndimensional row vector v  the result is an m n matrix of rank  The outer pro duct can b e written

u

h

v v    vn

i

v u v u    vn u

v u    vn u

 

v um    vn um

The columns are all multiples of the same vector u and similarly the rows are all multiples of the same vector v 

Example  As a second illustration consider B  AR  where R is the upp ertriangular n n matrix with entries rij   for i  j and rij   for i  j  This pro duct can b e written

b    bn

a    an

The column formula  now gives

bj  Arj 

X^ j

k 

ak  

That is the j th column of B is the sum of the rst j columns of A The matrix R is a discrete analogue of an indenite integral op erator

Range and Nullspace

The range of a matrix A written range A is the set of vectors that can b e expressed as Ax for some x The formula   leads naturally to the following characterization of range A

Theorem  range A is the space spanned by the columns of A

Lecture MatrixVector Multiplication 

Proof By   any Ax is a linear combination of the columns of A Con versely any vector y in the space spanned by the columns of A can b e written as a linear combination of the columns y 

Pn

j  xj aj ^ Forming^ a^ vector^ x out of the co ecients xj  we have y  Ax and thus y is in the range of A

In view of Theorem  the range of a matrix A is also called the column space of A The nul lspace of A  Cmn^  written null A is the set of vectors x that satisfy Ax   where  is the vector in Cm^  The entries of each vector x  null A give the co ecients of an expansion of zero as a linear combination of columns of A   x a x a    xn an 

Rank

The column rank of a matrix is the dimension of its column space Similarly the row rank of a matrix is the dimension of the space spanned by its rows Row rank always equals column rank among other pro ofs this is a corollary of the singular value decomp osition discussed in Lectures and  so we refer to this numb er simply as the rank of a matrix An m n matrix of ful l rank is one that has the maximal p ossible rank the lesser of m and n This means that a matrix of full rank with m  n must have n linearly indep endent columns Such a matrix can also b e characterized by the prop erty that the map it denes is onetoone

Theorem  A matrix A  Cmn^ with m  n has ful l rank if and only if it maps no two distinct vectors to the same vector

Proof  If A is of full rank its columns are linearly indep endent so they form a basis for range A This means that every b  range A has a unique linear expansion in terms of the columns of A and therefore by   every b  range A has a unique x such that b  Ax  Conversely if A is not of full rank its columns aj are dep endent and there is a nontrivial linear combination such that

Pn

j  cj aj ^ ^ The^ nonzero^ vector^ c^ formed^ from^ the co ecients cj satises Ac   But then A maps distinct vectors to the same vector since for any x Ax  Ax c

Inverse

A nonsingular or invertible matrix is a square matrix of full rank Note that the m columns of a nonsingular m m matrix A form a basis for the whole space Cm^  Therefore we can uniquely express any vector as a linear

Lecture MatrixVector Multiplication 

Multiplication by A^ is a change of basis op eration

b co ecients of the expansion of b in fe    em g

A^ b co ecients of the expansion of b in fa    am g

Multiplication by A

Multiplication by A

In this description we are b eing casual with terminology using b in one instance to denote an mtuple of numb ers and in another as a p oint in an abstract vector space The reader should think ab out these matters until he or she is comfortable with the distinction

A Note on m and n

Throughout numerical linear algebra it is customary to take a rectangular matrix to have dimensions m n We follow this convention in this b o ok What if the matrix is square The usual convention is to give it dimensions n n but in this b o ok we shall generally take the other choice m m Many of our algorithms require us to lo ok at rectangular submatrices formed by taking a subset of the columns of a square matrix If the submatrix is to b e m n the original matrix had b etter b e m m

Exercises

 Let B b e a matrix to which we apply the following op erations  double column   halve row   add row to row   interchange columns  and   subtract row from each of the other rows  replace column by column   delete column  so that the column dimension is reduced by  a Write the result as a pro duct of eight matrices b Write it again as a pro duct AB C same B  of three matrices

 Supp ose masses m m m m are lo cated at p ositions x x x x in a line and connected by springs with spring constants k k k whose natural

 Part I Fundamentals

lengths of extension are     Let f f f f denote the rightward forces on the masses eg f  k x x   a Write the matrix equation relating the column vectors f and x Let K denote the matrix in this equation b What are the dimensions of the entries of K in the physics sense eg mass times time distance divided by mass etc c What are the dimensions of det K  again in the physics sense d Supp ose K is given numerical values based on the units meters kilograms and seconds Now the system is rewritten with a matrix K ^ based on centime ters grams and seconds What is the relationship of K ^ to K  What is the relationship of det K ^  to det K 

 Generalizing Example   we say that a square or rectangular matrix R with entries rij is uppertriangular if rij   for i  j  By considering what space is spanned by the rst n columns of R and using  show that if R is a nonsingular m m upp ertriangular matrix then R ^ is also upp ertriangular The analogous result also holds for lowertriangular matrices

 Let f    f b e a set of functions dened on the interval   with the prop erty that for any numb ers d    d  there exists a set of co ecients c    c such that

X^ 

j 

cj fj i  di i      

a Show by app ealing to the theorems of this lecture that d    d determine c    c uniquely b Let A b e the   matrix representing the linear mapping from data d    d to co ecients c    c  What is the i j entry of A^