4.5.36 · D5Linear Algebra (Full)

Question bank — QR decomposition

1,398 words6 min readBack to topic

Before we start, one reminder of every symbol so nothing here is used unexplained:


True or false — justify

always holds for thin QR.
True — that is the defining property, the columns are orthonormal by construction, so the Gram matrix of is the identity.
also always holds.
False for thin QR — is the projection onto the column space of , not the identity, unless (full/square case).
Every real matrix has a QR decomposition.
True in a weak sense: exists for any , but uniqueness with positive diagonal needs linearly independent columns; with dependent columns some and isn't fully determined.
being upper-triangular is a lucky coincidence of the algorithm.
False — it is forced: is built only from , so any coefficient with must be zero, which is upper-triangularity.
The diagonal entries can be zero for an independent-column matrix.
False — independence means at every step, so ; a zero would signal a linear dependence.
If is already orthogonal, then .
True — Gram–Schmidt finds each column already unit-length and perpendicular, so every and all off-diagonals vanish, giving , .
Multiplying 's first column by leaves unchanged.
True — scaling only rescales ; after normalizing, is identical, though (and the first row of ) doubles.
QR and LU give the same factorization for symmetric matrices.
False — LU is two triangular factors; QR pairs an orthogonal factor with a triangular one, so they coincide only in trivial cases, never generically.
is invertible for independent columns.
True — it is triangular with all diagonal entries , and a triangular matrix's determinant is the product of the diagonal, which is nonzero here.
Swapping two columns of just swaps the corresponding columns of .
False — reordering columns changes who gets orthogonalized against whom, so both and can change entirely; QR is order-dependent.

Spot the error

"Since , we have ."
Error — needs square; a tall has no two-sided inverse. Only acts as a left inverse (), not .
"Least squares needs the normal equations , so QR just hides that computation."
Error in spirit — QR avoids forming , whose condition number is squared; solving keeps the original conditioning, which is the whole numerical point.
"To solve , I invert and multiply."
Error of practice — you never invert ; being triangular you back-substitute from the bottom row up, which is faster and more stable than forming .
"Classical Gram–Schmidt and Householder reflections give different , so the answer depends on the method."
Error — up to sign conventions they produce the same ; they differ only in numerical accuracy, not in the exact answer.
" can have negative diagonal, it doesn't matter."
Error — a negative corresponds to flipping the sign of ; it's still a valid QR, but you lose uniqueness, so a positive-diagonal convention is fixed.
" preserves length, so implies ."
Error — you must multiply by , giving , not ; generally differs from (and may not even lie in 's column space).
"The projection of onto is ."
Error — the projection vector is ; you scale the unit direction , not . This scalar is exactly the entry .

Why questions

Why do we normalize each to get ?
So that 's columns are unit length, making ; without it the diagonal of would be tangled into and lengths wouldn't be preserved.
Why is the off-diagonal entry a projection coefficient?
Because is a unit vector, the dot product is precisely the signed length of 's shadow along — the amount of used to rebuild .
Why does QR beat the normal equations numerically?
The normal equations use , squaring the condition number and amplifying rounding; QR works with directly through the orthogonal , which never inflates errors.
Why must the columns of be independent for the thin QR to be unique?
A dependent column produces , so is undefined (dividing by zero) and — the recipe breaks and the direction is arbitrary.
Why is QR the engine of the QR algorithm?
Repeatedly setting is an orthogonal similarity transform that preserves eigenvalues while pushing the matrix toward triangular form, revealing eigenvalues on the diagonal.
Why does flipping the sign of a whole still give a valid decomposition?
Negating and simultaneously negating row of leaves unchanged, since the two sign flips cancel in the product — so validity survives but uniqueness needs a sign rule.
Why does preserve lengths and angles?
Because ; the orthonormality collapses the middle to identity, so acts like a rotation/reflection.
Why is Gram–Schmidt "the same thing" as QR?
Gram–Schmidt is the step-by-step procedure; writing each and stacking those relations column-by-column is literally the matrix equation .

Edge cases

What is the QR of a single-column matrix ?
and — a triangular matrix; there are no later columns to orthogonalize.
What happens if two columns of are identical?
The second one has zero leftover after projection (), so and is undefined — QR with positive diagonal doesn't exist because the columns are dependent.
What is the QR of the identity matrix ?
and — the columns are already orthonormal, so Gram–Schmidt does nothing, matching the "orthogonal in ⇒ do nothing" rule.
What if has a zero column somewhere?
That column is dependent (it's a trivial combination of the others), , and no positive-diagonal QR exists; the matrix lacks independent columns.
For a square () with independent columns, is thin QR the same as full QR?
Yes — when there are no extra rows to pad, so is already orthogonal and holds too.
If lies exactly in the column space of , what is the least-squares residual?
Zero — the projection is exact, has a true solution, and solving recovers it with no leftover error.
What does equal geometrically?
It is , the length of the first column, since with nothing subtracted yet — the first diagonal of is just that column's length.