Math 104, Summer 2010
Midterm Exam
1
1. (a) |u + v|2 = (u + v) (u + v) = |u|2 + 2u v + |v|2 , so u v = 2 (|u + v|2 |u|2 |v|2 ) =
1
(25 16 1) = 4. Alternatively, some of you noticed that this is a case of equality holding in the
2
triangle inequality, so u
Math 104
Winter 2012
Homework 5: solution set
Problem 1
(a) By computing the eigenvalues and eigenvectors of A A, we have the SVD A = U V , where
2
2
U=
22
22
2
2
10 2
, =
0
3
0
, V = 54
5
52
4
5.
3
5
Denote U = [u1 , u2 ] and V = [v1 , v2 ]. The SVD
Math 104
Winter 2012
Homework 6: solution set
Problem 1, 7.1
1
(a) Suppose that A = 0
1
0
1 = [a1 , a2 ]. We will use the Classical Gram-Schmidt method to calculate
0
2
2
a1
0
the reduced and full QR decomposition of A. We begin with r11 = a1 = 2, q1 =
Math 104
Winter 2012
Homework 7: solution set
Matrices are bold capital, vectors are bold lowercase and scalars or entries are not bold.
Problem 2
Since A is Hermitian, the spectral theorem asserts that A = U U , where U is a unitary matrix and
= diag(1
Math 104
Winter 2012
Homework 8: solution set
Problem 1
There are n n matrices D diagonal and V invertible such that A = V DV 1 . The elements on the
diagonal of D are the eigenvalues of A denoted by j . Then
det(A) = det(V ) det(D ) det(V 1 ) = det(V V 1
1
Math 104
Agenda
Inexact computation
Bad pivoting
Rooting of polynomials
2
Nnumerical stability
Computer arithmetic is inexact (nite memory)
Issues arise from inexact computations
Interested in robust and stable algorithms
3
Number representation
F
Math 104 Fall 2008
Class notes
Laurent Demanet
Draft December 1, 2008
2
Preface
These class notes complement the class textbook Numerical Linear Algebra
by Trefethen and Bau. They do not suce in themselves as study material;
it is only in combination with
Agenda
Math 104
1
Google PageRank algorithm
2
Developing a formula for ranking web pages
3
Interpretation
4
Computing the score of each page
Google: background
Mid nineties:
many search engines
often times not that eective
Late nineties:
Google goes onlin
Math 104
Winter 2012
Unitary matrices
As we have seen in class, an n n unitary matrix U is a matrix obeying
U U = I .
(1)
Expressed dierently, a unitary matrix is a matrix whose inverse is its adjoint. If the columns of U are the
vectors u1 , . . . , un ,
Math 104: Lecture 1
Agenda:
Course organization
Why linear algebra?
Course objectives
Matrix vector products
Least-squares problem
Course organization
http:/www-stat.stanford.edu/~candes/math104/index.shtml
Why linear algebra?
Fundamental tool to understa
Math 104, HW 1, Due 4/15 before class
Please write down your name and Stanford ID and staple your solutions. Solutions are
due before the class.
1. Prove that if C, v Cn , and v = 0, then either = 0 or v = 0.
2. Prove that if (v1 , . . . , vn ) spans a ve
Math 104
Winter 2012
Homework 4: solution set
Problem 2
Consider the 2 2 matrix
P=
1
0
1
.
0
This matrix obeys P 2 = P but is not orthogonal since it is not symmetric. This matrix projects points onto
the horizontal line in a direction parallel to the 45
Math 104
Winter 2012
Homework 3: solution set
Matrices are bold capital, vectors are bold lowercase and scalars or entries are not bold.
Problem 1
Since x y C we have (x y ) = (x y ) and so y x = (x y ).
Applying this result give y Ax = y (Ax) = (Ax) y =
Math 104
winter 2012
Homework 2: solution set
We use the notations below to ease readability. Matrices are bold capital, vectors are bold lowercase
and scalars or entries are not bold. For instance, A is a matrix and aij (sometimes, A(i, j ) its (i, j )th
Math 104, Summer 2010
Homework 3 Solutions
1. (a) Note that V is the set of all solutions x to the matrix-vector equation Ax = 0 where
A=
1200
.
1011
Putting A into row echelon form gives
10
1
1
.
0 1 1/2 1/2
so the system of equations dening V is
w+y+z =
Math 104, Summer 2010
Homework 2 Solutions
1. Let r1 , ., rm denote the columns of R. We rst claim that
spancfw_r1 , ., rj = spancfw_e1 , ., ej .
Since R is upper-triangular, obviously spancfw_r1 , ., rj spancfw_e1 , ., ej . But it is easy
to show that
Math 104, Summer 2010
Final Exam
Instructions: You may not use any books, notes, or calculators, or electronic devices. Write all
your answers in the blue book. Be sure to make clear how you arrive at your answers. You have 3
hours; it may be best to rst
Math 104, Summer 2010
Final Exam Solutions
1. (15 pts.) Suppose A is a 2 2 matrix with two distinct eigenvalues = . Show that A is
diagonalizable.
Solution: Let x, y be eigenvectors for , . (By denition, every eigenvalue has at least one
eigenvector.) We
Math 104, Summer 2010
Homework 1 Solutions
1. (a) Notice v1 + v2 + v3 = 0, so v3 = v2 v1 , and hence spancfw_v1 , v2 , v3 = spancfw_v1 , v2 .
Since v1 , v2 are not scalar multiples of each other, they are linearly independent. Hence they
form a basis for
Math 104 - Fall 2008 - Final Exam
Name:
Student ID:
Signature:
Instructions: Print your name and student ID number, write your signature to indicate
that you accept the honor code. During the test, you may not use computers, phones, or
any other electroni
Math 104
winter 2012
Homework 1: solution set
Problem 2
7
1
4
If 8 is in the span of 1 and 1 then there will exist and such that
9
3
2
7
1
4
1
5
8 = 1 + 1 = ( ) 1 + 0 .
9
3
2
3
5
The middle row give = 8 and replacing in the previous system
15
5
0 = 0 ,
3
Math 104, HW 2, Due 4/22 before class
Please write down your name and Stanford ID and staple your solutions. Solutions are
due before the class.
1. Suppose that A Rpq is injective and (v1 , . . . , vn ) is linearly independent in Rq .
Prove that (Av1 , .
Math 104, HW 3, Due 4/29 before class
Please write down your name and Stanford ID and staple your solutions. Solutions are
due before the class.
1. Prove that if x, y are two non-zero vectors in R2 , then
x, y = x
y cos
where is the angle between x and y
Problem Set 8 Solutions
Problem 1:
First to nd the locations in the QR decomposition of a tridiagonal symmetric matrix that must
be zero. From the Gramm-Schmidt algorithm, we know the ith column of Q is a linear combination
the rst i columns of A. Because
Problem Set 6 Solutions
Problem 1:
(a)
We will show that f (x) = 2x computed via the algorithim f (x) = x x is backwards stable
(and hence also stable). Our computations in this problems are all with real numbers, so we may
take the norm to be absolute va
Problem Set 7 Solutions
Problem 1:
(a) Show that the diagonal entries of U 1 are the recipricals of the diagonals of U
Using Gaussian elimination to nd the inverse of U when U is upper triangular gives information
on the shape of U 1 . Recall that rref[U