Projection

Problem

Let

V be the subspace of
R3
defined by the equation
x+y+z=0
and

b=[100].

Find

projV(b), the projection of
b
onto
V
.

Thought

Let

V be a subspace of
Rn
. We first recall that

V={x:x,v=0 for all vV}.

That is

V collects all vectors
x
that is perpendicular to any vector
vV
. For example, if
V
is the subspace of
R3
defined by
x+y+z=0
, which is a plane, then
V
is
span{1}
, which is the straight line defined by the normal vector
1
of
V
. It is intuitive and true that
dim(V)+dim(V)=dim(Rn)=n
.

Given a vector

bRn and a subspace
VRn
, it can be written as
b=w+h
such that
wV
and
hV
. It is like in physics we often write a vector as the sum of its horizontal and vertical components. Our goal is to find
w=projV(b)
.

As every subspace has a basis, let

{u1,,ud} be a basis of
V
. And let
A
be the
n×d
matrix whose columns are
u1,,ud
. Let us observe a few properties.

  1. Since
    wV
    ,
    w=c1u1++cdud
    for some scalars
    c1,,cd
    . Equivalently,
    w=Ac
    for some
    c=(c1,,cd)
    .
  2. Since
    hV
    , the fact
    h,u1==h,ud=0
    implies
    Ah=0
    .

Now, by pre-multiplying

A to
b=w+h
, we have
Ab=Aw
. Since
w=Ac
, we have
Ab=AAc
. Consequently,
c=(AA)1Ab
and

w=Ac=A(AA)1Ab,

which is the projection of

b onto
V
.

Sample answer

We may pick

u1=[110] and u1=[101]

such that

{u1,u2} is a basis of
V
. (Review How to solve a system of linear equations? to see how to find
u1
and
u2
.) Then let

A=[111001]

be the matrix whose columns are

u1 and
u2
.

The rest is the computation. By the projection formula, we have

projV(b)=A(AA)1Ab=[111001][2112]1[110101][100]=[231313],

which is the desired answer. We may double-check that this vector is in

V since the sum of its entries is
0
.

This note can be found at Course website > Learning resources.