a Householder reflection
/ HOWSS-holder /
A Householder reflection is a clever mirror. Pick a plane through the origin; the reflection sends every vector to its mirror image across that plane. Like any mirror, it preserves lengths and angles — it just flips. The trick is to choose the mirror so that it flips a chosen vector exactly onto a coordinate axis, collapsing all but one of its entries to zero in a single stroke. Chaining a few such reflections is how you most reliably build the QR factorization of a matrix.
Concretely, a Householder reflector is H = I - 2 v v^T / (v^T v), a matrix built from a single vector v (the normal to the mirror plane). Applied to a column, you choose v so that H zeroes out everything below the first entry: H x = (alpha, 0, 0, ..., 0)^T. To triangularize A, you reflect the first column to put zeros below the diagonal, then reflect within the remaining lower block to clear the second column, and so on; after n such steps A has become upper triangular R, and the product of the reflections is Q. You never store H as a full matrix — you apply it as x -> x - 2 (v^T x / v^T v) v, which is just a dot product and a vector update, cheap and stable.
Householder reflections are the workhorse behind dense QR (and behind reductions to Hessenberg and bidiagonal form for eigenvalue and SVD algorithms). Their great virtue is backward stability: the computed factorization is the exact QR of a matrix very close to A, so rounding errors never blow up. One subtlety: to avoid catastrophic cancellation when forming v, you pick the sign of alpha to point away from the original vector — a tiny detail that matters for robustness.
To zero the entries below the first in x = (3, 4)^T (length 5), reflect it onto the axis: H x = (-5, 0)^T or (5, 0)^T. Choosing alpha = -5 (opposite sign to the leading entry +3) makes v = x - alpha e_1 = (8, 4)^T large and well-scaled, avoiding cancellation. One reflection, one column cleared.
A single mirror flips a vector onto an axis, zeroing a whole column below the diagonal at once.
Apply Householder reflectors as rank-one updates, never as explicit dense matrices — that keeps the cost low and the algorithm backward stable. And mind the sign choice for v, or cancellation will quietly erode accuracy.