Linear Algebra / Unit 6, Orthogonality / Topic 6.2
Unit 6. Orthogonality
This topic studies bases whose vectors are perpendicular to each other. In such a basis, coordinates and projections are found with dot products, with no system of equations to solve. The Gram-Schmidt process builds such a basis from any basis.
You need Topics 1.4, 4.3, and 6.1 for this topic.
A set of vectors is called orthogonal when each pair of different vectors in it has a dot product of 0. The set is called orthonormal when, in addition, each vector has the length 1.
qi · qj = 0 for i ≠ j and qi · qi = 1The standard unit vectors are orthonormal. The vectors (1, 1) and (1, −1) are orthogonal, but not orthonormal, because each has the length √2. Dividing each vector by its length gives the orthonormal pair (1, 1)/√2 and (1, −1)/√2.
Orthogonal vectors, none of which is the zero vector, are always linearly independent. Take the dot product of c₁v₁ + … + ckvk = 0 with v₁. All of the terms except the first one vanish, which leaves c₁(v₁ · v₁) = 0, so c₁ = 0. The same argument works for each coefficient.
So n orthogonal vectors in a space of dimension n are a basis. It is called an orthogonal basis, or an orthonormal basis when the lengths are 1.
In Topic 4.3, the coordinates of a vector in a basis came from a system of equations. In an orthogonal basis, each coordinate comes from one dot product. Write x = c₁v₁ + … + cₙvₙ and take the dot product with v₁. Only the first term survives.
ci = (vi · x)/(vi · vi) and, for an orthonormal basis, ci = qi · xFor example, find the coordinates of x = (3, 1) in the orthogonal basis (1, 1), (1, −1).
c₁ = (3 + 1)/2 = 2the dot product with the first basis vector, divided by the dot product of that basis vector with itselfc₂ = (3 − 1)/2 = 1the same for the second basis vectorThese are the coordinates that Topic 4.3 found by solving two equations.
Each term civi is the projection of x onto the line of vi, from Topic 6.1. In an orthogonal basis, a vector is the sum of its projections onto the basis vectors. This is not true for a basis that is not orthogonal.
Let q₁, …, qk be an orthonormal basis of a subspace, and let Q be the matrix with these columns. Then QT Q = I, because the entry in row i and column j of QT Q is qi · qj. The formulas of Topic 6.1 become simple, because the inverse disappears.
p = (q₁ · b)q₁ + … + (qk · b)qk P = QQTThe Gram-Schmidt process starts with independent vectors a₁, a₂, a₃ and builds orthogonal vectors v₁, v₂, v₃ that span the same subspace. Each step takes the next vector and subtracts its projections onto the vectors that are already finished. What remains is perpendicular to all of them.
v₁ = a₁ v₂ = a₂ − (v₁ · a₂)/(v₁ · v₁) v₁ v₃ = a₃ − (v₁ · a₃)/(v₁ · v₁) v₁ − (v₂ · a₃)/(v₂ · v₂) v₂At the end, divide each vector by its length to get the orthonormal vectors q₁, q₂, q₃.
Try it: one step of the Gram-Schmidt process
Drag the tips of a₁ and a₂. The dashed purple segment is the projection of a₂ onto a₁, which is subtracted. The green arrow v₂ is what remains, and it is perpendicular to a₁. The two short dark arrows are the orthonormal vectors q₁ and q₂.
Take a₁ = (1, 1, 0), a₂ = (1, 0, 1), and a₃ = (0, 1, 1).
Step 1. v₁ = (1, 1, 0), with v₁ · v₁ = 2.
Step 2. v₁ · a₂ = 1, so
v₂ = 101 − 1/2 110subtract the projection of a₂ onto v₁v₂ = 1/2−1/21Only the direction of v₂ matters, so multiply it by 2 to remove the fractions: v₂ = (1, −1, 2), with v₂ · v₂ = 6.
Step 3. v₁ · a₃ = 1 and v₂ · a₃ = 1, so
v₃ = 011 − 1/2 110 − 1/6 1−12subtract the projections onto v₁ and v₂v₃ = −2/32/32/3Multiply by 3/2 to get v₃ = (−1, 1, 1).
Check:
(1, 1, 0) · (1, −1, 2) = 0(1, 1, 0) · (−1, 1, 1) = 0(1, −1, 2) · (−1, 1, 1) = 0Dividing by the lengths √2, √6, and √3 gives the orthonormal basis.
q₁ = 1/√2 110 q₂ = 1/√6 1−12 q₃ = 1/√3 −111The same ideas work in a vector space of functions, once a dot product of two functions is defined. For functions on an interval from a to b, the sum of the products of matching components becomes an integral.
f · g = ∫ f(x) g(x) dx, taken from a to bTwo functions are called orthogonal when this integral is 0. For example, on the interval from −1 to 1, the functions 1 and x are orthogonal, because the integral of x over that interval is 0.
In quantum mechanics, the possible states of definite energy are orthogonal functions, and a general state is a combination of them. The coefficient of each state comes from one integral. Topic 9.5 develops this.
| Term | Meaning |
|---|---|
| Orthogonal set | Each pair of different vectors has a dot product of 0 |
| Orthonormal set | Orthogonal, and each vector has the length 1 |
| Coordinates in an orthogonal basis | ci = (vi · x) / (vi · vi) |
| Orthonormal columns | QT Q = I |
| Projection with orthonormal columns | P = QQT |
| Gram-Schmidt process | Subtract from each vector its projections onto the vectors already finished |
Work each problem on paper first. Then open the answer to check your work.
2 + 2 − 4 = 02 − 4 + 2 = 04 − 2 − 2 = 0
The three dot products are 0, so the vectors are orthogonal.
Each has the length 3, so they are not orthonormal. Dividing each by 3 gives an orthonormal basis.
Each coordinate is (vi · x) / 9.
c₁ = 9/9 = 1c₂ = 18/9 = 2c₃ = 18/9 = 2(1, 2, 2) + 2(2, 1, −2) + 2(2, −2, 1) = (9, 0, 0)the check
v₁ = (3, 4)v₁ · v₁ = 25v₁ · a₂ = 11v₂ = (1, 2) − (11/25)(3, 4) = (−0.32, 0.24)a multiple of (−4, 3)q₁ = (0.6, 0.8)v₁ divided by its length 5q₂ = (−0.8, 0.6)(−4, 3) divided by its length 5
v₁ = (1, 1, 1)v₁ · v₁ = 3v₁ · a₂ = 3v₂ = (1, 0, 2) − (3/3)(1, 1, 1) = (0, −1, 1)subtract the projection(1, 1, 1) · (0, −1, 1) = 0the check
The two dot products are 2 and 3.
p = 2(1, 0, 0) + 3(0, 0.6, 0.8)p = (2, 1.8, 2.4)
The integral of x² − 1/3 from −1 to 1 is 2/3 − 2/3 = 0.
The instruction np.dot calculates a dot product. The code below tests the three vectors of Practice Problem 1 in pairs.
Python
The three results are 0, so the vectors are orthogonal.
The code below finds the first coordinate of x = (9, 0, 0) in this orthogonal basis.
Python
The result is 1.0. In the next box, replace the zeros in the lines that start with c2 and c3 with the formulas for the other two coordinates. The last line rebuilds the vector from its coordinates, so it should print the vector (9, 0, 0).
Python
The instruction np.linalg.norm calculates the length of a vector. Dividing a vector by its length gives a vector of length 1 in the same direction.
Python
The length of (1, 2, 2) is 3, so the result is (1/3, 2/3, 2/3), and its length is 1.
The code below does the first two steps of the example in Part 4. The third line subtracts from a₂ its projection onto v₁.
Python
The result is (0.5, −0.5, 1), and it is perpendicular to v₁. Part 4 multiplied this vector by 2 to remove the fractions. Python can keep the fractions.
In the next box, replace the zeros in the line that starts with v3 with the formula of the third step. Two projections have to be subtracted from a₃: one onto v₁ and one onto v₂.
Python
The code below builds the matrix Q whose columns are the orthonormal vectors of Part 4, and calculates QTQ. The instruction np.column_stack builds a matrix from its columns, np.sqrt is the square root, and np.round rounds each entry.
Python
The result is the identity matrix. Each diagonal entry is the dot product of a column with itself, which is 1. Each other entry is the dot product of two different columns, which is 0.
This quiz has 5 questions on this topic. A question asks you either to choose one answer or to type numbers. The page grades your answers and explains each one. A number can be typed as a whole number, a decimal, a fraction such as 1/3, or a calculation such as sqrt(18)/2 or arccos(1/2). The page shows the value of a calculation next to the box. Angles in a calculation are in degrees. The Calculator button under each question opens a calculator. Your answers are saved in your browser, so they are still on the page when you come back to it.
Choose how your answers are checked
1. Which pair of vectors is orthonormal?
Orthonormal vectors are perpendicular, and each has the length 1. The first pair and the last pair are perpendicular, but their lengths are not 1. The third pair is not perpendicular.
2. The vectors (3, 4) and (−4, 3) are an orthogonal basis of the plane. Find the coefficients c₁ and c₂ in (10, 5) = c₁(3, 4) + c₂(−4, 3).
With an orthogonal basis, each coefficient is one dot product divided by another.c₁ = (30 + 20)/25 = 2c₂ = (−40 + 15)/25 = −1
3. Apply the Gram-Schmidt process to a₁ = (1, 1) and a₂ = (4, 0). Find v₂.
v₁ = a₁ = (1, 1)projection of a₂ onto v₁ = (4/2)(1, 1) = (2, 2)v₂ = (4, 0) − (2, 2) = (2, −2)subtract the projection
4. Apply the Gram-Schmidt process to a₁ = (1, 0, 1) and a₂ = (3, 1, 1). Find v₂.
v₁ = a₁ = (1, 0, 1)projection of a₂ onto v₁ = (4/2)(1, 0, 1) = (2, 0, 2)v₂ = (3, 1, 1) − (2, 0, 2) = (1, 1, −1)subtract the projection
5. The matrix Q has orthonormal columns. Which equation is always true?
The entry in row i and column j of QT Q is the dot product of column i and column j of Q. It is 1 when i = j and 0 otherwise.