Orthonormal vectors q₁, …, qₙ are perpendicular unit vectors: qᵢᵀqⱼ = 0 for i ≠ j and 1 for i = j. Put them in the columns of Q and the whole statement becomes QᵀQ = I, whether Q is square or rectangular. A square Q is called an orthogonal matrix, and then Qᵀ = Q⁻¹. Examples: permutation matrices; the rotation with columns (cos θ, sin θ) and (−sin θ, cos θ); the matrices of ±1 named after Hadamard, divided by √2 or 2; and (1, 2, 2)/3 with (−2, −1, 2)/3. Orthonormal columns make projections easy: P = QQᵀ (the identity if Q is square), the normal equations become x̂ = Qᵀb, and each component is a dot product, x̂ᵢ = qᵢᵀb. Gram–Schmidt turns independent vectors a, b, c into orthonormal ones: keep A = a, subtract from b its projection onto A, B = b − (Aᵀb/AᵀA)A, subtract from c its projections onto A and B, then divide each by its length. For a = (1, 1, 1), b = (1, 0, 2) it gives B = (0, −1, 1) and q₁ = (1, 1, 1)/√3, q₂ = (0, −1, 1)/√2, spanning the same plane. In matrix form A = QR, with R upper triangular because each later q is perpendicular to the earlier a's.
Much of numericallinear algebra is built on orthonormalvectors, because they never overflow or underflow (p. 1). Put them in the columns of Q. Then QTQ collects all the dot products, and gives the best possible answer (pp. 2–3):
Q need not be square: it might have two columns with many components (p. 3). Only when it is square is it called an orthogonal matrix (Strang would prefer "orthonormalmatrix", but the convention is fixed, pp. 3–4), and then (p. 4)
Orthogonal matrix
Q square: QT=Q−1
In words
capital Q square: capital Q ^ capital T equals capital Q to the power minus 1
where the second has orthogonal columns of length 2 until divided by 2 (p. 5). Repeating its pattern in blocks, with a minus sign in the corner block, gives a 4×4 example (p. 6; Strang describes it in words, and the entries below are written out from that description):
Four by four
Q=2111111−11−111−1−11−1−11
In words
capital Q equals one half 1 1 1 1; 1 minus 1 1 minus 1; 1 1 minus 1 minus 1; 1 minus 1 minus 1 1
Matrices of ±1 with orthogonal columns are named after Hadamard (the transcript spells it "Adhemar"). Strang lists sizes 2, 4, 16, 64; the block construction in fact gives every power of 2 (8 and 32 too). He thinks there is none of size 5, and for some sizes nobody knows (p. 6). (Not from the lecture: the size must be 1, 2 or a multiple of 4, and whether every multiple of 4 is possible is still an open question.) A rectangular example without square roots (pp. 7–8): (1,2,2)/3 and (−2,−1,2)/3 are orthonormal, and they are an orthonormal basis for the plane they span. Strang then finds a third column from the entries 1, 2, 2 with suitable signs, for instance (2,−2,1)/3 (p. 8). Orthonormalvectors are automatically independent (p. 8).
capital Q ^ capital T capital Q x hat equals capital Q ^ capital T b which gives x hat equals capital Q ^ capital T b, x sub i hat equals q sub i ^ capital T b
No inversion, no system to solve: the component along the i-th basisvector is just a dot product, a formula Strang ranks among the most important in several branches of mathematics (pp. 11–12).
Now start from independent vectors that are not orthonormal and make them so (transcript, p. 12). The goal is not a triangular matrix, as in elimination, but orthonormal columns (p. 12). With two vectorsa and b, first make orthogonalvectorsA and B, then divide by their lengths: q1=A/∥A∥, q2=B/∥B∥ (p. 13). (Strang jokes that dividing by the length was Schmidt's contribution; the transcript spells Gram as "Graham".) Keep A=a. For B, remove from b its projection onto A, leaving the error part e from the first projection lecture (pp. 14–15):
The second vector
B=b−ATAATbA,ATB=ATb−ATAATbATA=0
In words
capital B equals b minus capital A ^ capital T b over the quantity capital A ^ capital T capital A, times capital A, capital A ^ capital T capital B equals capital A ^ capital T b minus capital A ^ capital T b over the quantity capital A ^ capital T capital A, times capital A ^ capital T capital A equals 0
B is not zero because a and b are independent (p. 15). For a third vectorc, subtract its components in both directions found so far (pp. 16–18):
The third vector
C=c−ATAATcA−BTBBTcB
In words
capital C equals c minus capital A ^ capital T c over the quantity capital A ^ capital T capital A, times capital A minus capital B ^ capital T c over the quantity capital B ^ capital T capital B, times capital B
Example (pp. 19–21). a=(1,1,1) and b=(1,0,2): ATb=3 and ATA=3, so B=(1,0,2)−(1,1,1)=(0,−1,1), perpendicular to A (pp. 19–20). Dividing by the lengths 3 and 2 (pp. 20–21):
Gram–Schmidt example
Q=1/31/31/30−1/21/2
In words
capital Q equals 1 over the square root of 3 0; 1 over the square root of 3 minus 1 over the square root of 2; 1 over the square root of 3 1 over the square root of 2
a one a two equals q one q two a one ^ capital T q one a two ^ capital T q one; a one ^ capital T q two a two ^ capital T q two, a one ^ capital T q two equals 0
(a) Apply Gram–Schmidt to a=(1,0,1), b=(1,1,0), c=(1,2,3). (b) Use the result to write v=(2,0,0) in the orthonormal basis.
(a) A and B
A=(1,0,1). ATb/ATA=21, so B=(1,1,0)−21(1,0,1)=(21,1,−21).
(a) C
ATc/ATA=24=2 and BTc/BTB=3/21=32. So C=(1,2,3)−2(1,0,1)−32(21,1,−21)=(−34,34,34). Check: ATC=0 and BTC=−32+34−32=0. Normalizing: q1=(1,0,1)/2, q2=(1,2,−1)/6, q3=(−1,1,1)/3.
(b) Components are dot products
q1Tv=2, q2Tv=2/6, q3Tv=−2/3. Then 2q1+62q2−32q3=(1,0,1)+31(1,2,−1)+32(1,−1,−1)=(2,0,0).
At right angles; more generally, of two vectors or functions, having a dot product, or an integral of their product, of zero. Explained in Introduction to Fourier series.
A set of independent vectors from which every vector in a space can be built, in exactly one way, as a combination. Explained in Independence, basis and dimension.
A way to fit a model to data by choosing it to make the sum of the squared errors as small as possible. Explained in Projection matrices and least squares.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.
A way of multiplying two vectors that gives a number: multiply matching components and add, or lengths times the cosine of the angle between them. Explained in Vectors and the dot product.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
A matrix made by reordering the rows of the identity matrix; multiplying by it reorders the rows of another matrix the same way. Explained in Elimination with matrices.
The span of some vectors is everything that can be made by combining them; vectors span a space when they fill all of it. Explained in Independence, basis and dimension.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
A square matrix with only zeros below its diagonal (upper triangular) or only zeros above it (lower triangular). Explained in Elimination with matrices.
The difference between a measured or computed value and the true one; often how large that difference may be.
Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).