QR Factorization - Linear Algebra

  1. A 3×23 \times 2 matrix AA has QR factorization A=QRA = QR where QQ is 3×23 \times 2 and RR is 2×22 \times 2. If ∣∣Ax∣∣2=17||A\mathbf{x}||^2 = 17 for some vector x∈R2\mathbf{x} \in \mathbb{R}^2, what is the value of ∣∣Rx∣∣2||R\mathbf{x}||^2?
    Answer: 1717 Since A=QRA = QR and QQ has orthonormal columns, QTQ=I2Q^TQ = I_2. Therefore, ∣∣Ax∣∣2=∣∣QRx∣∣2=(QRx)T(QRx)=xTRTQTQRx=xTRTRx=∣∣Rx∣∣2=17||A\mathbf{x}||^2 = ||QR\mathbf{x}||^2 = (QR\mathbf{x})^T(QR\mathbf{x}) = \mathbf{x}^TR^TQ^TQR\mathbf{x} = \mathbf{x}^TR^TR\mathbf{x} = ||R\mathbf{x}||^2 = 17. Choice B incorrectly takes a square root. Choice C fails to recognize that orthonormality of QQ makes the result independent of the specific form of QQ. Choice D incorrectly suggests the relationship depends on the specific vector x\mathbf{x} rather than being a general property.
  2. Let AA be a 4×34 \times 3 matrix with QR factorization A=QRA = QR, where QQ is 4×34 \times 3 with orthonormal columns and RR is 3×33 \times 3 upper triangular. If the second column of AA is orthogonal to the first column of AA, which of the following must be true about the matrix RR?
    Answer: R12=0R_{12} = 0 only In the Gram-Schmidt process, Rij=⟨aj,qi⟩R_{ij} = \langle \mathbf{a}_j, \mathbf{q}_i \rangle for i≤ji \leq j. Since a2⊥a1\mathbf{a}_2 \perp \mathbf{a}_1, we have ⟨a2,q1⟩=⟨a2,a1⟩∣∣a1∣∣=0\langle \mathbf{a}_2, \mathbf{q}_1 \rangle = \frac{\langle \mathbf{a}_2, \mathbf{a}_1 \rangle}{||\mathbf{a}_1||} = 0, so R12=0R_{12} = 0. Since RR is upper triangular, R21=0R_{21} = 0 by definition, not due to orthogonality. Choice A incorrectly suggests both are consequences of orthogonality. Choice C misses the key implication. Choice D makes an unrelated claim about diagonal entries.
  3. A 5×35 \times 3 matrix AA has rank 2. When computing the QR factorization using Gram-Schmidt orthogonalization, what happens during the process when reaching the third column?
    Answer: The third column becomes a zero vector after orthogonalization, requiring special handling to complete the factorization When you encounter QR factorization problems involving rank-deficient matrices, focus on what happens during the Gram-Schmidt orthogonalization process when columns are linearly dependent. In Gram-Schmidt, each new column is made orthogonal to all previous columns by subtracting their projections. For a 5×35 \times 3 matrix with rank 2, the first two columns are linearly independent and will orthogonalize normally. However, the third column must be a linear combination of the first two (since the column space is only 2-dimensional). When you apply Gram-Schmidt to the third column, you subtract its projections onto the first two orthogonal vectors. Since the third column lies entirely in the span of the first two, these projections account for the entire vector - leaving nothing behind. The result is the zero vector, which cannot be normalized to create a unit vector for the QQ matrix. This is why answer C is correct: special handling is needed to complete the factorization, typically by adding an orthonormal vector to span the full space. Answer A is wrong because QR factorization can handle rank-deficient matrices with modifications. Answer B is incorrect because if the third column were already orthogonal to the first two, the matrix would have rank 3, not 2. Answer D mischaracterizes the process - the algorithm doesn't arbitrarily replace columns; it follows the mathematical consequence of linear dependence. Study tip: Remember that Gram-Schmidt reveals linear dependence by producing zero vectors - this is your signal that special techniques are needed for completion.
  4. Let AA be an m×nm \times n matrix with nn linearly independent columns. Its QR factorization is A=QRA=QR, where QQ is an m×nm \times n matrix and RR is an n×nn \times n matrix. Which statement most accurately describes the columns of the matrix QQ?
    Answer: They form an orthonormal basis for the column space of AA. The QR factorization is constructed by applying the Gram-Schmidt process to the columns of AA. This process explicitly creates a set of orthonormal vectors that span the same space as the original set of vectors. Therefore, the columns of QQ are an orthonormal set of vectors that form a basis for the column space of AA. Distractor C is incorrect because the columns of Q are normalized to have unit length, making them orthonormal, not just orthogonal. The other distractors refer to incorrect fundamental subspaces.
  5. Given the QR factorization of a matrix AA, a linear system Ax=bA\mathbf{x} = \mathbf{b} can be solved more easily. The first step is to transform the system into an equivalent upper triangular system. What is this equivalent system?
    Answer: Rx=QTbR\mathbf{x} = Q^T\mathbf{b} Starting with Ax=bA\mathbf{x} = \mathbf{b}, we substitute A=QRA=QR to get QRx=bQR\mathbf{x} = \mathbf{b}. Since the columns of QQ are orthonormal, QTQ=IQ^TQ=I. We can multiply both sides of the equation on the left by QTQ^T: QT(QRx)=QTbQ^T(QR\mathbf{x}) = Q^T\mathbf{b}, which simplifies to (QTQ)Rx=QTb(Q^TQ)R\mathbf{x} = Q^T\mathbf{b}, and then IRx=QTbIR\mathbf{x} = Q^T\mathbf{b}. This gives the equivalent system Rx=QTbR\mathbf{x} = Q^T\mathbf{b}. This system is easy to solve using back substitution because RR is upper triangular.
  6. Let AA be a 4×24 \times 2 matrix with linearly independent columns, and let A=QRA = QR be its QR factorization. If b\mathbf{b} is a vector in R4\mathbb{R}^4 such that QTb=(5−2)Q^T\mathbf{b} = \begin{pmatrix} 5 \\ -2 \end{pmatrix}, what is the solution to the least squares problem min⁡x∣∣Ax−b∣∣2\min_{\mathbf{x}} ||A\mathbf{x} - \mathbf{b}||^2?
    Answer: x=R−1(5−2)\mathbf{x} = R^{-1}\begin{pmatrix} 5 \\ -2 \end{pmatrix} When you encounter QR factorization in least squares problems, you're dealing with an elegant computational shortcut that avoids the numerical instability of the normal equations. The key insight is that for the least squares problem min⁡x∣∣Ax−b∣∣2\min_{\mathbf{x}} ||A\mathbf{x} - \mathbf{b}||^2, the normal equations give us ATAx=ATbA^T A \mathbf{x} = A^T \mathbf{b}. When A=QRA = QR, we can substitute: (QR)T(QR)x=(QR)Tb(QR)^T(QR)\mathbf{x} = (QR)^T\mathbf{b}, which simplifies to RTRx=RTQTbR^TR\mathbf{x} = R^TQ^T\mathbf{b}. Since RR is upper triangular and invertible (because AA has linearly independent columns), we can multiply both sides by (RT)−1(R^T)^{-1} to get Rx=QTbR\mathbf{x} = Q^T\mathbf{b}. Therefore, x=R−1QTb\mathbf{x} = R^{-1}Q^T\mathbf{b}. Since we're given that QTb=(5−2)Q^T\mathbf{b} = \begin{pmatrix} 5 \\ -2 \end{pmatrix}, the solution is x=R−1(5−2)\mathbf{x} = R^{-1}\begin{pmatrix} 5 \\ -2 \end{pmatrix}, making C correct. Option A represents the traditional normal equations approach but incorrectly applies (ATA)−1(A^TA)^{-1} to QTbQ^T\mathbf{b} instead of ATbA^T\mathbf{b}. Option B gives you a vector in R4\mathbb{R}^4, but x\mathbf{x} must be in R2\mathbb{R}^2 to match AA's column space. Option D ignores the matrix RR entirely, which would only work if RR were the identity matrix. Remember: QR factorization transforms least squares into the simpler system Rx=QTbR\mathbf{x} = Q^T\mathbf{b}. This is computationally superior to forming ATAA^TA explicitly.
  7. Consider the matrix A=(110101011)A = \begin{pmatrix} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix}. If A=QRA = QR is the QR factorization where QQ has orthonormal columns, what is the entry in position (2,1)(2,1) of the matrix QQ?
    Answer: 12\frac{1}{\sqrt{2}} To find Q, we apply Gram-Schmidt to the columns of A. Let the columns be a1=(1,1,0)T\mathbf{a}_1 = (1,1,0)^T, a2=(1,0,1)T\mathbf{a}_2 = (1,0,1)^T, a3=(0,1,1)T\mathbf{a}_3 = (0,1,1)^T. First, u1=a1=(1,1,0)T\mathbf{u}_1 = \mathbf{a}_1 = (1,1,0)^T with ∣∣u1∣∣=2||\mathbf{u}_1|| = \sqrt{2}, so q1=12(1,1,0)T\mathbf{q}_1 = \frac{1}{\sqrt{2}}(1,1,0)^T. The (2,1)(2,1) entry of Q is the second component of q1\mathbf{q}_1, which is 12\frac{1}{\sqrt{2}}. Choice B gives the incorrect normalization factor. Choice C involves an erroneous calculation mixing norms. Choice D uses the wrong denominator from incomplete normalization.
  8. Let A=(11131113)A = \begin{pmatrix} 1 & 1 \\ 1 & 3 \\ 1 & 1 \\ 1 & 3 \end{pmatrix}. In the QR factorization A=QRA=QR, the first column of QQ is q1=[12,12,12,12]T\mathbf{q}_1 = [\frac{1}{2}, \frac{1}{2}, \frac{1}{2}, \frac{1}{2}]^T. What is the value of the entry r12r_{12} in the matrix RR?
    Answer: 44 The entries of the matrix RR in the QR factorization are given by rij=qiTajr_{ij} = \mathbf{q}_i^T \mathbf{a}_j. To find r12r_{12}, we compute the dot product of the first column of QQ and the second column of AA. Given q1=[12,12,12,12]T\mathbf{q}_1 = [\frac{1}{2}, \frac{1}{2}, \frac{1}{2}, \frac{1}{2}]^T and a2=[1,3,1,3]T\mathbf{a}_2 = [1, 3, 1, 3]^T, the calculation is: r12=q1Ta2=(12)(1)+(12)(3)+(12)(1)+(12)(3)=12+32+12+32=82=4r_{12} = \mathbf{q}_1^T \mathbf{a}_2 = (\frac{1}{2})(1) + (\frac{1}{2})(3) + (\frac{1}{2})(1) + (\frac{1}{2})(3) = \frac{1}{2} + \frac{3}{2} + \frac{1}{2} + \frac{3}{2} = \frac{8}{2} = 4.
  9. Let AA be an invertible n×nn \times n matrix with QR factorization A=QRA=QR, where QQ is an orthogonal matrix and RR is an upper triangular matrix with positive diagonal entries. Which expression correctly gives the determinant of AA?
    Answer: det⁡(A)=±det⁡(R)\det(A) = \pm \det(R) Using the property that the determinant of a product of matrices is the product of their determinants, we have det⁡(A)=det⁡(QR)=det⁡(Q)det⁡(R)\det(A) = \det(QR) = \det(Q)\det(R). Since QQ is an orthogonal matrix, its columns are orthonormal. This means QTQ=IQ^TQ = I. Taking the determinant gives det⁡(QT)det⁡(Q)=det⁡(I)\det(Q^T)\det(Q) = \det(I), which is (det⁡(Q))2=1(\det(Q))^2 = 1. Therefore, det⁡(Q)\det(Q) must be either 11 or −1-1. Substituting this into the equation for det⁡(A)\det(A) gives det⁡(A)=(±1)det⁡(R)=±det⁡(R)\det(A) = (\pm 1)\det(R) = \pm \det(R).
  10. Consider a 3×33 \times 3 matrix AA whose columns have norms ∣∣a1∣∣=2||\mathbf{a}_1|| = 2, ∣∣a2∣∣=3||\mathbf{a}_2|| = 3, and ∣∣a3∣∣=1||\mathbf{a}_3|| = 1. After applying Gram-Schmidt orthogonalization, the resulting orthogonal vectors have norms ∣∣u1∣∣=2||\mathbf{u}_1|| = 2, ∣∣u2∣∣=5||\mathbf{u}_2|| = \sqrt{5}, and ∣∣u3∣∣=23||\mathbf{u}_3|| = \frac{2}{3}. In the QR factorization A=QRA = QR, what is R22R_{22}?
    Answer: 5\sqrt{5} In the QR factorization, the diagonal entries of RR are the norms of the orthogonalized vectors from Gram-Schmidt: Rii=∣∣ui∣∣R_{ii} = ||\mathbf{u}_i||. Therefore, R22=∣∣u2∣∣=5R_{22} = ||\mathbf{u}_2|| = \sqrt{5}. Choice A incorrectly uses the original norm of a2\mathbf{a}_2. Choice C uses the norm of u3\mathbf{u}_3. Choice D incorrectly attempts to normalize ∣∣u2∣∣||\mathbf{u}_2|| by the original norm of a2\mathbf{a}_2, which is not how the QR factorization works.
  11. Let AA be an m×nm \times n matrix with linearly independent columns, and let A=QRA=QR be its QR factorization. Which of the following statements is always true?
    Answer: The columns of QQ form an orthonormal basis for the column space of AA. The QR factorization is constructed using the Gram-Schmidt process on the columns of AA. This process generates an orthonormal set of vectors that spans the same subspace as the original columns. Therefore, the columns of QQ form an orthonormal basis for the column space of AA. Distractor A is false because QQ is only square (and thus invertible) if m=nm=n. Distractor B is false; RR is upper triangular, not necessarily symmetric. Distractor D is false because det⁡(A)=det⁡(Q)det⁡(R)\det(A) = \det(Q)\det(R), and det⁡(Q)\det(Q) is not always 1 (it can be -1).
  12. Let a1=[1,1,0]T\mathbf{a}_1 = [1, 1, 0]^T and a2=[1,2,2]T\mathbf{a}_2 = [1, 2, 2]^T. When applying the Gram-Schmidt process to the set of vectors {a1,a2}\{\mathbf{a}_1, \mathbf{a}_2\}, what is the resulting second orthogonal vector v2\mathbf{v}_2?
    Answer: [−12,12,2]T[-\frac{1}{2}, \frac{1}{2}, 2]^T The Gram-Schmidt process sets v1=a1=[1,1,0]T\mathbf{v}_1 = \mathbf{a}_1 = [1, 1, 0]^T. The second orthogonal vector v2\mathbf{v}_2 is found by subtracting the projection of a2\mathbf{a}_2 onto v1\mathbf{v}_1 from a2\mathbf{a}_2. The projection is projv1(a2)=a2⋅v1∥v1∥2v1=1(1)+2(1)+2(0)12+12+02[1,1,0]T=32[1,1,0]T=[32,32,0]T\mathrm{proj}_{\mathbf{v}_1}(\mathbf{a}_2) = \frac{\mathbf{a}_2 \cdot \mathbf{v}_1}{\|\mathbf{v}_1\|^2}\mathbf{v}_1 = \frac{1(1)+2(1)+2(0)}{1^2+1^2+0^2}[1, 1, 0]^T = \frac{3}{2}[1, 1, 0]^T = [\frac{3}{2}, \frac{3}{2}, 0]^T. Then, v2=a2−projv1(a2)=[1,2,2]T−[32,32,0]T=[−12,12,2]T\mathbf{v}_2 = \mathbf{a}_2 - \mathrm{proj}_{\mathbf{v}_1}(\mathbf{a}_2) = [1, 2, 2]^T - [\frac{3}{2}, \frac{3}{2}, 0]^T = [-\frac{1}{2}, \frac{1}{2}, 2]^T.
  13. Let A=[a1,a2]A = [\mathbf{a}_1, \mathbf{a}_2] have the QR factorization A=QRA=QR. In this context, what is the geometric interpretation of the vector r12q1r_{12}\mathbf{q}_1?
    Answer: The projection of the vector a2\mathbf{a}_2 onto the subspace spanned by q1\mathbf{q}_1. From the definition of the QR factorization, r12=q1Ta2r_{12} = \mathbf{q}_1^T \mathbf{a}_2. Since q1\mathbf{q}_1 is a unit vector ( ⁣∥q1 ⁣∥=1\!\|\mathbf{q}_1\!\|=1), this dot product is the scalar projection of a2\mathbf{a}_2 onto q1\mathbf{q}_1. Multiplying this scalar by the unit vector q1\mathbf{q}_1 gives the vector projection of a2\mathbf{a}_2 onto the line (subspace) spanned by q1\mathbf{q}_1. This is a key step in the Gram-Schmidt process, where this projection is subtracted from a2\mathbf{a}_2 to find a vector orthogonal to q1\mathbf{q}_1.
  14. Let A=[a1,a2]A = [\mathbf{a}_1, \mathbf{a}_2] be a matrix with QR factorization A=QRA=QR. A new matrix A′A' is formed by scaling the second column: A′=[a1,3a2]A' = [\mathbf{a}_1, 3\mathbf{a}_2]. If the QR factorization of A′A' is A′=Q′R′A' = Q'R', how do Q′Q' and R′R' relate to QQ and RR?
    Answer: Q′=QQ'=Q, and the second column of R′R' is 3 times the second column of RR. The first step of the Gram-Schmidt process depends only on a1\mathbf{a}_1, so q1′=q1\mathbf{q}'_1 = \mathbf{q}_1 and r11′=r11r'_{11} = r_{11}. We have a1=r11q1\mathbf{a}_1 = r_{11}\mathbf{q}_1 and a2=r12q1+r22q2\mathbf{a}_2 = r_{12}\mathbf{q}_1 + r_{22}\mathbf{q}_2. For A′A', we have A′=[a1,3a2]=[r11q1,3(r12q1+r22q2)]=[r11q1,(3r12)q1+(3r22)q2]A' = [\mathbf{a}_1, 3\mathbf{a}_2] = [r_{11}\mathbf{q}_1, 3(r_{12}\mathbf{q}_1 + r_{22}\mathbf{q}_2)] = [r_{11}\mathbf{q}_1, (3r_{12})\mathbf{q}_1 + (3r_{22})\mathbf{q}_2]. This can be written as A′=[q1,q2](r113r1203r22)A' = [\mathbf{q}_1, \mathbf{q}_2] \begin{pmatrix} r_{11} & 3r_{12} \\ 0 & 3r_{22} \end{pmatrix}. Thus, Q′=QQ'=Q and the second column of R′R' is 3 times the second column of RR.
  15. In the QR factorization A=QRA=QR, the Gram-Schmidt process is used to generate an orthogonal set of vectors {v1,v2,…,vn}\{\mathbf{v}_1, \mathbf{v}_2, \ldots, \mathbf{v}_n\} from the columns of AA. How are the diagonal entries rkkr_{kk} of the matrix RR related to these vectors?
    Answer: rkk=∥vk∥r_{kk} = \|\mathbf{v}_k\| The columns of QQ are the normalized versions of the orthogonal vectors vk\mathbf{v}_k, so qk=vk∥vk∥\mathbf{q}_k = \frac{\mathbf{v}_k}{\|\mathbf{v}_k\|}. The relationship between the columns of AA and the columns of QQ is given by ak=r1kq1+⋯+rkkqk\mathbf{a}_k = r_{1k}\mathbf{q}_1 + \dots + r_{kk}\mathbf{q}_k. The Gram-Schmidt process defines vk\mathbf{v}_k as the component of ak\mathbf{a}_k orthogonal to the subspace spanned by {q1,…,qk−1}\{\mathbf{q}_1, \dots, \mathbf{q}_{k-1}\}. This component is rkkqkr_{kk}\mathbf{q}_k. Therefore, vk=rkkqk\mathbf{v}_k = r_{kk}\mathbf{q}_k, and taking the norm of both sides gives ∥vk∥=∣rkk∣∥qk∥=∣rkk∣\|\mathbf{v}_k\| = |r_{kk}| \|\mathbf{q}_k\| = |r_{kk}|. By convention, rkkr_{kk} is chosen to be positive, so rkk=∥vk∥r_{kk} = \|\mathbf{v}_k\|.
  16. Consider the matrix A=(031504)A = \begin{pmatrix} 0 & 3 \\ 1 & 5 \\ 0 & 4 \end{pmatrix}. Let A=QRA=QR be its QR factorization. What are the first column of QQ, denoted q1\mathbf{q}_1, and the entry r11r_{11} of RR?
    Answer: q1=[0,1,0]T\mathbf{q}_1 = [0, 1, 0]^T and r11=1r_{11} = 1 The first step in the Gram-Schmidt process is to set v1=a1=[0,1,0]T\mathbf{v}_1 = \mathbf{a}_1 = [0, 1, 0]^T. Next, we find the norm of v1\mathbf{v}_1, which is ∥v1∥=02+12+02=1\|\mathbf{v}_1\| = \sqrt{0^2+1^2+0^2} = 1. The first diagonal entry of RR is this norm, so r11=1r_{11} = 1. The first column of QQ is found by normalizing v1\mathbf{v}_1: q1=v1∥v1∥=[0,1,0]T1=[0,1,0]T\mathbf{q}_1 = \frac{\mathbf{v}_1}{\|\mathbf{v}_1\|} = \frac{[0, 1, 0]^T}{1} = [0, 1, 0]^T. Since the first column of AA was already a unit vector, the process is simplified for the first step.
  17. Consider the matrix A=(240300)A = \begin{pmatrix} 2 & 4 \\ 0 & 3 \\ 0 & 0 \end{pmatrix}. In any QR factorization A=QRA = QR of this matrix, what can be concluded about the matrix RR?
    Answer: RR must be a 2×22 \times 2 matrix with positive diagonal entries Since AA has rank 2 (two linearly independent columns), the reduced QR factorization gives QQ as 3×23 \times 2 and RR as 2×22 \times 2 upper triangular. The diagonal entries of RR are the norms of the orthogonalized vectors, which are positive. Choice A describes the wrong dimension of RR. Choice B is incorrect because the columns of AA are not orthonormal (the first column has norm 2, not 1). Choice C is wrong because R11=∣∣a1∣∣=2R_{11} = ||\mathbf{a}_1|| = 2 but R22R_{22} equals the norm of the component of a2\mathbf{a}_2 orthogonal to a1\mathbf{a}_1, which is not 3.
  18. The QR factorization of a matrix AA with linearly independent columns is A=QRA=QR. Under which condition is this factorization guaranteed to be unique?
    Answer: The factorization is unique if the diagonal entries of RR are required to be positive. The QR factorization is not strictly unique because of sign choices. If we have a factorization A=QRA = QR, we can define a diagonal matrix DD with entries ±1\pm 1. Then A=(QD)(D−1R)=Q′R′A = (QD)(D^{-1}R) = Q'R' is another valid QR factorization. The matrix Q′Q' still has orthonormal columns, and R′R' is still upper triangular. To ensure uniqueness, a convention is adopted: requiring all diagonal entries of RR to be positive. This constraint fixes the signs of the columns in QQ.
  19. A 4×34 \times 3 matrix AA has the property that its first two columns are orthogonal unit vectors, and its third column is orthogonal to the first column but not to the second. In the QR factorization A=QRA = QR, which entry of RR represents the component of the third column of AA in the direction of the second column of AA?
    Answer: R23R_{23} When you encounter QR factorization questions, remember that the process systematically orthogonalizes columns using the Gram-Schmidt procedure, and the RR matrix stores the "memory" of how each original column relates to the orthogonal basis being built. In QR factorization, each entry RijR_{ij} represents how the jj-th original column projects onto the ii-th orthogonal vector. Since the first two columns of AA are already orthogonal unit vectors, they become the first two columns of QQ directly. When processing the third column, the algorithm computes its projections onto all previous orthogonal vectors. The component of the third column in the direction of the second column is exactly what R23R_{23} captures - this is the projection coefficient of column 3 onto the second orthogonal basis vector. This makes **(D) R23R_{23}** correct. **(A) R31R_{31} would represent how a hypothetical fourth column projects onto the first basis vector, but we only have three columns. (B) R32R_{32}** reverses the indices - this entry doesn't exist in the standard QR decomposition since RR is upper triangular. **(C) R13R_{13}** represents how the third column projects onto the first column, not the second. Study tip: In RijR_{ij}, think "column jj projected onto basis vector ii." The upper triangular structure means i≤ji \leq j, and each column index corresponds to an original column of AA while each row index corresponds to a basis vector in QQ.

Start this quiz