Reduced QR and compatible dimensions
With full column rank, R is invertible. When m>n, QQᵀ is a projector rather than Im.[1]
Full QR extends Q to an m×m orthogonal matrix and adds zero rows to R. Reduced QR suffices for an overdetermined least-squares problem. For independent columns, positive diagonal entries in R fix the reduced factorization uniquely. Otherwise matching sign changes in Q and R leave A unchanged.[2]
How triangular form is constructed
For two independent real columns, this is a geometric Gram–Schmidt construction; r11=‖a1‖ and r22=‖u2‖.[1]
The second residual is perpendicular to the first direction. This gives triangular structure: column one uses q1 only, while column two uses q1 and q2. Larger numerical computations commonly use Householder reflections, which reduce columns by orthogonal transformations and are less vulnerable to the loss of orthogonality in classical Gram–Schmidt. The geometric construction is not a recommendation to use classical Gram–Schmidt for every sensitive matrix.[1]
Least squares with QR
For reduced QR with full column rank. The residual need not vanish but must be perpendicular to the column space.[2]
Orthogonal decomposition separates the part of b in the column space from its unavoidable residual. A triangular solve determines the first part. Rank deficiency makes R singular and requires, for example, rank-revealing QR or an SVD with an explicit tolerance policy. With compatible real coordinates, Q is dimensionless and R carries column scaling. The bounded calculator handles two independent columns of a real 2×2 matrix, not arbitrary least-squares systems.[2]
Two worked examples
A QR factorization with rational directions
- Given
- A has columns a1=(3,4)ᵀ and a2=(1,3)ᵀ.
- Find
- Find Q and R with positive diagonal in R.
Normalize column one and project column two.
The residual has unit length.
Assemble directions and coefficients.
Result: A=QR with QᵀQ=I.
Check: 3q1+q2=(1,3)ᵀ and 5q1=(3,4)ᵀ; q1·q2=0.
An overdetermined system with a nonzero residual
- Given
- A has columns (1,1,0)ᵀ and (0,0,1)ᵀ; b=(1,3,2)ᵀ.
- Find
- Minimize ‖Ax−b‖2 using reduced QR.
The original columns are already orthogonal.
Solve the triangular system.
The residual is perpendicular to both columns.
Result: The unique least-squares solution is x=(2,2)ᵀ.
Check: Qᵀr=0; an exact solution is impossible because the first two components of Ax must agree.
Recall the method later with the formula’s flashcards.
10 flashcards · English materials
Already have an account? Sign in for flashcardsAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Five exercises with solutions
Calculate · Foundation
Find reduced QR of A=diag(2,5) with positive diagonal in R.
Show hint
The coordinate directions are already orthogonal.
Learning goal: Normalize orthogonal columns.
Show solution and calculation
Q=I and R=diag(2,5).
Column lengths are 2 and 5, and QR=A.
Rearrange · Application
Given A=QR and QᵀQ=I, how do you recover R?
Show hint
Multiply on the left by Qᵀ.
Learning goal: Recover R from Q.
Show solution and calculation
QᵀA=QᵀQR=R.
For rectangular reduced Q this does not imply QQᵀ=I.
Interpret · Application
What are the dimensions in reduced QR of a rank-3 matrix of size 7×3?
Show hint
The product must have size 7×3.
Learning goal: Distinguish reduced from full QR.
Show solution and calculation
Q is 7×3 and R is 3×3.
QᵀQ=I3, while QQᵀ is a rank-3 projector of size 7×7.
Error analysis · Application
Someone changes q2 to −q2 but leaves R unchanged. Is A=QR preserved?
Show hint
Consider the second row of R in the product.
Learning goal: Check sign conventions without false uniqueness.
Show solution and calculation
Generally not.
The second row of R must also change sign.
Both changes then cancel, although the positive-diagonal convention is lost.
Transfer · Challenge
A computation gives x=(2,1) for example two. Use the residual to show it is not a least-squares solution.
Show hint
Check the residual dot product with a2.
Learning goal: Use orthogonality of a least-squares residual.
Show solution and calculation
Ax=(2,2,1)ᵀ and r=(−1,1,1)ᵀ.
Thus a2ᵀr=1≠0.
The residual is not perpendicular to the column space; setting x2=2 improves it.
Check your understanding with the formula’s reference test.
8 test questions · English materials
Already have an account? Sign in for the testAvailable from Essential. A ready-made formula set, no AI credits required. Article exercises are not all included.
Related next steps
The geometric construction is explained in the Gram–Schmidt process.
For fitting observations, continue with the Least squares method.
For rank questions, use Singular value decomposition.
Sources for this explanation
Quanta · Updated November 8, 2026
- University of Göttingen: QR decomposition using Householder transformations (translated source label)
- Cornell CS 6241 — SVD and other low-rank decompositions
Editorial responsibility: Quanta Study editorial team
Review scope
This explanation, 2 worked examples and 5 exercises are available in German and English. Structure, source references and mathematical notation undergo automated checks. Calculations, model assumptions and both language versions receive a separate AI review.
An independent, named human subject review has not yet been documented. Our exercise numbers are worked examples, rather than measurements published by the cited sources.
Editorial responsibility, sources and methodsChange history
- Added a full article with assumptions, derivation, two worked examples and five varied exercises.
Cite this reference page
Quanta. QR Factorization. Updated November 8, 2026. https://quanta-study.de/en/formula-sheet/qr-zerlegung-matrix
When citing a specific scientific statement, also cite the specialist source linked to that statement.