Exam Practice Problems | Numerical Linear Algebra | CSCI 5646, Study notes of Linear Algebra

Exam Practice Problems Material Type: Notes; Class: NUMERICAL LINEAR ALGEBRA; Subject: Computer Science; University: University of Colorado - Boulder; Term: Fall 2008;

Typology: Study notes

2019/2020

Uploaded on 11/25/2020

koofers-user-f8m
koofers-user-f8m 🇺🇸

9 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCI 5646
September 23, 2008
Exam Practice Problems Selected Solutions
1. Let Pbe a projection matrix onto a line in the xy-plane. What trans-
formation is performed by the matrix H=I2P? What transfor-
mation is performed by H2? Explain your answers both algebraically
and geometrically (include pictures).
Solution:
If P x is the projection of xonto the line l, then Hx is the reflection
of xabout the line perpendicular to l.
The vector xcan be written as the sum of two orthogonal components:
P x which is on the line land y=xP x which is orthogonal to l.
The operation
Hx = (I2P)x= (xP x)P x =yP x
takes the component yand adds to it P x. This has the effect of
recreating the vector xbut reflected about y.
H2xis just x. By the same argument as above, the second application
of Hreflects Hx back across the line orthogonal to P x.
2. Find the projection of bonto the column space of Awhen
A=
1 1
21
2 4
and b=
1
2
7
.
Split binto p+qwith pin the column space of Aand qperpendicular
to that space. Which of the four fundamental subspaces of Acontains
q? Why?
Solution:
The projection of bonto the column space of Ais
P b =A(ATA)1ATb=
1 1
21
2 4
99
9 18 1
1 1
21
2 4
T
1
2
7
=
3
0
6
.
Use p=P b, then q=bp= ( 2 2 1 )T.Check that this qis
orthogonal to p:pTq= 0. Thus, qis in the left nullspace of A.
1
pf3
pf4
pf5

Partial preview of the text

Download Exam Practice Problems | Numerical Linear Algebra | CSCI 5646 and more Study notes Linear Algebra in PDF only on Docsity!

CSCI 5646

September 23, 2008

Exam Practice Problems Selected Solutions

  1. Let P be a projection matrix onto a line in the xy-plane. What trans- formation is performed by the matrix H = I − 2 P? What transfor- mation is performed by H^2? Explain your answers both algebraically and geometrically (include pictures). Solution: If P x is the projection of x onto the line l, then Hx is the reflection of x about the line perpendicular to l. The vector x can be written as the sum of two orthogonal components: P x which is on the line l and y = x − P x which is orthogonal to l. The operation

Hx = (I − 2 P )x = (x − P x) − P x = y − P x

takes the component y and adds to it −P x. This has the effect of recreating the vector x but reflected about y. H^2 x is just x. By the same argument as above, the second application of H reflects Hx back across the line orthogonal to P x.

  1. Find the projection of b onto the column space of A when

A =

 

  (^) and b =

 

  (^).

Split b into p + q with p in the column space of A and q perpendicular to that space. Which of the four fundamental subspaces of A contains q? Why? Solution: The projection of b onto the column space of A is

P b = A(AT^ A)−^1 AT^ b =

 

 

( 9 − 9 − 9 18

)− 1  

 

T  

  (^) =

 

  (^).

Use p = P b, then q = b − p = ( − 2 2 1 )T^. Check that this q is orthogonal to p: pT^ q = 0. Thus, q is in the left nullspace of A.

  1. Describe the column space and the nullspace of the following matrices:

A =

( 1 − 1 0 0

) , B =

( 0 0 0 0 0 0

) .

Solution: The column space of A is the set of all linear combinations of the two column vectors

( 1 0

) and

( − 1 0

)

. That is, it is the set of all vectors

of the form

( α − β 0

) for some scalars α and β or, in other words, all vectors of dimension 2 with a zero second element. The nullspace of A is the set of all solutions to the homogeneous system Av = 0. If v =

( v 1 v 2

) is a solution, then

Av =

( v 1 − v 2 0

)

( 0 0

) .

So the nullspace of A is the set off all vectors v with equal elements. The column space of B is the zero vector of dimension 2 because all columns of B are the zero vector and all linear combinations of the zero vector are the zero vector itself. The nullspace of B is all of R^3 because any vector multiplied by B gives the zero vector.

  1. Find a third column so that the matrix

Q =

 

√^1 3 √^1 14 √^1 3 √^2 14 √^1 3 √^ −^3 14

 

is orthogonal. Is there more than one choice for that third column? Why or why not?

Solution: We can build the third column out of any vector that is linearly inde- pendent of the first two. To make the math a little easier, we choose a starting vector of v = ( 42 0 0 )T^. But ANY linearly independent starting vector will give the same answer or its negative. (There are two possible solutions along the same line but with opposite direc- tions.) Applying the Classical Gram-Schmidt process gives

ˆq 3 = v − (vT^ q 1 )q 1 − (vT^ q 2 )q 2

 

  (^) − ( √^42 3

  

√^1 3 √^1 3 √^1 3

   −^ (

  

√^1 14 √^2 14 √^ −^3 14

  

 

  (^) − 2 2 +

 

  (^) √^1 2

 

 

 

  (^) − √^2 2

 

 

 

  (^).

The second column is different, and we have

H 1 a 2 =

( I − 2 uuT ‖ u ‖ 22

) a 2

 

  (^) − 2 2 +

 

  (^) √^1 2

 

 

 

  (^) − √^2 2

 

 

 

  (^).

We then have to put a zero in the (3,2) position using H 2. We thus work on the vector x =

( √^2 2

)

. In this case,

u =

x + ‖ x ‖ 2 e 1 √ 1 + x 1

( 2 +

) ,

and Hx =

) .

With this result, we have R =

 

  (^). We get Q by form-

ing H 1 and H 2 explicitly and multiplying to get Q = H 2 T H 1 T =  

− √^12 − √^16 − √^13

0 − √^26 √^13

− √^12 √^16 √^13

 .

You can check that this result agrees exactly with Matlab’s.

  1. Find the 1, 2, and ∞ norms of ( 2 1 − 4 −2 )T^.
  2. Write a Matlab script to determine the value of double precision ma- chine epsilon on any computer of your choosing. Compare your result to the Matlab constant eps. (They should be the same.)

Solution: Machine epsilon is the smallest number x such that f l(1 + x) > 1. Here’s a script that finds it:

function meps = macheps

meps = 1; while (1.0 + meps > 1.0) meps = meps/2; end meps = meps*

You just have to be careful not to get macheps/2.

  1. Consider a variation of the IEEE standard in which the exponent is represented by 3 bits and the fractional part of the mantissa is rep- resented by 5 bits. What is the range of positive computer numbers that can be represented? What is machine epsilon? Give your answers as both binary and decimal numbers. (Assume that all other rules of the IEEE standard apply, including normalized numbers and reserved exponent values.) Solution: First, consider the 3 bit exponents:

emin = (000) 2 = 0 emax = (111) 2 = 7.

The values 0 and 7 are reserved, so the range of biased exponents is [1, 6]. In IEEE, where there are 8 bits for the exponent, the bias on the exponent is 2^8 −^1 − 1 = 127. So, the bias on our exponent is 2^3 −^1 − 1 = 22 − 1 = 3, and the range of unbiased exponents p is [1 − 3 , 6 − 3] = [− 2 , 3]. For the 5 bit fraction:

fmin = (.00000) 2 = 0

fmax = (.11111) 2 = 0. 96875. Which translates into a mantissa of

mmin = min(1.f ) 2 = (1.00000) 2 = 1 mmax = max(1.f ) 2 = (1.11111) 2 = 1. 96875.