Linear Algebra Quiz: Least Squares Solutions
18 questions · exam conditions
0:00
Least Squares SolutionsQuestion 1 of 18

Let x^\hat{x} be the least squares solution to an inconsistent system Ax=bAx = b. Which statement best describes the geometric relationship between the vector p=Ax^p = A\hat{x} and the vector bb?

The vector pp is orthogonal to the vector bb.
The vector pp is the orthogonal projection of bb onto the row space of AA.
The vector pp is the orthogonal projection of bb onto the column space of AA.
The vector pp is equal to bb because x^\hat{x} minimizes the error.
← Back to quizzes

Linear Algebra Quiz

Linear Algebra Quiz: Least Squares Solutions

Practice Least Squares Solutions in Linear Algebra with focused quiz questions that help you check what you know, review explanations, and build confidence with test-style prompts.

What this quiz covers

This quiz focuses on Least Squares Solutions, giving you a quick way to practice the rules, question types, and explanations that matter most for Linear Algebra.

How to use this quiz

Try each quiz question before looking at the correct answer. Use the explanations to review missed ideas, then come back to similar questions until the pattern feels familiar.

All questions

Question 1

Let x^\hat{x} be the least squares solution to an inconsistent system Ax=bAx = b. Which statement best describes the geometric relationship between the vector p=Ax^p = A\hat{x} and the vector bb?

  1. The vector pp is orthogonal to the vector bb.
  2. The vector pp is the orthogonal projection of bb onto the row space of AA.
  3. The vector pp is the orthogonal projection of bb onto the column space of AA. (correct answer)
  4. The vector pp is equal to bb because x^\hat{x} minimizes the error.
Explanation: When you encounter least squares problems, you're dealing with inconsistent systems where no exact solution exists, so we find the "best" approximate solution by minimizing the error. The key insight is understanding what p=Ax^p = A\hat{x} represents geometrically. Since x^\hat{x} is the least squares solution, it minimizes Ax^b2||A\hat{x} - b||^2. This minimization occurs when the error vector bAx^b - A\hat{x} is orthogonal to the column space of AA. In other words, bpb - p is perpendicular to every column of AA. This geometric condition means that p=Ax^p = A\hat{x} is the point in the column space of AA that lies closest to bb. By definition, this makes pp the orthogonal projection of bb onto the column space of AA. Option A is incorrect because pp and bb are generally not orthogonal to each other - rather, the error vector bpb - p is orthogonal to the column space. Option B confuses column space with row space; the projection occurs onto the column space (the span of AA's columns), not the row space. Option D misunderstands the fundamental nature of inconsistent systems - even though x^\hat{x} minimizes error, pp cannot equal bb because bb lies outside the column space of AA. Remember this pattern: in least squares problems, Ax^A\hat{x} always represents the orthogonal projection of bb onto the column space of AA. The column space connection is crucial since Ax^A\hat{x} must be a linear combination of AA's columns.

Question 2

Let x^\hat{x} be the least squares solution to Ax=bAx = b, and let the residual vector be r=bAx^r = b - A\hat{x}. Which of the following statements about rr is necessarily true?

  1. The norm of rr is equal to the norm of bb.
  2. The vector rr is parallel to the vector bb.
  3. The vector rr lies in the row space of AA.
  4. The vector rr is orthogonal to the column space of AA. (correct answer)
Explanation: When you encounter least squares problems, focus on the fundamental geometric relationship: the residual vector must be orthogonal to the space you're projecting onto. The least squares solution x^\hat{x} minimizes bAx2||b - Ax||^2, which geometrically means we're finding the point Ax^A\hat{x} in the column space of AA that's closest to bb. This creates a projection of bb onto the column space. The residual r=bAx^r = b - A\hat{x} represents the "leftover" part of bb that couldn't be expressed as a linear combination of AA's columns. By the fundamental theorem of projections, this residual must be orthogonal to everything in the column space of AA. This orthogonality condition is what makes the projection unique and optimal. Therefore, answer D is correct. Now for the incorrect options: A claims r=b||r|| = ||b||, which only occurs when bb is completely orthogonal to the column space—a special case, not generally true. B suggests rr is parallel to bb, which again only happens in that same special orthogonal case. C states rr lies in the row space of AA, but the row space and column space are generally different subspaces, and there's no reason for the residual to align with the row space. Study tip: Remember that least squares is fundamentally about orthogonal projection. The residual is always orthogonal to the space you're projecting onto (the column space). This orthogonality principle appears throughout linear algebra, so master it early.

Question 3

Let AA be an m×nm \times n matrix with m>nm > n. Which of the following statements about the Gram matrix G=ATAG = A^T A is false?

  1. GG is always a symmetric matrix.
  2. GG is always a square matrix.
  3. GG is always invertible. (correct answer)
  4. The eigenvalues of GG are always non-negative.
Explanation: The statement that G=ATAG = A^T A is always invertible is false. The matrix GG is invertible if and only if the columns of AA are linearly independent. If the columns of AA are linearly dependent, then ATAA^T A will be singular (not invertible). (A) is true because (ATA)T=AT(AT)T=ATA(A^T A)^T = A^T (A^T)^T = A^T A. (B) is true because if AA is m×nm \times n, then ATA^T is n×mn \times m, and their product ATAA^T A is an n×nn \times n square matrix. (D) is true because for any vector vv, vTGv=vTATAv=(Av)T(Av)=Av20v^T G v = v^T A^T A v = (Av)^T(Av) = ||Av||^2 \ge 0, which means GG is positive semidefinite, and a property of positive semidefinite matrices is that all their eigenvalues are non-negative.

Question 4

For a system Ax=bAx = b where AA has linearly independent columns, the projection of bb onto the column space of AA is given by p=Pbp = Pb for some projection matrix PP. Which of the following correctly defines PP?

  1. P=(ATA)1ATP = (A^T A)^{-1} A^T
  2. P=A(ATA)1ATP = A(A^T A)^{-1} A^T (correct answer)
  3. P=AATP = A A^T
  4. P=ATAP = A^T A
Explanation: When you encounter projection problems in linear algebra, you're dealing with finding the closest point in a subspace to a given vector. Here, we need the projection matrix that maps any vector bb to its projection onto the column space of AA. The correct projection matrix is P=A(ATA)1ATP = A(A^T A)^{-1} A^T. Here's why: when we project bb onto the column space of AA, we're finding the vector pp in that subspace closest to bb. This means p=Ax^p = A\hat{x} for some coefficient vector x^\hat{x}, and the error (bp)(b - p) must be perpendicular to the column space. This orthogonality condition gives us AT(bAx^)=0A^T(b - A\hat{x}) = 0, which leads to x^=(ATA)1ATb\hat{x} = (A^T A)^{-1} A^T b. Therefore, p=Ax^=A(ATA)1ATbp = A\hat{x} = A(A^T A)^{-1} A^T b, confirming that P=A(ATA)1ATP = A(A^T A)^{-1} A^T. Option A gives you (ATA)1AT(A^T A)^{-1} A^T, which is just the coefficient vector x^\hat{x}, not the projection itself. Option C, AATA A^T, only works when AA is square, and even then it's not generally a projection matrix. Option D, ATAA^T A, transforms vectors in the domain space rather than projecting onto the column space. Remember this key pattern: projection matrices always have the form A(ATA)1ATA(A^T A)^{-1} A^T when AA has linearly independent columns. The middle term (ATA)1AT(A^T A)^{-1} A^T finds coefficients, while the outer AA converts back to the projected vector.

Question 5

Let the least squares problem for Ax=bAx = b have a solution x^\hat{x}. If the null space of AA, Nul(A)\text{Nul}(A), contains non-zero vectors, what can be concluded about the set of all least squares solutions?

  1. The problem has no least squares solution.
  2. The problem has infinitely many least squares solutions. (correct answer)
  3. The problem has a unique least squares solution.
  4. The only least squares solution is the zero vector.
Explanation: When you encounter least squares problems involving the null space of matrix AA, you're dealing with questions about solution uniqueness. The key insight is understanding how the null space affects the solution set structure. The least squares solution x^\hat{x} satisfies the normal equation ATAx^=ATbA^T A \hat{x} = A^T b. If Nul(A)\text{Nul}(A) contains non-zero vectors, then AA doesn't have full column rank. This means ATAA^T A is also not invertible, since Nul(ATA)=Nul(A)\text{Nul}(A^T A) = \text{Nul}(A). Here's the crucial point: if x^\hat{x} is one least squares solution and vv is any vector in Nul(A)\text{Nul}(A), then x^+v\hat{x} + v is also a least squares solution. This is because A(x^+v)=Ax^+Av=Ax^+0=Ax^A(\hat{x} + v) = A\hat{x} + Av = A\hat{x} + 0 = A\hat{x}, so the residual A(x^+v)b||A(\hat{x} + v) - b|| remains the same. Since Nul(A)\text{Nul}(A) contains infinitely many vectors (it's a subspace), there are infinitely many solutions. Option A is wrong because the problem states a solution x^\hat{x} exists. Option C contradicts our analysis—uniqueness requires Nul(A)={0}\text{Nul}(A) = \{0\}. Option D is incorrect because the zero vector is rarely the least squares solution unless bb is in the column space of AA and passes through the origin. Study tip: Remember that in least squares problems, solution uniqueness depends entirely on whether AA has full column rank. If Nul(A){0}\text{Nul}(A) \neq \{0\}, expect infinitely many solutions forming an affine subspace.

Question 6

Which equation represents the least-squares line y=c0+c1xy = c_0 + c_1 x that best fits the data points (1,0)(-1, 0), (0,1)(0, 1), and (1,3)(1, 3)?

  1. y=1+32xy = 1 + \frac{3}{2}x
  2. y=32+43xy = \frac{3}{2} + \frac{4}{3}x
  3. y=43+2xy = \frac{4}{3} + 2x
  4. y=43+32xy = \frac{4}{3} + \frac{3}{2}x (correct answer)
Explanation: When you encounter a least-squares problem, you're finding the line that minimizes the sum of squared vertical distances between data points and the line. This requires setting up and solving a system of normal equations. To find the least-squares line y=c0+c1xy = c_0 + c_1x for points (1,0)(-1, 0), (0,1)(0, 1), and (1,3)(1, 3), you need to solve the system Ac=bA\mathbf{c} = \mathbf{b} where A=(111011)A = \begin{pmatrix} 1 & -1 \\ 1 & 0 \\ 1 & 1 \end{pmatrix} and $$\mathbf{b} = \begin{pmatrix} 0 \ 1 \ 3 \end{pmatrix} The normal equations are $$A^T A \mathbf{c} = A^T \mathbf{b}$$. Computing: $$A^T A = \begin{pmatrix} 3 & 0 \\ 0 & 2 \end{pmatrix} $$ and $$A^T \mathbf{b} = \begin{pmatrix} 4 \\ 3 \end{pmatrix} $$. This gives us $$3c_0 = 4$$ and $$2c_1 = 3$$, so $$c_0 = \frac{4}{3}$$ and $$c_1 = \frac{3}{2}$$. Therefore, the least-squares line is $$y = \frac{4}{3} + \frac{3}{2}x$$. Choice A gives $$c_0 = 1$$ and $$c_1 = \frac{3}{2}$$, which has the wrong y-intercept. Choice B has $$c_0 = \frac{3}{2}$$ and $$c_1 = \frac{4}{3}$$, swapping our correct coefficients. Choice C uses $$c_1 = 2$$, which is the wrong slope. The correct answer is D. **Study tip:** For least-squares problems, always set up the matrix equation systematically and use the normal equations formula. Double-check by verifying that your line passes reasonably through the data points' general trend.

Question 7

For an overdetermined system Ax=bA\mathbf{x} = \mathbf{b} where AA is m×nm \times n with m>nm > n, the residual vector for the least squares solution x\mathbf{x}^* is r=bAx\mathbf{r} = \mathbf{b} - A\mathbf{x}^*. Which of the following statements about r\mathbf{r} is necessarily true?

  1. r\mathbf{r} is orthogonal to every vector in the column space of AA and has minimum possible length among all residual vectors (correct answer)
  2. r\mathbf{r} is orthogonal to every vector in the null space of AA and has minimum possible length among all residual vectors
  3. r\mathbf{r} is orthogonal to every vector in the row space of AA and lies in the null space of ATA^T
  4. r\mathbf{r} is orthogonal to every vector in the column space of AA and lies in the left null space of AA
Explanation: The least squares solution minimizes bAx2\|\mathbf{b} - A\mathbf{x}\|^2. The residual r=bAx\mathbf{r} = \mathbf{b} - A\mathbf{x}^* is orthogonal to the column space of AA (this is the geometric interpretation of the normal equation AT(bAx)=0A^T(\mathbf{b} - A\mathbf{x}^*) = \mathbf{0}), and by definition has minimum length among all possible residuals. Choice B incorrectly refers to the null space instead of column space. Choice C confuses row space with column space. Choice D correctly identifies orthogonality to the column space but incorrectly claims the residual lies in the left null space, which would only be true if r=0\mathbf{r} = \mathbf{0}.

Question 8

A data analyst fits a linear model y=α+βty = \alpha + \beta t to the points (1,2)(1,2), (2,3)(2,3), (3,7)(3,7), and (4,6)(4,6) using least squares. If the resulting residuals are r1,r2,r3,r4r_1, r_2, r_3, r_4 respectively, which relationship must hold?

  1. r1+r2+r3+r4|r_1| + |r_2| + |r_3| + |r_4| is minimized and max{r1,r2,r3,r4}\max\{|r_1|, |r_2|, |r_3|, |r_4|\} is minimized
  2. r1+r2+r3+r4=0r_1 + r_2 + r_3 + r_4 = 0 and r12+r22+r32+r42r_1^2 + r_2^2 + r_3^2 + r_4^2 is minimized
  3. r12+r22+r32+r42=0r_1^2 + r_2^2 + r_3^2 + r_4^2 = 0 and each ri0r_i \geq 0
  4. r1+r2+r3+r4=0r_1 + r_2 + r_3 + r_4 = 0 and r1+2r2+3r3+4r4=0r_1 + 2r_2 + 3r_3 + 4r_4 = 0 (correct answer)
Explanation: When you encounter least squares linear regression problems, focus on the fundamental properties that arise from the normal equations used to find the optimal parameters. In least squares regression with a model y=α+βty = \alpha + \beta t, the parameters α\alpha and β\beta are chosen to minimize i=14ri2\sum_{i=1}^4 r_i^2, where ri=yi(α+βti)r_i = y_i - (\alpha + \beta t_i) are the residuals. This optimization leads to two crucial normal equations that the residuals must satisfy. The correct answer is D because least squares regression always produces residuals with two key properties. First, ri=0\sum r_i = 0 (the residuals sum to zero), and second, tiri=0\sum t_i r_i = 0 (the residuals are orthogonal to the predictor variable). With our tt-values of 1, 2, 3, 4, this second condition becomes r1+2r2+3r3+4r4=0r_1 + 2r_2 + 3r_3 + 4r_4 = 0. These are fundamental mathematical requirements of least squares, not just optimization goals. Option A is incorrect because least squares minimizes the sum of squared residuals, not the sum of absolute values or the maximum absolute value. Option B is only partially correct—while the sum of residuals equals zero and the sum of squared residuals is minimized, it's missing the crucial orthogonality condition. Option C is wrong because perfect fit (all residuals equal to zero) is extremely rare with real data and not a requirement of least squares. Remember: In least squares regression, always check for both orthogonality conditions—residuals must be orthogonal to the constant term (sum to zero) and to each predictor variable.

Question 9

For the overdetermined system Ax=bA\mathbf{x} = \mathbf{b} where AA is 4×24 \times 2 with rank 2, suppose the least squares solution is x=(31)\mathbf{x}^* = \begin{pmatrix} 3 \\ -1 \end{pmatrix} and the residual vector has length 6\sqrt{6}. If we modify the system by replacing b\mathbf{b} with b+v\mathbf{b} + \mathbf{v} where v\mathbf{v} is in the column space of AA, what happens to the least squares solution?

  1. The solution becomes x+(ATA)1ATv\mathbf{x}^* + (A^T A)^{-1}A^T \mathbf{v} and the residual length changes to 6+v\sqrt{6} + \|\mathbf{v}\|
  2. The solution remains (31)\begin{pmatrix} 3 \\ -1 \end{pmatrix} but the residual length changes to 6+v\sqrt{6} + \|\mathbf{v}\|
  3. The solution becomes x+(ATA)1ATv\mathbf{x}^* + (A^T A)^{-1}A^T \mathbf{v} and the residual length remains 6\sqrt{6} (correct answer)
  4. The solution remains (31)\begin{pmatrix} 3 \\ -1 \end{pmatrix} and the residual length remains 6\sqrt{6}
Explanation: When you encounter least squares problems with modifications to the right-hand side vector, focus on how changes affect the geometry of the solution space. The key insight is understanding what happens when you add a vector from the column space of AA to b\mathbf{b}. The new system becomes Ax=b+vA\mathbf{x} = \mathbf{b} + \mathbf{v} where vCol(A)\mathbf{v} \in \text{Col}(A). Since v\mathbf{v} is in the column space, there exists some vector w\mathbf{w} such that v=Aw\mathbf{v} = A\mathbf{w}. The new least squares solution satisfies ATAxnew=AT(b+v)A^TA\mathbf{x}_{new} = A^T(\mathbf{b} + \mathbf{v}). Since ATAx=ATbA^TA\mathbf{x}^* = A^T\mathbf{b} for the original solution, we get xnew=x+(ATA)1ATv\mathbf{x}_{new} = \mathbf{x}^* + (A^TA)^{-1}A^T\mathbf{v}. For the residual, the original residual r=bAx\mathbf{r} = \mathbf{b} - A\mathbf{x}^* is orthogonal to the column space. The new residual is (b+v)Axnew=bAx=r(\mathbf{b} + \mathbf{v}) - A\mathbf{x}_{new} = \mathbf{b} - A\mathbf{x}^* = \mathbf{r}, so its length remains 6\sqrt{6}. Option A incorrectly adds v\|\mathbf{v}\| to the residual length, missing that v\mathbf{v} doesn't affect the orthogonal component. Option B keeps the wrong solution while also incorrectly changing the residual. Option D fails to account for how adding a vector in the column space shifts the solution. Remember: adding vectors in the column space of AA changes the least squares solution predictably via (ATA)1AT(A^TA)^{-1}A^T, but the residual length stays constant because residuals are orthogonal to the column space.

Question 10

Consider two overdetermined systems: System 1 has matrix A1A_1 and right-hand side b1\mathbf{b}_1, while System 2 has matrix A2=QA1A_2 = QA_1 and right-hand side b2=Qb1\mathbf{b}_2 = Q\mathbf{b}_1, where QQ is an orthogonal matrix. If x1\mathbf{x}_1^* and x2\mathbf{x}_2^* are the respective least squares solutions, which relationship holds?

  1. x2=QTx1\mathbf{x}_2^* = Q^T\mathbf{x}_1^* and the residual norms satisfy b2A2x2=b1A1x1\|\mathbf{b}_2 - A_2\mathbf{x}_2^*\| = \|\mathbf{b}_1 - A_1\mathbf{x}_1^*\|
  2. x2=Qx1\mathbf{x}_2^* = Q\mathbf{x}_1^* and the residual norms satisfy b2A2x2=Qb1A1x1\|\mathbf{b}_2 - A_2\mathbf{x}_2^*\| = \|Q\|\|\mathbf{b}_1 - A_1\mathbf{x}_1^*\|
  3. x2=x1\mathbf{x}_2^* = \mathbf{x}_1^* and the residual norms satisfy b2A2x2=b1A1x1\|\mathbf{b}_2 - A_2\mathbf{x}_2^*\| = \|\mathbf{b}_1 - A_1\mathbf{x}_1^*\| (correct answer)
  4. x2=x1\mathbf{x}_2^* = \mathbf{x}_1^* and the residual norms satisfy b2A2x2=Q2b1A1x1\|\mathbf{b}_2 - A_2\mathbf{x}_2^*\| = \|Q\|^2\|\mathbf{b}_1 - A_1\mathbf{x}_1^*\|
Explanation: When you encounter problems involving orthogonal transformations of least squares systems, the key insight is that orthogonal matrices preserve geometric relationships while potentially changing coordinates. Let's work through what happens systematically. The least squares solution satisfies the normal equations: A1TA1x1=A1Tb1A_1^T A_1 \mathbf{x}_1^* = A_1^T \mathbf{b}_1 for System 1. For System 2 with A2=QA1A_2 = QA_1 and b2=Qb1\mathbf{b}_2 = Q\mathbf{b}_1, the normal equations become: A2TA2x2=A2Tb2A_2^T A_2 \mathbf{x}_2^* = A_2^T \mathbf{b}_2 (QA1)T(QA1)x2=(QA1)TQb1(QA_1)^T (QA_1) \mathbf{x}_2^* = (QA_1)^T Q\mathbf{b}_1 A1TQTQA1x2=A1TQTQb1A_1^T Q^T Q A_1 \mathbf{x}_2^* = A_1^T Q^T Q \mathbf{b}_1 Since QQ is orthogonal, QTQ=IQ^T Q = I, so this simplifies to A1TA1x2=A1Tb1A_1^T A_1 \mathbf{x}_2^* = A_1^T \mathbf{b}_1. This is identical to System 1's normal equations, proving x2=x1\mathbf{x}_2^* = \mathbf{x}_1^*. For residual norms, since orthogonal matrices preserve lengths: b2A2x2=Qb1QA1x1=Q(b1A1x1)=b1A1x1\|\mathbf{b}_2 - A_2\mathbf{x}_2^*\| = \|Q\mathbf{b}_1 - QA_1\mathbf{x}_1^*\| = \|Q(\mathbf{b}_1 - A_1\mathbf{x}_1^*)\| = \|\mathbf{b}_1 - A_1\mathbf{x}_1^*\|. Answer A incorrectly suggests the solution changes by QTQ^T. Answer B incorrectly claims the solution transforms by QQ and misunderstands that Q=1\|Q\| = 1 for orthogonal matrices. Answer D correctly identifies equal solutions but incorrectly scales the residual norm by Q2\|Q\|^2. Remember: orthogonal transformations preserve the essential geometry of least squares problems—both the solution and the quality of fit remain unchanged.

Question 11

For the overdetermined linear system Ax=bA\mathbf{x} = \mathbf{b} where AA is m×nm \times n with m>nm > n and rank(A)=n\text{rank}(A) = n, consider the augmented matrix [Ab][A | \mathbf{b}]. If the least squares residual has norm r>0r > 0, which statement about the rank of [Ab][A | \mathbf{b}] is correct?

  1. rank([Ab])=n\text{rank}([A | \mathbf{b}]) = n because b\mathbf{b} lies in the column space of AA
  2. rank([Ab])=n+1\text{rank}([A | \mathbf{b}]) = n + 1 because b\mathbf{b} does not lie in the column space of AA (correct answer)
  3. rank([Ab])=n\text{rank}([A | \mathbf{b}]) = n regardless of whether b\mathbf{b} lies in the column space of AA
  4. rank([Ab])=m\text{rank}([A | \mathbf{b}]) = m because the augmented matrix has mm rows and the system is overdetermined
Explanation: Since the least squares residual has norm r>0r > 0, this means the system Ax=bA\mathbf{x} = \mathbf{b} has no exact solution, which occurs precisely when b\mathbf{b} is not in the column space of AA. Since AA has rank nn and bCol(A)\mathbf{b} \notin \text{Col}(A), adding b\mathbf{b} as an additional column increases the dimension of the column space by 1. Therefore, rank([Ab])=n+1\text{rank}([A | \mathbf{b}]) = n + 1. Choice A would be correct if r=0r = 0, but contradicts the given condition. Choice C is incorrect because the rank depends on whether b\mathbf{b} is in the column space. Choice D confuses the number of rows with the rank; the rank cannot exceed n+1n+1 since there are only n+1n+1 columns.

Question 12

For the system Ax=bAx = b with A=(100111)A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} and b=(600)b = \begin{pmatrix} 6 \\ 0 \\ 0 \end{pmatrix}, what is the least squares error, defined as Ax^b||A\hat{x} - b||?

  1. 252\sqrt{5}
  2. 636\sqrt{3}
  3. 232\sqrt{3} (correct answer)
  4. 00
Explanation: When you encounter a least squares problem, you're dealing with an overdetermined system (more equations than unknowns) that likely has no exact solution. The goal is to find the best approximate solution x^\hat{x} that minimizes the error Ax^b||A\hat{x} - b||. To solve this, you need the normal equation: ATAx^=ATbA^T A \hat{x} = A^T b. First, calculate ATAA^T A: Then $$A^T b = \begin{pmatrix} 1 & 0 & 1 \ 0 & 1 & 1 \end{pmatrix} \begin{pmatrix} 6 \ 0 \ 0 \end{pmatrix} = \begin{pmatrix} 6 \ 0 \end{pmatrix} Solving $$(A^T A)\hat{x} = A^T b$$: $$ \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \hat{x} = \begin{pmatrix} 6 \\ 0 \end{pmatrix} This gives $$\hat{x} = \begin{pmatrix} 4 \ -2 \end{pmatrix} Now calculate the error: $$A\hat{x} - b = \begin{pmatrix} 4 \\ -2 \\ 2 \end{pmatrix} - \begin{pmatrix} 6 \\ 0 \\ 0 \end{pmatrix} = \begin{pmatrix} -2 \\ -2 \\ 2 \end{pmatrix} The least squares error is Ax^b=(2)2+(2)2+22=12=23||A\hat{x} - b|| = \sqrt{(-2)^2 + (-2)^2 + 2^2} = \sqrt{12} = 2\sqrt{3}, confirming answer C. Answer A) 252\sqrt{5} would result from incorrectly computing the norm. Answer B) 636\sqrt{3} might come from miscalculating ATAA^T A or the normal equation. Answer D) 00 assumes the system has an exact solution, which it doesn't since we have 3 equations in 2 unknowns. Always remember: for least squares problems, set up the normal equation ATAx^=ATbA^T A \hat{x} = A^T b first, then compute the residual norm.

Question 13

What is the orthogonal projection of the vector b=(251)b = \begin{pmatrix} 2 \\ 5 \\ 1 \end{pmatrix} onto the subspace spanned by the columns of the matrix A=(112111)A = \begin{pmatrix} 1 & 1 \\ 2 & -1 \\ 1 & 1 \end{pmatrix}?

  1. (13/613/313/6)\begin{pmatrix} 13/6 \\ 13/3 \\ 13/6 \end{pmatrix}
  2. (251)\begin{pmatrix} 2 \\ 5 \\ 1 \end{pmatrix}
  3. (5/617/35/6)\begin{pmatrix} 5/6 \\ 17/3 \\ 5/6 \end{pmatrix}
  4. (1.551.5)\begin{pmatrix} 1.5 \\ 5 \\ 1.5 \end{pmatrix} (correct answer)
Explanation: When you encounter orthogonal projection problems, you're finding the "shadow" of a vector onto a subspace - the closest point in that subspace to your original vector. The formula is projA(b)=A(ATA)1ATb\text{proj}_A(b) = A(A^T A)^{-1}A^T b. Let's work through this systematically. First, compute ATAA^T A: The inverse is straightforward: $$(A^T A)^{-1} = \begin{pmatrix} 1/6 & 0 \ 0 & 1/3 \end{pmatrix} Next, calculate $$A^T b$$: $$A^T b = \begin{pmatrix} 1 & 2 & 1 \\ 1 & -1 & 1 \end{pmatrix} \begin{pmatrix} 2 \\ 5 \\ 1 \end{pmatrix} = \begin{pmatrix} 9 \\ -2 \end{pmatrix} Now: $$(A^T A)^{-1}A^T b = \begin{pmatrix} 1/6 & 0 \ 0 & 1/3 \end{pmatrix} \begin{pmatrix} 9 \ -2 \end{pmatrix} = \begin{pmatrix} 3/2 \ -2/3 \end{pmatrix} Finally: $$A(A^T A)^{-1}A^T b = \begin{pmatrix} 1 & 1 \\ 2 & -1 \\ 1 & 1 \end{pmatrix} \begin{pmatrix} 3/2 \\ -2/3 \end{pmatrix} = \begin{pmatrix} 1.5 \\ 5 \\ 1.5 \end{pmatrix} This confirms answer D. Answer A uses incorrect arithmetic in the matrix multiplications. Answer B would only be correct if bb were already in the subspace (which it isn't). Answer C appears to involve calculation errors in the inverse or final multiplication steps. Study tip: Always verify that ATAA^T A is invertible before applying the projection formula, and double-check your matrix arithmetic - small errors compound quickly in multi-step calculations.

Question 14

Consider the overdetermined linear system Ax=bAx = b where A=(100111)A = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} and b=(120)b = \begin{pmatrix} 1 \\ 2 \\ 0 \end{pmatrix}. To find the least squares solution x^\hat{x}, which of the following normal equations must be solved?

  1. (2112)x^=(12)\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \hat{x} = \begin{pmatrix} 1 \\ 2 \end{pmatrix} (correct answer)
  2. (2112)x^=(120)\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \hat{x} = \begin{pmatrix} 1 \\ 2 \\ 0 \end{pmatrix}
  3. (100111)x^=(12)\begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} \hat{x} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}
  4. (101011)x^=(120)\begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix} \hat{x} = \begin{pmatrix} 1 \\ 2 \\ 0 \end{pmatrix}
Explanation: The least squares solution x^\hat{x} is found by solving the normal equations ATAx^=ATbA^T A \hat{x} = A^T b. First, we compute ATAA^T A and ATbA^T b. AT=(101011)A^T = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix}. ATA=(101011)(100111)=(1(1)+0(0)+1(1)1(0)+0(1)+1(1)0(1)+1(0)+1(1)0(0)+1(1)+1(1))=(2112)A^T A = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} = \begin{pmatrix} 1(1)+0(0)+1(1) & 1(0)+0(1)+1(1) \\ 0(1)+1(0)+1(1) & 0(0)+1(1)+1(1) \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}. ATb=(101011)(120)=(1(1)+0(2)+1(0)0(1)+1(2)+1(0))=(12)A^T b = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix} \begin{pmatrix} 1 \\ 2 \\ 0 \end{pmatrix} = \begin{pmatrix} 1(1)+0(2)+1(0) \\ 0(1)+1(2)+1(0) \end{pmatrix} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}. Thus, the normal equation is (2112)x^=(12)\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \hat{x} = \begin{pmatrix} 1 \\ 2 \end{pmatrix}. (B) is incorrect because it uses the equation ATAx^=bA^T A \hat{x} = b, failing to multiply bb by ATA^T. (C) is incorrect because it represents Ax^=ATbA \hat{x} = A^T b. (D) is incorrect because it represents ATx^=bA^T \hat{x} = b.

Question 15

A scientist models an experiment with the equation y(t)=at+bt2y(t) = at + bt^2. She collects three data points (t,y)(t, y): (1,2)(1, 2), (2,9)(2, 9), and (3,20)(3, 20). Which matrix equation represents the normal equations ATAx^=ATbA^T A \hat{x} = A^T b for finding the least-squares estimate of the parameters x^=(ab)\hat{x} = \begin{pmatrix} a \\ b \end{pmatrix}?

  1. (36614)(ab)=(3180)\begin{pmatrix} 3 & 6 \\ 6 & 14 \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 31 \\ 80 \end{pmatrix}
  2. (14363698)(ab)=(80218)\begin{pmatrix} 14 & 36 \\ 36 & 98 \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 80 \\ 218 \end{pmatrix} (correct answer)
  3. (14141414)(ab)=(8080)\begin{pmatrix} 14 & 14 \\ 14 & 14 \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 80 \\ 80 \end{pmatrix}
  4. (112439)(ab)=(2920)\begin{pmatrix} 1 & 1 \\ 2 & 4 \\ 3 & 9 \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 2 \\ 9 \\ 20 \end{pmatrix}
Explanation: When you encounter a least-squares problem, you're setting up the matrix equation Ax^=bA\hat{x} = b where AA contains your input data, x^\hat{x} holds the unknown parameters, and bb contains your observed outputs. The normal equations ATAx^=ATbA^T A \hat{x} = A^T b give you the best-fit solution. For the model y(t)=at+bt2y(t) = at + bt^2, your matrix AA has columns for each parameter's coefficients. With data points (1,2)(1,2), (2,9)(2,9), and (3,20)(3,20), you get: Computing ATAA^T A: Computing ATbA^T b: This confirms answer B is correct. A uses incorrect dimensions and values. C has a singular matrix (identical rows), which can't represent proper normal equations. D shows the original system Ax^=bA\hat{x} = b, not the normal equations. Study tip: Always remember that normal equations transform your original system by multiplying both sides by ATA^T. The resulting ATAA^T A matrix will be square and symmetric, helping you verify your setup.

Question 16

Consider the matrix equation Ax=bA\mathbf{x} = \mathbf{b} where AA has linearly independent columns. If PP is the orthogonal projection matrix onto the column space of AA, and x\mathbf{x}^* is the least squares solution, which expression correctly represents the projection of b\mathbf{b} onto Col(A)\text{Col}(A)?

  1. AATb=A(ATA)1ATbAA^T \mathbf{b} = A(A^T A)^{-1}A^T \mathbf{b}
  2. (ATA)1ATb=AT(AAT)1b(A^T A)^{-1}A^T \mathbf{b} = A^T(AA^T)^{-1}\mathbf{b}
  3. ATAx=(ATA)1ATbA^T A\mathbf{x}^* = (A^T A)^{-1}A^T \mathbf{b}
  4. Ax=A(ATA)1ATbA\mathbf{x}^* = A(A^T A)^{-1}A^T \mathbf{b} (correct answer)
Explanation: When you encounter least squares problems, you're dealing with finding the best approximation when the system Ax=bA\mathbf{x} = \mathbf{b} has no exact solution. The key insight is that the least squares solution x\mathbf{x}^* produces AxA\mathbf{x}^*, which is the orthogonal projection of b\mathbf{b} onto the column space of AA. The projection of b\mathbf{b} onto Col(A)\text{Col}(A) is given by Pb=A(ATA)1ATbP\mathbf{b} = A(A^TA)^{-1}A^T\mathbf{b}, where PP is the orthogonal projection matrix. Since AA has linearly independent columns, ATAA^TA is invertible, making this formula valid. The least squares solution is x=(ATA)1ATb\mathbf{x}^* = (A^TA)^{-1}A^T\mathbf{b}, so Ax=A(ATA)1ATbA\mathbf{x}^* = A(A^TA)^{-1}A^T\mathbf{b}, which is exactly the projection formula. Option A incorrectly claims AATb=A(ATA)1ATbAA^T\mathbf{b} = A(A^TA)^{-1}A^T\mathbf{b}. The matrix AATAA^T projects onto the column space of AA only when AA has orthonormal columns, which isn't given here. Option B confuses the least squares solution itself with the projection. The expression (ATA)1ATb(A^TA)^{-1}A^T\mathbf{b} is x\mathbf{x}^*, not the projection of b\mathbf{b}. The claimed equality with AT(AAT)1bA^T(AA^T)^{-1}\mathbf{b} is also false. Option C incorrectly sets ATAx=(ATA)1ATbA^TA\mathbf{x}^* = (A^TA)^{-1}A^T\mathbf{b}. Since x=(ATA)1ATb\mathbf{x}^* = (A^TA)^{-1}A^T\mathbf{b}, the left side would equal ATbA^T\mathbf{b}, which generally differs from the right side. Remember: in least squares problems, AxA\mathbf{x}^* always represents the projection of b\mathbf{b} onto the column space of AA.

Question 17

Under which condition is the least squares solution x^\hat{x} to the system Ax=bAx = b guaranteed to be unique?

  1. The columns of AA are linearly independent. (correct answer)
  2. The matrix AA is invertible.
  3. The number of rows of AA is greater than its number of columns.
  4. The vector bb is in the column space of AA.
Explanation: The least squares solution x^\hat{x} is found by solving the normal equations ATAx^=ATbA^T A \hat{x} = A^T b. This system has a unique solution for x^\hat{x} if and only if the matrix ATAA^T A is invertible. The matrix ATAA^T A is invertible if and only if the columns of the original matrix AA are linearly independent. (B) is incorrect because in least-squares problems, AA is typically a non-square matrix and thus cannot be invertible. (C) is a common characteristic of overdetermined systems but does not guarantee linearly independent columns. For example, one column could be a multiple of another. (D) implies that an exact solution exists (Ax^b=0||A\hat{x}-b||=0), but it does not guarantee the solution is unique; if columns of AA are dependent, there could be infinitely many exact solutions.

Question 18

What is the least squares solution x^\hat{x} to the inconsistent system Ax=bAx = b where A=(121)A = \begin{pmatrix} 1 \\ 2 \\ -1 \end{pmatrix} and b=(111)b = \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix}?

  1. (correct answer)
Explanation: To find the least squares solution, we solve the normal equation ATAx^=ATbA^T A \hat{x} = A^T b. AT=(121)A^T = \begin{pmatrix} 1 & 2 & -1 \end{pmatrix}. ATA=(121)(121)=(12+22+(1)2)=(1+4+1)=(6)A^T A = \begin{pmatrix} 1 & 2 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 2 \\ -1 \end{pmatrix} = (1^2 + 2^2 + (-1)^2) = (1+4+1) = (6). ATb=(121)(111)=(1(1)+2(1)1(1))=(1+21)=(2)A^T b = \begin{pmatrix} 1 & 2 & -1 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \\ 1 \end{pmatrix} = (1(1) + 2(1) - 1(1)) = (1+2-1) = (2). The normal equation is (6)x^=(2)(6)\hat{x} = (2), which gives x^=(2/6)=(1/3)\hat{x} = \begin{pmatrix} 2/6 \end{pmatrix} = \begin{pmatrix} 1/3 \end{pmatrix}. (B) results from a sign error in calculating ATAA^T A as 1+41=41+4-1=4, leading to 4x^=24\hat{x}=2. (C) results from a sign error in calculating ATbA^T b as 1+2+1=41+2+1=4, leading to 6x^=46\hat{x}=4. (D) represents the value of ATbA^T b, not x^\hat{x}.