Linear Algebra Solutions
Linear Algebra Solutions
Linear Algebra Solutions
_
0 2 1 1 0
1 0 2 1 0
_
swap
_
1 0 2 1 0
0 2 1 1 0
_
2
_
1 0 2 1 0
0 1
1
2
1
2
0
_
Using the reduced row echelon form we see that variables x
3
and x
4
remain unknown, and
the general solution is
_
_
_
_
x
1
x
2
x
3
x
4
_
_
_
_
=
_
_
_
_
2s + t
1
2
s +
1
2
t
s
t
_
_
_
_
= s
_
_
_
_
2
1
2
1
0
_
_
_
_
+ t
_
_
_
_
1
1
2
0
1
_
_
_
_
.
The vectors
_
_
_
_
2
1
2
1
0
_
_
_
_
,
_
_
_
_
1
1
2
0
1
_
_
_
_
form a basis for the kernel.
Question 2. Find k so that the matrices
_
_
1 2 0
1 0 2
1 1 1
_
_
and
_
_
3 1 0
1 1 4
2 0 k
_
_
have the
same image.
We need k so that span{
_
_
1
1
1
_
_
,
_
_
2
0
1
_
_
,
_
_
0
2
1
_
_
} = span{
_
_
3
1
2
_
_
,
_
_
1
1
0
_
_
,
_
_
0
4
k
_
_
}.
In particular
_
_
0
4
k
_
_
must belong to span{
_
_
1
1
1
_
_
,
_
_
2
0
1
_
_
,
_
_
0
2
1
_
_
}, meaning that there
must be c
1
, c
2
, c
3
so that c
1
_
_
1
1
1
_
_
+c
2
_
_
2
0
1
_
_
+c
3
_
_
0
2
1
_
_
=
_
_
0
4
k
_
_
. In other words the
system
_
_
1 2 0 0
1 0 2 4
1 1 1 k
_
_
must have a solution. We nd the reduced row echelon form
_
_
1 2 0 0
1 0 2 4
1 1 1 k
_
_
_
_
1 0 2 4
0 1 1 2
0 0 0 k + 2
_
_
1
For the system to have a solution, it must be that k + 2 = 0, in other words k = 2.
We know so far that k = 2 is the only candidate that could possibly make the matrices
_
_
1 2 0
1 0 2
1 1 1
_
_
and
_
_
3 1 0
1 1 4
2 0 k
_
_
have the same image. It remains to check that indeed
this k works, namely that with k = 2 the two matrices have the same image.
The vectors v
1
=
_
_
1
1
0
_
_
, v
2
=
_
_
0
2
1
_
_
span the image of
_
_
1 2 0
1 0 2
1 1 1
_
_
, because the
rst column is v
1
+v
2
, the second column is 2v
1
+v
2
, and the third column is v
2
. The same
vectors also span the image of
_
_
3 1 0
1 1 4
2 0 2
_
_
, because the rst column is 3v
1
+ 2v
2
, the
second columns is v
1
, and the third columns is 2v
2
. So the two images are equal; both are
equal to span{v
1
, v
2
}.
Question 3. Let T from R
5
to R
5
be orthogonal projection to span{
_
_
_
_
_
_
1
2
1
2
0
_
_
_
_
_
_
,
_
_
_
_
_
_
0
1
2
1
2
_
_
_
_
_
_
}. Find
the dimension of kernel(T).
The vectors
_
_
_
_
_
_
1
2
1
2
0
_
_
_
_
_
_
,
_
_
_
_
_
_
0
1
2
1
2
_
_
_
_
_
_
are linearly independent because they are not scalar multiples
of each other. Their span is precisely image(T), so rank(T) = dim(image(T)) = 2. By the
rank-nullity theorem we conclude
nullity(T) = 5 rank(T) = 5 2 = 3,
so dim(kernel(T)) = 3.
Question 4. Let v
1
=
_
_
_
_
1
1
1
1
_
_
_
_
, v
2
=
_
_
_
_
1
1
1
1
_
_
_
_
, and v
3
=
_
_
_
_
1
0
1
2
_
_
_
_
. Let W = span{v
1
, v
2
, v
3
}.
(a) Using Gram-Schmidt, nd an orthonormal basis w
1
, w
2
, w
3
for W.
w
1
=
v
1
v
1
=
v
1
2
=
_
_
_
_
1/2
1/2
1/2
1/2
_
_
_
_
(1)
2
w
2
=
v
2
(v
2
w
1
) w
1
v
2
(v
2
w
1
) w
1
=
v
2
0 w
1
2
=
_
_
_
_
1/2
1/2
1/2
1/2
_
_
_
_
(2)
w
3
=
v
3
(v
3
w
1
) w
1
(v
3
w
2
) w
2
v
3
(v
3
w
1
) w
1
(v
3
w
2
) w
2
=
v
3
1 w
1
+ 1 w
2
2
=
_
_
_
_
1/2
1/2
1/2
1/2
_
_
_
_
(3)
(b) Write each v
i
as a linear combination of w
1
, w
2
, w
3
, and nd the QR decomposition of
_
_
_
_
1 1 1
1 1 0
1 1 1
1 1 2
_
_
_
_
.
From equation (1) above we see that v
1
= 2 w
1
.
From equation (2) above we see that v
2
= 0 w
1
+ 2 w
2
.
From equation (3) above we see that v
3
= 1 w
1
1 w
2
+ 2 w
3
.
Collecting these equations into matrix form we get (v
1
v
2
v
3
) = ( w
1
w
2
w
3
)
_
_
2 0 1
0 2 1
0 0 2
_
_
.
In other words
_
_
_
_
1 1 1
1 1 0
1 1 1
1 1 2
_
_
_
_
=
_
_
_
_
1/2 1/2 1/2
1/2 1/2 1/2
1/2 1/2 1/2
1/2 1/2 1/2
_
_
_
_
_
_
2 0 1
0 2 1
0 0 2
_
_
.
This is the QR decomposition.
(c) Find a (non-zero) vector x in W
.
We need a vector x so that
_
_
_
w
1
x = 0
w
2
x = 0
w
3
x = 0
. In matrix form this is the system ( w
1
w
2
w
3
)
T
x =
0,
namely
_
_
1/2 1/2 1/2 1/2
1/2 1/2 1/2 1/2
1/2 1/2 1/2 1/2
_
_
x =
0. The general solution for this system is
x = s
_
_
_
_
1
1
1
1
_
_
_
_
. So x =
_
_
_
_
1
1
1
1
_
_
_
_
(or any scalar multiple of this vector) works.
3
Question 5. In this question, v
1
and v
2
are vectors in R
2
, and you are told that v
i
v
j
is
the entry a
ij
of the matrix
_
3 5
5 7
_
. L is the line spanned by v
1
.
(a) Find the {v
1
, v
2
} coordinates of proj
L
(v
2
).
From the matrix we read o v
2
v
1
= 5, and v
1
2
= v
1
v
1
= 3. So
proj
L
(v
2
) =
1
v
1
2
(v
2
v
1
)v
1
=
5
3
v
1
=
5
3
v
1
+ 0v
2
,
and the {v
1
, v
2
} coordinate vector of proj
L
(v
2
) is
_
5
3
0
_
.
(b) Find the {v
1
, v
2
} coordinates of the reection of v
2
about L.
We have re
L
(v
2
) = 2proj
L
(v
2
) v
2
= 2
5
3
v
1
v
2
=
10
3
v
1
v
2
. The {v
1
, v
2
} coordinate vector
of re
L
(v
2
) is
_
10
3
1
_
.
(c) Find the { v
1
, v
2
} matrix of reection about L.
The rst column of the matrix is the {v
1
, v
2
} coordinate vector of re
L
(v
1
), which is
_
1
0
_
,
since the reection of v
1
is v
1
itself. The second column of the matrix is the {v
1
, v
2
} coordinate
vector of re
L
(v
2
), which by (b) is
_
10
3
1
_
.
So the matrix is
_
1
10
3
0 1
_
.
Question 6. Find the orthogonal projection of
_
_
1
2
3
_
_
to the plane in R
3
spanned by
_
_
2
1
2
_
_
,
_
_
0
3
3
_
_
.
Let us rst orthonormalize the vectors v
1
=
_
_
2
1
2
_
_
, v
2
=
_
_
0
3
3
_
_
, that is, nd an orthonor-
mal basis of the plane. The Gram-Schmidt process gives w
1
=
_
_
2/3
1/3
2/3
_
_
, w
2
=
_
_
2/3
2/3
1/3
_
_
.
4
We now compute proj
span(v
1
,v
2
)
(
_
_
1
2
3
_
_
) = proj
span( w
1
, w
2
)
(
_
_
1
2
3
_
_
) =
(
_
_
1
2
3
_
_
w
1
) w
1
+ (
_
_
1
2
3
_
_
w
2
) w
2
=
10
3
_
_
2/3
1/3
2/3
_
_
+
5
3
_
_
2/3
2/3
1/3
_
_
=
_
_
10/9
20/9
25/9
_
_
.
Question 7. Find the least square solution x
to the system
_
_
_
_
1 2
2 4
1 4
2 3
_
_
_
_
x =
_
_
_
_
0
0
3
1
_
_
_
_
.
The least squares solution to Ax =
b is the vector x
so that
b Ax
is perpendicular to
image(A). This means A
T
(
b Ax
) =
0. So A
T
b A
T
Ax
=
0. This leads to the equations
(A
T
A)x
= A
T
b, and x
= (A
T
A)
1
A
T
= (A
T
A)
1
A
T
b =
1
10
_
9 4
4 2
__
1 2 1 2
2 4 4 3
_
_
_
_
_
0
0
3
1
_
_
_
_
=
1
10
_
9 4
4 2
__
5
15
_
=
1
10
_
15
10
_
=
_
1.5
1
_
.
Question 8. Find a point on the plane x
1
+ x
2
+ x
3
= 5 which is closest possible to the
origin.
The line through the origin perpendicular to the plane is span(
_
_
1
1
1
_
_
). We need a point
_
_
x
1
x
2
x
3
_
_
which lies both on this line and on the plane. In other words we need
_
_
x
1
x
2
x
3
_
_
=
c
_
_
1
1
1
_
_
and x
1
+ x
2
+ x
3
= 5. Solving for c we get c =
5
3
, and
_
_
x
1
x
2
x
3
_
_
=
5
3
_
_
1
1
1
_
_
.
5