University Linear Algebra — Projections, Least Squares and Symmetric Matrices Worksheet
The last set of the course, where orthogonality starts doing work. Projecting a vector onto a subspace, and the closest-point property that makes the projection useful; the same projection on polynomials, where it finds the best straight-line approximation to a cubic; Gram-Schmidt, which builds the orthogonal bases the projection formula needs; least squares, for the system that has no solution; fitting a line to measured data; orthogonal matrices, whose inverse is their transpose; and the payoff of the whole course, a symmetric matrix diagonalized by an orthogonal one. Have a look on this page, then print the free PDF when you want to write on it.
Practice worksheet — free PDF
No email, no account, no watermark. Teachers: photocopy it for your classes freely. Worked solutions and 8 harder problems come with the University Linear Algebra bundle.
All 11 questions
Each question targets one named concept from the sheet. Read them here, or print the PDF — it has working space under each one.
-
Q1Orthogonal Projection onto a Subspace
In with the dot product, let , where
- Check that is an orthogonal set.
- Find .
- Write with and , and verify that is orthogonal to .
- Find the distance from to .
-
Q2Orthogonal Projection onto a Subspace
On , the polynomials of degree at most , use the inner product Let and .
- Show that and are orthogonal for this inner product.
- Find , the polynomial of degree at most closest to for this inner product.
- Verify that is orthogonal to both and .
-
Q3The Gram-Schmidt Process
In with the dot product, let
- Apply the Gram-Schmidt process to , in that order, to obtain an orthogonal basis of .
- Normalize it to an orthonormal basis of .
-
Q4The Gram-Schmidt Process
On , the polynomials of degree at most , use the inner product
- Apply the Gram-Schmidt process to the basis , in that order.
- Normalize the result to an orthonormal basis of for this inner product.
-
Q5Least Squares Solutions and the Normal Equations
Let
- Show that has no solution.
- Write the normal equations and solve them for the least-squares solution .
- Find the least-squares error .
-
Q6Least Squares Solutions and the Normal Equations
Let A vector is a least-squares solution of exactly when . Use this test to decide which of and is a least-squares solution, then compare and .
-
Q7Fitting a Line or Curve by Least Squares
The depth of water in a test channel, in centimetres, is recorded hours after a gate is opened:
- Write the system that a line through all four points would have to satisfy.
- Solve the normal equations for the least-squares line.
- Find the sum of the squared residuals.
-
Q8Orthogonal Matrices
A square matrix is orthogonal when . Decide which of the following matrices are orthogonal, and give the inverse of each one that is.
-
Q9Orthogonal Diagonalization of a Symmetric Matrix
Orthogonally diagonalize find an orthogonal matrix and a diagonal matrix with .
-
Q10Orthogonal Diagonalization of a Symmetric Matrix
The symmetric matrix has eigenvalues and only. Find a basis of each eigenspace, and then an orthogonal matrix and a diagonal matrix with .
-
Q11Synthesis — drawing on several topics in this unit
A technician codes four equally spaced times as and reads a voltage , in millivolts, at each: . The least-squares line is wanted.
- Write the design matrix and show that its two columns are orthogonal.
- Use orthogonal projection onto to find the fitted values , and read off and .
- Confirm the line with the normal equations, and find the sum of the squared residuals.
The 8 challenge problems for this topic are a separate, paid sheet and are not reproduced here.
What does this set assume? This set stands on CEGEP Linear Algebra — matrix products, inverses and the transpose — and on the sets before it, most directly Inner Products and Orthogonality (orthogonal sets, coordinates relative to an orthogonal basis, the orthogonal complement) and Eigenvalues and Diagonalization. The integral of a polynomial is used for one inner product and needs only the power rule. Scope is orthogonal projection onto a subspace, the Gram-Schmidt process, least-squares solutions and the normal equations, fitting a line or a curve to data, orthogonal matrices, and orthogonal diagonalization of a symmetric matrix. The fitting questions stop at the fitted coefficients and the sum of squared residuals: correlation, standard errors and inference belong to a statistics course. Quadratic forms, the singular value decomposition, QR factorisation and Hermitian or unitary matrices are not part of this course, and scalars are real throughout.
Which course is this for? In the public course calendars of Montreal universities, this material is part of the courses numbered MATH 223, MATH 252, MAST 235, MAT1250 and MAT1260. Each course orders and weights the topics its own way, so check your own outline for what your exam covers. Which sets match your course.
The rest of this unit
The worksheet is the practice, and it is free. Two more printable documents cover the same unit and come with the University Linear Algebra bundle: read the notes first, work this sheet, then sit the test closed-book. See what each one covers.
What the Projections, Least Squares and Symmetric Matrices notes cover About the Projections, Least Squares and Symmetric Matrices unit test
How to do every concept on this sheet
This is the part worksheet sites usually leave out. Below is the actual reasoning behind each group of questions — not a full solution set, the decisions that get you to one. Read it before you start, or after you get stuck.
Orthogonal projection onto a subspace
Given an orthogonal basis of a subspace W, the projection of y onto W is the sum of its projections onto each basis vector — the same ratios of inner products as the coordinates in the previous set.
projW y = (y · u₁ / u₁ · u₁) u₁ + (y · u₂ / u₂ · u₂) u₂ (u₁, u₂ orthogonal)Q1 walks through the whole idea in four-space. Part (a) checks the hypothesis — the formula above is only valid for an orthogonal basis. Part (b) applies it. Part (c) splits y into the piece in W and the piece orthogonal to W, and asks you to verify the second piece really is orthogonal: take its dot product with each spanning vector. Part (d) uses the reason projections matter.
The projection is the closest point. Of all vectors in W, the projection is the one nearest to y, and the distance from y to W is the length of the orthogonal piece z. Part (d) is therefore a norm you have almost finished computing in part (c).
The formula needs an orthogonal basis. Applied to a basis that is not orthogonal, the sum of individual projections is not the projection onto W, and nothing in the arithmetic warns you. Check orthogonality first, and if it fails, orthogonalise — which is what Gram-Schmidt is for.
Q2 is the same formula on cubic polynomials, with the integral inner product. The subspace is the polynomials of degree at most 1, and the projection is the best approximation to the cubic among straight lines, in the sense that inner product measures. Part (a) checks that 1 and x are orthogonal; symmetry of the interval makes that, and much of part (b), short. Part (c) is the check from Q1(c).
The Gram-Schmidt process
Gram-Schmidt turns any basis into an orthogonal one spanning the same space, one vector at a time: keep the first, and from each later vector subtract its projection onto the span of the ones already built.
Gram-Schmidt on x₁, x₂, x₃
Each new vector minus its shadow on the ones before it.
- 1v₁ = x₁
Nothing to subtract yet.
- 2v₂ = x₂ − (x₂ · v₁ / v₁ · v₁) v₁
Check v₂ · v₁ = 0 before going on.
- 3v₃ = x₃ − (projection onto v₁) − (projection onto v₂)
Use the v's you built, never the original x's, in the projections.
- 4Normalise last
Divide each vᵢ by its norm only at the end.
Scale freely along the way. Multiplying a vᵢ by a non-zero constant does not change orthogonality or the span. Clearing fractions before the next step keeps the arithmetic manageable, and it does not affect the orthonormal basis you end with.
Q3 applies the process in four-space; Q4 applies it to 1, x, x² with an inner product built from values at three points. The steps are identical — only the inner product changes. Every inner product in Q4 is a sum of three products, so write down the values of each polynomial at 0, 1 and 2 once and reuse them.
Least squares and the normal equations
When Ax = b has no solution, the best you can do is make Ax as close to b as possible. The closest vector of the column space to b is its projection, and the x that produces it satisfies the normal equations.
AᵀA x̂ = Aᵀb ⇔ b − Ax̂ is orthogonal to every column of AQ5 goes through the full procedure. Part (a) shows the system is inconsistent — reduce the augmented matrix and point to the offending row. Part (b) forms the 2 × 2 matrix AᵀA and the vector Aᵀb, and solves. Part (c) measures how far off the best answer still is: compute the residual vector b − Ax̂ and its length.
The least-squares error is a length, not a square. The question asks for the norm of the residual — take the square root at the end. The sum of squared residuals, asked for in the fitting questions, is that norm squared.
Q6 gives the test in its orthogonality form and two candidates. For each, compute the residual b − Ax and multiply by Aᵀ; the least-squares solution is the one for which the product is the zero vector. Comparing the two residual lengths afterwards shows the closest-point property in numbers.
Fitting a line to data
Q7 records four measurements and asks for the least-squares line. A line through all four points would have to satisfy four equations in two unknowns — the intercept and the slope. Each row of the design matrix X is a 1 followed by an x-value; the right-hand side is the list of y-values.
It is Q5 with a story. Once X and y are written down, part (b) is exactly the normal equations, and part (c) is the squared length of the residual vector: the sum of the squared vertical distances from the points to the line.
Orthogonal matrices
A square matrix is orthogonal when its transpose times itself is the identity — equivalently, when its columns form an orthonormal set. Then its inverse is its transpose, with no computation. Q8 gives four matrices to classify.
Check the definition in order. First, is the matrix square? The definition applies only to square matrices. Then are the columns pairwise orthogonal? Then does each column have length exactly 1 — watch for columns that are orthogonal but have the wrong length, and for the scalar factor in front of some of the matrices, which multiplies every length. For each one that passes, the inverse is the transpose.
Orthogonal diagonalization of a symmetric matrix
A real symmetric matrix can always be diagonalized by an orthogonal matrix — this is the spectral theorem, and it is where the course ends. Its eigenvalues are real, and eigenvectors for different eigenvalues are automatically orthogonal.
A = Aᵀ ⇒ A = P D Pᵀ with P orthogonalQ9 is a 3 × 3 symmetric matrix. Find the eigenvalues and an eigenvector for each, check that the eigenvectors are orthogonal, normalise them, and use them as the columns of P. Because P is orthogonal, the formula uses Pᵀ, not P⁻¹.
Q10 gives a 4 × 4 symmetric matrix with only two eigenvalues, so at least one eigenspace has dimension more than one. Eigenvectors from different eigenspaces are orthogonal for free; inside one eigenspace they are not, and a basis found by row reduction usually is not orthogonal.
Run Gram-Schmidt inside each repeated eigenspace. Every vector in an eigenspace is still an eigenvector, so orthogonalising within it keeps you in the eigenspace. Never run Gram-Schmidt across two eigenspaces — the combinations would no longer be eigenvectors.
The synthesis question
Q11 fits a line to four measurements whose x-values are symmetric about zero. Part (a) writes the design matrix, as in Q7, and shows its two columns are orthogonal — the symmetric x-values are why. Part (b) uses that orthogonality: project y onto the column space with Q1's formula, and read the two coefficients straight off the projection, since the fitted values are the intercept times one column plus the slope times the other. Part (c) confirms the same line by Q5's normal equations and finds the sum of squared residuals.
Preview all 10 pages
Click any page to open the full PDF.
Getting the most out of it
Check orthogonality before you use a formula that needs it
The projection formula and the coordinate formula both assume an orthogonal basis. One line of dot products before you start saves a whole wrong answer.
Verify every projection
After projecting, compute y minus the projection and take its inner product with each spanning vector of W. Every one must be zero. The same check confirms a least-squares solution: Aᵀ times the residual is zero.
Clear fractions during Gram-Schmidt, normalise at the end
Rescaling intermediate vectors is free and keeps the numbers small. Square roots belong only in the final normalising step.
For symmetric matrices, count dimensions per eigenvalue
Before building P, note which eigenspaces have dimension more than one. Those are the only places Gram-Schmidt is needed, and forgetting it there is the usual reason P fails to be orthogonal.
Want the solutions, or something more challenging?
The worksheet, the questions above and every explanation on this page stay free permanently. Three more PDFs exist for this topic — the worked answer key, a harder problem set, and the answer key to that. They come with the University Linear Algebra Solutions Bundle, beside the unit notes and the unit test, which is what keeps the rest of the series free.
What else exists for Projections, Least Squares and Symmetric Matrices
Three PDFs · 15 pages · all three are in the bundle below.
- Answer key — 4 pages. All 11 questions worked step by step, including the restrictions and the justifications. Not a list of final answers.
- Challenge problems — 7 pages, 8 problems. A separate sheet at exam-plus difficulty covering the same 6 concepts. Harder than anything on the free sheet.
- Challenge answer key — 4 pages. Every challenge problem worked to the same standard, with the checks shown.
- PDF, letter size, print-ready.
The one thing that's for sale
Every University Linear Algebra topic — the complete Solutions Bundle
One download, one payment, the whole program. For all 9 University Linear Algebra units: the worksheet, the reference notes, the challenge set, the unit test and every answer key — including this one.
- Worked solutions, not answer lists — every step written out
- Covers the whole year's program at this level
- Less than the price of one hour of tutoring — for the entire year's solutions
Taking Secondary 1 Math as well? The Secondary 1 Math bundle covers all 15 of its units — 106 PDFs, 474 pages — on the same terms.
Taking Secondary 2 Math as well? The Secondary 2 Math bundle covers all 14 of its units — 98 PDFs, 449 pages — on the same terms.
Taking Secondary 3 Math as well? The Secondary 3 Math bundle covers all 11 of its units — 77 PDFs, 367 pages — on the same terms.
Taking Secondary 4 Math as well? The Secondary 4 Math bundle covers all 17 of its units — 122 PDFs, 466 pages — on the same terms.
Taking Secondary 5 Math as well? The Secondary 5 Math bundle covers all 21 of its units — 147 PDFs, 589 pages — on the same terms.
Taking CEGEP Calculus I as well? The CEGEP Calculus I bundle covers all 9 of its units — 72 PDFs, 371 pages — on the same terms.
Taking CEGEP Calculus II as well? The CEGEP Calculus II bundle covers all 8 of its units — 64 PDFs, 335 pages — on the same terms.
Taking CEGEP Linear Algebra as well? The CEGEP Linear Algebra bundle covers all 7 of its units — 56 PDFs, 298 pages — on the same terms.
Taking University Calculus III as well? The University Calculus III bundle covers all 9 of its units — 72 PDFs, 516 pages — on the same terms.
Taking University Differential Equations as well? The University Differential Equations bundle covers all 9 of its units — 36 PDFs, 182 pages — on the same terms.
Taking University Business Math as well? The University Business Math bundle covers all 9 of its units — 36 PDFs, 190 pages — on the same terms.
Taking University Introductory Statistics as well? The University Introductory Statistics bundle covers all 9 of its units — 36 PDFs, 186 pages — on the same terms.
Taking University Discrete Math as well? The University Discrete Math bundle covers all 9 of its units — 36 PDFs, 155 pages — on the same terms.
Taking AP Calculus AB as well? The AP Calculus AB bundle covers all 8 of its units — 64 PDFs, 527 pages — on the same terms.
Common questions
Is this worksheet really free?
Yes — the questions are on this page to read, and the PDF downloads directly, no email and no account. The one paid item is optional: the complete University Linear Algebra Solutions Bundle, which covers every set at this level.
Which university courses is this for?
The course codes listed on this page are taken from the public course calendars of universities that teach linear algebra after CEGEP. Each course orders and weights the topics its own way — some place Gram-Schmidt and least squares in the middle of the term, others at the end or in a second course — so check the outline for your own section to see where this set falls in your term.
What do I need to know before starting this set?
Inner Products and Orthogonality and Eigenvalues and Diagonalization from this course, plus the transpose and matrix inverses from CEGEP Linear Algebra.
Why does least squares use AᵀA?
Because the best approximate solution makes the residual b − Ax orthogonal to the column space of A, and orthogonal to every column means Aᵀ times the residual is zero. Rearranged, that is the normal equations.
Is the least-squares solution always unique?
It is unique exactly when the columns of A are linearly independent, which is when AᵀA is invertible. The projection of b onto the column space is always unique, even when several x produce it.
Why can every symmetric matrix be diagonalized?
That is the spectral theorem. For a real symmetric matrix the eigenvalues are real, each eigenspace has full dimension, and eigenvectors from different eigenspaces are orthogonal — so an orthonormal basis of eigenvectors always exists.
Are quadratic forms and the SVD in this set?
No. This course ends on orthogonal diagonalization itself. Quadratic forms and the singular value decomposition are taught in a second linear algebra course by the universities that cover them.
Can teachers use this in class?
Yes. Print and photocopy it for your own classes freely — I just ask that the tutorinmontreal.ca footer stays on the page.
I'm stuck on one question. Can you help?
Yes — through one-on-one tutoring, in Montreal or online. Get in touch to arrange a session, or see the current rates.
← All 9 University Linear Algebra worksheets · Secondary 1 Math series (15 sheets) → · Secondary 2 Math series (14 sheets) → · Secondary 3 Math series (11 sheets) → · Secondary 4 Math series (17 sheets) → · Secondary 5 Math series (21 sheets) → · CEGEP Calculus I series (9 sheets) → · CEGEP Calculus II series (8 sheets) → · CEGEP Linear Algebra series (7 sheets) → · University Calculus III series (9 sheets) → · University Differential Equations series (9 sheets) → · University Business Math series (9 sheets) → · University Introductory Statistics series (9 sheets) → · University Discrete Math series (9 sheets) → · AP Calculus AB series (8 sheets) →




