# 作业math | 代做Algorithm – FINAL EXAM INFORMATION

### FINAL EXAM INFORMATION `````` math 207 Section 5 (WWW) Spring 2022
``````

#### FINAL EXAM INFORMATION

``````Time:The final exam is open for 72 hours starting Sunday midnight, May 8 and closing at Wednes-
``````
``````day midnight, May 11. You have 2 hours 10 minutes alloted to take exam.
``````
``````Content:Everything we covered this semester, except for 7.4 (singular value decomposition).
``````
``````Details: No external help is allowed. No use of calculators, no use of internet, no use of other
``````
``````people, no use of electronic devices, nothing outside your head.
``````

#### FINAL EXAM: REVIEW OF TOPICS AND SAMPLE PROBLEMS

• Topic 1:Linear systems of equations. You should be able to:
1. Row reduce a matrix to row echelon form (REF) and/or reduced row echelon form (RREF).
2. Solve a system of linear equations and write the solution set in parametric vector form.
3. Determine whether a given system of linear equations has 0, 1, or infinitely many solutions.
``````Sample problems:Find the solution set of the equationAx=b, and give your answer in para-
``````
``````metric form:
``````

#### 1 1 0 1

``````, b=
``````

#### 2 4 1 1

``````, b=
``````

#### 0

• Topic 2:Linear independence, spanning, and basis. You should be able:
1. Determine if a given sequence of column vectors is linear independent, spansR
``````m
, and/or forms
``````
``````a basis forR
``````
``````m
.
``````
1. Determine if a vector lies in the span of some other given vectors.
2. Understand that a sequence of exactlynvectors inR
``````n
is linearly independent if and only if it
``````
``````spansR
n
, if and only if it forms a basis forR
n
.
``````
``````Sample problem:For what value(s) of the parameterhis{v 1 ,v 2 ,v 3 }a basis ofR
``````
``````3
?
``````
``````v 1 :=
``````

#### 2

``````, v 2 :=
``````

#### 1

``````, v 3 :=
``````
``````h
``````

#### .

``````1
``````
• Topic 3:Matrices and linear transformations. You should be able to:
1. Find the standard matrix of a linear transformation.
2. Given a matrix, find bases for its null space, column space, and row space.
3. Given a linear transformation, find bases for its range and kernel.
4. Determine if a linear transformation is one-to-one and/or onto.
5. Compute the rank of a matrix or linear transformation.
6. Apply the Rank Theorem (what is also called Rank-Nullity).
``````Sample problems:Consider the linear transformationT:R
``````
``````4
R
``````
``````3
given by
``````

#### T

``````x 1
``````
``````x 2
``````
``````x 3
``````
``````x 4
``````

#### =

``````x 1 + 2x 2 + 4x 3 + 2x 4
``````
``````2 x 1 + 4x 2 +x 3  3 x 4
``````
``````3 x 1 + 6x 2  2 x 3  8 x 4
``````

#### .

``````1) Find a basis for the kernel ofT.
``````
``````2) Find a basis for the image ofT.
``````
``````3) Are there any two different vectorsx=yinR
4
for whichT(x) =T(y)?
``````
``````4) Are there any vectorsbinR
``````
``````3
for which the equationT(x) =bhas no solution?
``````
``````Are the following statements true or false?
``````
• There is a 511 matrix with 4 linearly independent columns.
• There is a 47 matrixAfor which dim NulA= 5.
• There is a 47 matrixAfor which dim RowA= 2.
• There is a 512 matrix with rank 7.
• Topic 4:Coordinates. You should be able to:
1. Find coordinates for a vector with respect to a given basis.
2. Use coordinates to determine if a given sequence of vectors is linearly independent, spans, and/or
``````forms a basis.
``````
1. Find the matrix of a linear transformation with respect to a given basis or bases.
2. Use the matrix of a linear transformation to find the image of a vector, or to say if the linear
``````transformation is one-to-one and/or onto.
``````
1. Change of coordinates, matrices of linear transformations in different coordinates.
``````a. Find the matrix of change of coordinates from different bases.
``````
``````b. Calculate the matrix of a linear transformation in a given basis.
``````
``````c. Use the change of coordinates matrix to calculate the matrix of a linear transformation
``````
``````in another basis.
``````
``````Sample problem 1:Use coordinate vectors to test whether the polynomials spanP 2 :
``````
``````1  3 t+ 5t
``````
``````2
,3 + 5t 7 t
``````
``````2
,4 + 5t 6 t
``````
``````2
, 1 t
``````
``````2
.
``````
``````Sample problem 2:Consider the standard basisE={e 1 ,e 2 ,e 3 }ofR
``````
``````3
, where as usual,
``````
``````e 1 =
``````

#### 0

``````, e 2 =
``````

#### 0

``````, e 3 =
``````

#### .

``````Also consider the basisB={b 1 ,b 2 ,b 3 }, where
``````
``````b 1 =
``````

#### 0

``````,b 2 =
``````

#### 0

``````,b 3 =
``````

#### .

``````1) Compute the coordinates [x]Eand [x]Bof the vectorx=
``````

#### 2

``````with respect to the basesE
``````
``````andB, respectively.
``````
``````2) Find the change of coordinates matrixPBEwhich transforms coordinate vectors in the basis
``````
``````Eto coordinate vectors in the basisB. For the vectorxabove, verify that [x]B=PBE[x]E.
``````
``````3) Consider the linear transformationT :R
``````
``````3
R
``````
``````3
for whichT(e 1 ) =e 2 ,T(e 2 ) =e 3 and
``````
``````T(e 3 ) = 0. Find the matrix [T]ErepresentingTin the standard basisE.
``````
``````4) Find the matrix [T]Bthat representsTin the basisB.
``````
• Topic 5:Eigenvalues, eigenvectors, diagonalization. You should be able to:
1. Find the eigenvalues of a matrix.
2. Find bases for the eigenspaces of a matrix.
3. Determine if a matrix can or cannot be diagonalized.
4. Diagonalize a matrix, where possible.
``````Sample problem:Diagonalize, if possible:
``````

#### .

• Topic 6:Orthogonality, projections, GramSchmidt process. You should be able to:
1. Use dot products to write a vector as a linear combination of orthogonal basis vectors.
2. Find the orthogonal projection of a vector in a subspace.
3. Find the closest approximation to a vector in a given subspace, and/or find the distance from
``````a vector to a subspace.
``````
1. Convert a basis for a subspace into an orthogonal or orthonormal basis for that subspace.
``````Sample problems:
``````
``````1) Find an orthonormal basis of the column space of the following matrix:
``````

#### .

``````(Notice that the columns ofAare linearly independent.)
``````
``````2) Consider the subspaceWofR
``````
``````3
spanned by
``````
``````v 1 =
``````

#### 1

``````v 2 =
``````

#### .

``````Find the vectorxinWwhich minimizes the distance from the vectorb=
``````

#### 3

``````toW, and
``````
``````compute the distance frombtoW.
``````
• Topic 7:Least squares solutions of linear systems, linear regression.
1. Find the least-squares solution to a linear system of equations.
2. Find the equation of the least-squares line that best fits a collection of points inR
``````2
.
``````
``````Sample problem:Find the equationy= 0 + 1 xof the least-squares line that best fits the data:
``````

#### ( 1 ,0),(0,1),(1,2),(2,4).

• Topic 8:Orthogonal diagonalization of a symmetric matrix. You should be able to:
1. Understand that a matrix is symmetric if and only if it is orthogonally diagonalizable, if and
``````only if there is an orthonormal basis consisting of eigenvectors for that matrix
``````
1. Given a symmetric matrixA, find an orthogonal matrixPand a diagonal matrixDfor which

#### A=PDP

``````
.
``````
``````Sample problem:Find an orthogonal matrixPand a diagonal matrixDfor whichA=PDP
``````
``````
:
``````

#### .

• Topic 9:Quadratic forms and constrained optimization. You should be able to:
1. Find the symmetric matrix of a quadratic form.
2. Find an orthogonal change of variables that eliminates cross-terms in a quadratic form.
3. Determine if a given quadratic form is positive definite, positive semidefinite, negative definite,
``````negative semidefinite, or indefinite.
``````
1. Given a quadratic formQ, use linear algebra to find the greatest and least values ofQ(x) subject
``````to the constraintx= 1.
``````
1. Given a quadratic formQ, use linear algebra to find a unit vectorxthat maximizes or minimizes
``````Q(x) on the unit sphere.
``````
``````Sample problem:Consider the quadratic formQ(x) = 4x
``````
``````2
1 ^4 x^1 x^2 + 7x
``````
``````2
2.
``````
``````1) Find a unit vectorxthat maximizes the value ofQ(x) subject to the constraintx= 1.
``````
``````2) ClassifyQas positive definite, positive semidefinite, negative definite, negative semidefinite, or
``````
``````indefinite.
``````

#### SOLUTIONS

• Topic 1:Find the solution set of the equationAx=b, and give your answer in parametric form:

#### 1 1 0 1

``````, b=
``````

#### 2 4 1 1

``````, b=
``````

#### SOLUTION:

``````1) Row reduce the augmented matrix:
``````
``````
``````

#### 1 1 0 1 7

``````R 3 =R 3 R 1

``````

#### 0 1 1 1 6

``````R 2 R 3

``````

#### 0 0 1 1 0

``````R 2 =R 2 +R 3

``````

#### 0 0 1 1 0

``````R 1 =R 1 R 3

``````

#### 0 0 1 1 0

``````R 1 =R 1 +2R 2

``````

#### 0 0 1 1 0

``````R 2 =R 2

``````

#### 0 0 1 1 0

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````

``````
``````x 1 + 3x 4 = 13
``````
``````x 2  2 x 4 = 6
``````
``````x 3 + x 4 = 0
``````
``````x 4 = free
``````
``````x 1 = 13 3 x 4
``````
``````x 2 =6 + 2x 4
``````
``````x 3 =x 4
``````
``````x 4 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````
``````x 4
``````

#### =

``````13  3 x 4
``````
``````6 + 2x 4
``````
``````x 4
``````
``````x 4
``````

#### 0

``````+x 4
``````

#### 1

``````, x 4 free.
``````
``````2) Row reduce the augmented matrix:
``````
``````"
``````
``````1 2 1 1 0
``````

#### 2 4 1 1 0

``````R 2 =R 2  2 R 1

``````

#### 0 0 1 3 0

``````R 1 =R 1 +R 2

``````

#### 0 0 1 3 0

``````R 2 =R 2

``````

#### 0 0 1 3 0

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````x 1 + 2x 2 + 2x 4 = 0
``````
``````x 2 = free
``````
``````x 3  3 x 4 = 0
``````
``````x 4 = free
``````
``````x 1 = 2 x 2  2 x 4
``````
``````x 2 = free
``````
``````x 3 = 3x 4
``````
``````x 4 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````
``````x 4
``````

#### =

`````` 2 x 2  2 x 4
``````
``````x 2
``````
``````3 x 4
``````
``````x 4
``````
``````=x 2
``````

#### 0

``````+x 4
``````

#### 1

``````, x 2 andx 4 free.
``````
• Topic 2:For what value(s) of the parameterhis{v 1 ,v 2 ,v 3 }a basis ofR
``````3
?
``````
``````v 1 :=
``````

#### 2

``````, v 2 :=
``````

#### 1

``````, v 3 :=
``````
``````h
``````

#### SOLUTION:

``````Row the reduce the matrixA=
``````
``````h
``````
``````v 1 v 2 v 3
``````
``````i
``````
``````to REF:
``````
``````1 1 h
``````

#### 2 1 0

``````R 2 =R 2 R 1

``````
``````1 1 h
``````
``````0 0 3h
``````

#### 2 1 0

``````R 3 =R 3 +2R 1

``````
``````1 1 h
``````
``````0 0 3h
``````
``````0 3 2 h
``````
``````R 2 R 3

``````
``````1 1 h
``````
``````0 3 2 h
``````
``````0 0 3h
``````
``````The vectors{v 1 ,v 2 ,v 3 }form a basis forR
``````
``````3
if and only if the square matrixA=
``````
``````h
``````
``````v 1 v 2 v 3
``````
``````i
``````
``````has pivots all down its diagonal. That happens if and only ifh= 3.
``````
• Topic 3:Consider the linear transformationT:R
``````4
R
``````
``````3
given by
``````

#### T

``````x 1
``````
``````x 2
``````
``````x 3
``````
``````x 4
``````

#### =

``````x 1 + 2x 2 + 4x 3 + 2x 4
``````
``````2 x 1 + 4x 2 +x 3  3 x 4
``````
``````3 x 1 + 6x 2  2 x 3  8 x 4
``````

#### .

``````1) Find a basis for the kernel ofT.
``````
``````2) Find a basis for the image ofT.
``````
``````3) Are there any two different vectorsx=yinR
4
for whichT(x) =T(y)?
``````
``````4) Are there any vectorsbinR
``````
``````3
for which the equationT(x) =bhas no solution?
``````

#### SOLUTION:

``````1) Find the standard matrix forT. Denotinge 1 ,...,e 4 for the standard basis vectors ofR
``````
``````4
, the
``````
``````standard matrix is
``````

#### A=

``````h
``````
``````T(e 1 ) T(e 2 ) T(e 3 ) T(e 4 )
``````
``````i
``````
``````=
``````

#### .

``````The kernel ofTis the same as the null space ofA, so we need to find a basis for NulA. Row
``````
``````reduce:
``````
``````h
``````
``````A 0
``````
``````i
``````
``````=
``````

#### 3 6 2 8 0

``````R 2 =R 2  2 R 1

``````

R 3 =R 3 3 R 1

#### 0 0 14 14 0

``````R 3 =R 3  2 R 2

``````

#### 0 0 0 0 0

``````R 2 =
``````
``````1
7
R 2

``````

#### 0 0 0 0 0

``````R 1 =R 1  4 R 2

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````

``````
``````x 1 + 2x 2  2 x 4 = 0
``````
``````x 2 = free
``````
``````x 3 + x 4 = 0
``````
``````x 4 = free
``````
``````x 1 = 2 x 2 + 2x 4
``````
``````x 2 = free
``````
``````x 3 =x 4
``````
``````x 4 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````
``````x 4
``````

#### =

`````` 2 x 2 + 2x 4
``````
``````x 2
``````
``````x 4
``````
``````x 4
``````
``````=x 2
``````

#### 0

``````+x 4
``````

#### 1

``````, x 2 andx 4 free.
``````
``````The kernel is two-dimensional, and a basis is given by
``````
``````

``````

#### .

``````2) The image ofTis the same as the column space of its standard matrixA, so we just need to
``````
``````find a basis for ColA. One basis is given by the pivot columns ofA. From our work above, we
``````
``````know the first and third columns contain pivots. Our answer is
``````
``````

``````

#### .

``````3) This is just asking ifTis one-to-one. The kernel ofTis bigger than{ 0 }, soTis not one-to-one.
``````
``````The answer is yes, there are different vectorsx=yinR
``````
``````4
for whichT(x) =T(y).
``````
``````4) This is just asking ifTis onto. The image ofTis two-dimensional, so it is not all ofR
``````
``````3
``````

. The

``````answer is yes, there are vectorsbinR
``````
``````3
for which the equationT(x) =bhas no solution.
``````
``````True / False questions: See class notes.
``````
• Topic 4:Use coordinate vectors to test whether the polynomials spanP 2 :
``````1  3 t+ 5t
``````
``````2
,3 + 5t 7 t
``````
``````2
,4 + 5t 6 t
``````
``````2
, 1 t
``````
``````2
.
``````

#### SOLUTION:

``````Find coordinate vectors for the polynomials with respect to the standard basisB={ 1 ,t,t
``````
``````2
}.
``````
``````(You could use a different basis if you want, but that would probably be harder.) Since we are using
``````
``````the standard basis, the coordinates are just the coefficients:
``````
``````h
``````
``````1  3 t+ 5t
2
c
``````
``````i
``````
``````B
``````

#### ,

``````h
``````
``````3 + 5t 7 t
2
c
``````
``````i
``````
``````B
``````

#### ,

``````h
``````
``````4 + 5t 6 t
``````
``````2
c
``````
``````i
``````
``````B
``````

#### ,

``````h
``````
``````1 t
``````
``````2
c
``````
``````i
``````
``````B
``````

#### .

``````Instead of asking whether the polynomials spanP 2 , we can just ask if their coordinates spanR
``````
``````3
.
``````
``````Put the columns in a matrix and row reduce to echelon form:

``````

#### 5 7 6 1

``````R 2 =R 2 +3R 1

``````

#### 5 7 6 1

``````R 3 =R 3  5 R 1

``````

#### 0 8 14 6

``````R 3 =R 3 +2R 2

``````

#### .

``````There is not a pivot in every row, so the coordinate vectors do not spanR
3
``````

``````is no, these polynomials do not spanP 2.
``````
• Topic 5:Diagonalize, if possible:

#### SOLUTION:

``````Our goal is to find a basis forR
3
consisting of eigenvectors forA.
``````
``````The first step is to find the eigenvalues. Compute the characteristic polynomial and set it equal
``````
``````to zero:
``````

det(AI) =

``````1  1 1
``````
``````2 2  2
``````
`````` 1  1  1
``````
``````= (1)
``````
``````2  2
``````
`````` 1  1
``````

#### 2 2

`````` 1  1
``````

#### +

``````2 2
``````

#### 1 1

``````= (1)
``````
``````h
``````
``````(2)( 1 )2(1)
``````
``````i
``````
``````
``````
``````h
``````
``````2( 1 )2(1)
``````
``````i
``````
``````+
``````
``````h
``````
``````2(1)(2)(1)
``````
``````i
``````
``````= (1)(
``````
``````2
)( 2 ) + ()
``````
``````=
``````
``````3
+ 2
``````
``````2
``````
``````=
``````
``````2
(2).
``````
``````The eigenvalues are= 0 (with algebraic multiplicity 2) and= 2 (with algebraic multiplicity 1).
``````
``````The next step is to find bases for each of the eigenspaces. We start with the 0-eigenspace,
``````
``````Nul(A 0 I) = Nul(A). It consists of solutions to the homogeneous equationAx= 0 , so we row
``````
``````reduce an augmented matrix:
``````
``````h
``````
``````A 0
``````
``````i
``````
``````=
``````

#### 1 1 1 0

``````R 2 =R 2  2 R 1

``````

#### 1 1 1 0

``````R 3 =R 3 +R 1

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````x 1 +x 2 +x 3 = 0, x 1 =x 2 x 3.
``````
``````Writexas a vector in parametric vector form, using the free variables as parameters:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````

#### =

``````x 2 x 3
``````
``````x 2
``````
``````x 3
``````
``````=x 2
``````

#### 0

``````+x 3
``````

#### 1

A basis for the 0-eigenspace is given by:

``````

``````

#### .

``````Repeat to find a basis for the 2-eigenspace, Nul(A 2 I). It consists of solutions to the homogeneous
``````

equation (A 2 I)x= 0 , so we row reduce an augmented matrix:

``````h
``````
``````A 2 I 0
``````
``````i
``````
``````=
``````

#### 1 1 3 0

``````R 2 =R 2 +2R 1

``````

#### 1 1 3 0

``````R 3 =R 3 R 1

``````

#### 0 2 4 0

``````R 3 =R 3 +R 2

``````

#### 0 0 0 0

``````R 2 =
``````
``````1
2
R 2

``````

#### 0 0 0 0

``````R 1 =R 1 R 2

``````

#### 0 0 0 0

``````R 1 =R 1

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
(
x 1 + x 3 = 0
``````
``````x 2 + 2x 3 = 0
``````

#### (

``````x 1 =x 3
``````
``````x 2 = 2 x 3
``````
``````Writexas a vector in parametric vector form, using the free variables as parameters:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````

#### =

``````x 3
``````
`````` 2 x 3
``````
``````x 3
``````
``````=x 3
``````

#### .

A basis for the 2-eigenspace is given by

``````

``````

#### .

``````Finally, put all the eigenspace bases together and see if we have as many vectors as the size ofA.
``````

In this case, 2 + 1 = 3, and we have a basis of eigenvectors. To writeA=PDP

`````` 1
withPinvertible
``````

andDdiagonal, use the basis of eigenvectors for the columns ofP, and put their corresponding

eigenvalues on the diagonal ofD:

#### .

• Topic 6:
``````1) Find an orthonormal basis of the column space of the following matrix:
``````

#### .

``````(Notice that the columns ofAare linearly independent.)
``````
``````2) Consider the subspaceWofR
3
spanned by
``````
``````v 1 =
``````

#### 1

``````v 2 =
``````

#### .

``````Find the vectorxinWwhich minimizes the distance from the vectorb=
``````

#### 3

``````toW, and
``````
``````compute the distance frombtoW.
``````

#### SOLUTION:

``````1) Letv 1 ,v 2 ,v 3 be the columns ofA:
``````
``````v 1 =
``````

#### 1

``````,v 2 =
``````

#### 0

``````,v 3 =
``````

#### .

``````We want an orthonormal basis forW := ColA, and a regular (not even orthogonal) basis is
``````
``````given byv 1 ,v 2 ,v 3. Use the GramSchmidt  Algorithm to find an orthogonal basis. In every
``````
``````step, we find an orthogonal projection and then rip it out.
``````
``````First set
``````
``````u 1 =v 1 =
``````

#### .

``````Letp 2 be the orthogonal projection ofv 2 onto span{u 1 }:
``````
``````p 2 =
``````
``````v 2 u 1
``````
``````u 1 u 1
``````
``````u 1 =
``````

#### 3

``````u 1 =
``````
``````1
3
``````
``````
``````
``````1
3
``````
``````0
``````
``````1
3
``````

#### .

Then define

``````u 2 :=v 2 p 2 =
``````

#### 0

``````1
3
``````
``````
``````
``````1
3
``````
``````0
``````
``````1
3
``````

#### 2 3 1 3 1

``````1
3
``````

#### .

Nowu 1 andu 2 form an orthogonal basis for span{v 1 ,v 2 }. We can get a nicer basis by rescaling

u 2 to clear the fractions:

``````u
``````
``````
2 := 3u^2 =
``````

#### .

Nowu 1 andu 2 also form an orthogonal basis for span{v 1 ,v 2 }.

Go again. Letp 3 be the orthogonal projection ofv 3 onto span{v 1 ,v 2 }:

``````p 3 =
``````
``````v 3 u 1
``````
``````u 1 u 1
``````
``````u 1 +
``````
``````v 3 u

2
``````
``````u
``````
``````
2
u
``````
``````
2
``````
``````u
``````
``````
2 =
``````

#### 3

``````u 1 +
``````

#### 15

``````u
``````
``````
2 =
``````

#### .

Then define

``````u 3 :=v 3 p 3 =
``````

#### .

Nowu 1 ,u 2 , andu 3 form an orthogonal basis forW = ColA. We can get a nicer-looking

orthogonal basis by rescalingu 3 to clear the fractions:

``````u
``````
``````
3 :=
``````

#### 2

``````u 3 =
``````

#### .

Finally, normalize the orthogonal basis to get an orthonormal basis

``````n
1
u 1
u 1 ,
``````
``````1
u 2
u
``````
``````
2 ,
``````
``````1
u 3
u
``````
``````
3
``````
``````o
``````
``````.
``````

We have

``````u 1 =
``````
``````3 , u
``````
``````
2 =
``````
``````15 , u
``````
``````
3 =
``````

#### 15 ,

``````

``````

#### .

1. The closest vector tobinWis given by its orthogonal projection
``````b. In order to find that, we
``````
``````first need an orthogonal basis forW. We can see thatv 1 andv 2 are linearly independent, so
``````
``````they form a basis forW. Use the GramSchmidt algorithm. Start by setting
``````
``````u 1 :=v 1 =
``````

#### .

``````Letp 2 be the orthogonal projection ofv 2 onto span{u 1 }:
``````
``````p 2 =
``````
``````v 2 u 1
``````
``````u 1 u 1
``````
``````u 1 =
``````

#### 2

``````u 1 =
``````

#### .

``````Then define
``````
``````u 2 =v 2 p 2 =
``````

#### .

``````Nowu 1 andu 2 form an orthogonal basis forW, and we can use them to find our projection:
``````
``````b=
``````
``````bu 1
``````
``````u 1 u 1
``````
``````u 1 +
``````
``````bu 2
``````
``````u 2 u 2
``````
``````u 2 =
``````

#### 2

``````u 1 +
``````

#### 1

``````u 2 =
``````

#### .

``````This is the closest approximation tobinW.
``````
``````Then the distance frombtoWis
b
b
``````

. We have

``````bb=
``````

#### ,

``````so the distance is
``````
``````b
b
=
``````
``````p
2
2
+ 2
2
= 2
``````

#### 2.

• Topic 7:Find the equationy= 0 + 1 xof the least-squares line that best fits the data:

#### SOLUTION:

``````We wish we could find 0 and 1 so that all of our data points lie on the liney= 0 + 1 x. In
``````
``````other words, we wish we could solve the following system of equations:
``````
`````` 0 + 1 (1) = 0
``````
`````` 0 + 1 (0) = 1
``````
`````` 0 + 1 (1) = 2
``````
`````` 0 + 1 (2) = 4.
``````
``````The system is inconsistent because there is no line that passes through all four data points. Short
``````
``````of solving the system, we find a least-squares solution. The corresponding matrix equation is
``````
``````
1  1
``````

#### "

`````` 0
``````
`````` 1
``````

#### ,

``````orX=y, where
``````

#### 1 2

``````, y=
``````

#### .

``````Solve the normal equationsX
``````
``````
X=X
``````
``````
y. The coefficient matrix is
``````

#### X

``````
X=
``````

#### ,

``````and the augmented column is
``````

#### X

``````
y=
``````

#### .

``````Row reduce the augmented matrix:
``````
``````h
``````
``````X
``````
``````
X X
``````
``````
y
``````
``````i
``````
``````=
``````

#### 2 6 10

``````R 1 R 2

``````

#### 4 2 7

``````R 1 =
``````
``````1
2
R 1

``````

#### 4 2 7

``````R 2 =R 2  4 R 1

``````

#### 0 10 13

``````R 2 =
``````
`````` 1
10
R 2

``````

#### 0 1

``````13
10
``````
``````R 1 =R 1  3 R 2

``````

#### 1 0

``````11
10
``````
``````0 1
``````
``````13
10
``````

#### .

``````The least-squares solution is 0 =
``````
``````11
10
, 1 =
``````
``````13
10
, so the least-squares line of best fit isy=
``````
``````11
10
``````

#### +

``````13
10
x.
``````
• Topic 8:Find an orthogonal matrixPand a diagonal matrixDfor whichA=PDP :

#### SOLUTION:

``````First, find the eigenvalues ofAby computing its characteristic polynomial and setting it equal to
``````
``````zero:
``````
``````det(AI) =
``````
`````` 3  1 5
``````
``````1 1  1
``````
``````5 1  3
``````

#### .

``````We do a cofactor expansion across the top:
``````
``````det(AI) = ( 3 )
``````
``````1  1
``````
``````1  3
``````

#### 1 1

``````5  3
``````

#### + 5

``````1 1
``````

#### 5 1

``````= ( 3 )
``````
``````h
``````
``````(1)( 3 )(1)(1)
``````
``````i
``````
``````
``````
``````h
``````
``````(1)( 3 )(1)(5)
``````
``````i
``````
``````+ 5
``````
``````h
``````
``````(1)(1)(1)(5)
``````
``````i
``````
``````= ( 3 )(
``````
``````2
+ 24)( 8 ) + 5(4 + 5)
``````
``````=
``````
``````3
5
``````
``````2
+ 24
``````
``````=(
``````
``````2
+ 524)
``````
``````=(+ 8)(3).
``````
``````The eigenvalues are 1 = 3, 2 = 0, and 3 =8.
``````
``````Next, find an orthonormal basis for each eigenspace. We start with the eigenvalue 1 = 3. We
``````
``````want to solve the equationAx= 3x, or (A 3 I)x= 0. Row reduce the augmented matrix:
``````

h

``````A 3  0
``````
``````i
``````
``````=
``````

#### 5 1 6 0

``````R 1 R 2

``````

#### 5 1 6 0

``````R 2 =R 2 +6R 1

``````

#### 5 1 6 0

``````R 3 =R 3  5 R 1

``````

#### 0 11 11 0

``````R 3 =R 3 +R 2

``````

#### 0 0 0 0

``````R 2 =
``````
``````1
11
``````
``````R 2

``````

#### 0 0 0 0

``````R 1 =R 1 +2R 2

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````

``````
``````x 1 x 3 = 0
``````
``````x 2 x 3 = 0
``````
``````x 3 = free
``````
``````x 1 =x 3
``````
``````x 2 =x 3
``````
``````x 3 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````

#### =

``````x 3
``````
``````x 3
``````
``````x 3
``````
``````=x 3
``````

#### 1

``````, x 3 free.
``````
``````The 3-eigenspace is one-dimensional, and spanned by
``````

#### 1

. Normalize to makeu 1 =

``````1

3
``````

#### .

``````Repeat for the 0-eigenspace:
``````
``````h
``````
``````A 0  0
``````
``````i
``````
``````=
``````

#### 5 1 3 0

``````R 1 R 2

``````

#### 5 1 3 0

``````R 2 =R 2 +3R 1

``````

R 3 =R 3 5 R 1

#### 0 4 8 0

``````R 3 =R 3 +R 2

``````

#### 0 0 0 0

``````R 2 =
``````
``````1
4
``````
``````R 2

``````

#### 0 0 0 0

``````R 1 =R 1 R 2

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````

``````
``````x 1  x 3 = 0
``````
``````x 2 + 2x 3 = 0
``````
``````x 3 = free
``````
``````x 1 =x 3
``````
``````x 2 = 2 x 3
``````
``````x 3 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````

#### =

``````x 3
``````
`````` 2 x 3
``````
``````x 3
``````
``````=x 3
``````

#### 1

``````, x 3 free.
``````
``````The 0-eigenspace is one-dimensional, and spanned by
``````

#### 1

. Normalize to makeu 2 =

``````1

6
``````

#### .

``````Repeat for the8-eigenspace:
``````
``````h
``````
``````A+ 8 0
``````
``````i
``````
``````=
``````

#### 5 1 5 0

``````R 3 =R 3 R 1

``````

#### 0 0 0 0

``````R 1 R 2

``````

#### 0 0 0 0

``````R 2 =R 2  5 R 1

``````

#### 0 0 0 0

``````R 2 =
``````
``````1
44
``````
``````R 2

``````

#### 0 0 0 0

``````R 1 =R 1  9 R 2

``````

#### .

``````Reinterpret as equations, and solve for basic variables in terms of free variables:
``````
``````

``````
``````x 1 +x 3 = 0
``````
``````x 2 = 0
``````
``````x 3 = free
``````
``````x 1 =x 3
``````
``````x 2 = 0
``````
``````x 3 = free
``````
``````Writexas a vector in parametric form, using the free variable as a parameter:
``````
``````x=
``````
``````x 1
``````
``````x 2
``````
``````x 3
``````

#### =

``````x 3
``````

#### 0

``````x 3
``````
``````=x 3
``````

#### 1

``````, x 3 free.
``````
``````The8-eigenspace is one-dimensional, and spanned by
``````

#### 1

. Normalize to makeu 3 =

``````1

2
``````

#### .

``````Finally, put all the orthonormal bases for the different eigenspaces together to make an orthogonal
``````
``````matrix:
``````

#### P=

``````h
``````
``````u 1 u 2 u 3
``````
``````i
``````
``````=
``````
``````1

3
``````
``````1

6
``````
``````1

2
1

3
``````
``````2

6
``````

#### 0

``````^1
3
``````
``````^1
6
``````
``````^1
2
``````

#### .

``````The diagonal matrix has the corresponding eigenvalues in the corresponding places:
``````

#### D=

`````` 1 0 0
``````
``````0  2 0
``````
``````0 0  3
``````

#### .

• Topic 9:Consider the quadratic formQ(x) = 4x
``````2
1 ^4 x^1 x^2 + 7x
``````
``````2
2.
``````
``````1) Find a unit vectorxthat maximizes the value ofQ(x) subject to the constraintx= 1.
``````
``````2) ClassifyQas positive definite, positive semidefinite, negative definite, negative semidefinite, or
``````
``````indefinite.
``````

#### SOLUTION:

``````Find the matrix of the quadratic form. We haveQ(x) =x

Axfor
``````

#### .

``````Find the eigenvalues ofA:
``````

0 = det(AI) =

``````4   2
``````
`````` 2 7
``````
``````= (4)(7)(2)(2) =
``````
``````2
11 + 24 = (8)(3).
``````
``````The eigenvalues (in order from greatest to least) are 1 = 8 and 2 = 3. The top eigenvalue gives the
``````
``````maximum value ofQ(x) subject to the constraintx= 1. Furthermore, the maximum is achieved
``````
``````at a corresponding eigenvector. Find a unit vectorxthat satisfiesAx= 8x, i.e., (A 8 I)x= 0:
``````
``````h
``````
``````A 8  0
``````
``````i
``````
``````=
``````

#### 2 1 0

``````R 1 R 2

``````

#### 4 2 0

``````R 2 =R 2  2 R 1

``````

#### 0 0 0

``````R 1 =
``````
``````1
2
R 1

``````

#### 1

``````1
2
``````

#### .

``````This saysx 1 +
``````
``````1
2
x 2 = 0, orx 1 =
``````
``````1
2
x 2. That is,
``````
``````x=
``````

#### "

``````x 1
``````
``````x 2
``````

#### "

``````1
2
``````
``````x 2
``````
``````x 2
``````

#### =

``````1
2
``````
``````x 2
``````

#### .

``````One eigenvector is
``````

#### 2

. Normalize to make it

``````x=
^1
5
``````

#### .

``````This is our answer. (You can check thatQ(x) = 8.)
``````
``````2) SinceAhas only positive eigenvalues,Qis positive definite. (It is also positive semidefinite.)
``````

Version: April 30, 2022