Inner products, orthogonality, and projection - Basic Exercises
These exercises use the
1Exercise plan
An
In these exercises, compute the
For projection and least-squares problems, the residual is the diagnostic. If is the projection of onto a subspace, then must be orthogonal to every vector in that subspace. For a least-squares solution of , this becomes , equivalently the normal equations .
2Problem 1
For and , find , , and , and decide whether and are
2.1Answer example
and
Since , they are not orthogonal.
2.2Explanation
Orthogonality is judged by the inner product, not by the visual appearance of components.
3Problem 2
For and , confirm and explain equality.
3.1Answer example
while and . Equality holds because the vectors point in the same direction.
3.2Explanation
This is the equality case of the
4Problem 3
Apply Gram-Schmidt
4.1Answer example
Let . Then
4.2Explanation
Because , division is allowed. Orthogonalization subtracts the component in the direction.
5Problem 4
For and , find the orthogonal projection of onto .
5.1Answer example
5.2Explanation
The formula cannot be used for because the denominator would be 0.
6Problem 5
For and , find the
6.1Answer example
The
6.2Explanation
The vector is not in , so the least-squares method chooses the closest point in the column space.
7Problem 6
In , define
Check that they are norms.
7.1Answer example
Both are nonnegative and vanish only at . For a scalar ,
Also,
by the scalar triangle inequality, and for ,
so .
7.2Explanation
A norm is any length function satisfying nonnegativity,
8Problem 7
For , , and , decide when equality holds in Cauchy-Schwarz for and .
8.1Answer example
Since , equality holds for . Since is not a scalar multiple of , equality does not hold for .
8.2Explanation
Equality in Cauchy-Schwarz is not just a numerical accident. It occurs exactly when the two vectors lie on the same line, that is, when they are linearly dependent. Here , so equality holds for ; is not a scalar multiple of , so equality fails for .
9Problem 8
Let
Find the projection of onto and a basis of .
9.1Answer example
Let , , and . The condition gives
Thus and , so
A vector orthogonal to both generators is , so is a basis of .
9.2Explanation
Projection onto a subspace is found by making the residual orthogonal to every direction in the subspace.
10Problem 9
For
solve the normal equations and check residual orthogonality.
10.1Answer example
Solving gives and . The least-squares solution is . The residual is
and .
10.2Explanation
The residual is orthogonal to the column space exactly when the approximating point is closest.
11Problem 10
For , define . Confirm this is an inner product.
11.1Answer example
The matrix is symmetric, and
which is positive for . Additivity and homogeneity follow from matrix multiplication. Thus it is an inner product.
11.2Explanation
A positive definite symmetric matrix defines a weighted inner product.
12Problem 11
Explain why with is not an inner product.
12.1Answer example
For ,
violating positive definiteness.
12.2Explanation
A bilinear-looking expression is not an inner product if squared length can be negative.
13Order note: complex inner products
The next problem is a preview of the later exercises on
14Problem 12
On , explain why is not a
14.1Answer example
Taking gives . A complex inner product must have real.
14.2Explanation
Complex inner products need conjugation and conjugate symmetry to make squared lengths nonnegative real numbers.
15Problem 13
For , , and , confirm strict and equality cases of the triangle inequality.
15.1Answer example
while
The first pair points in different directions; the second pair lies on the same positive ray.
This is a boundary case for the
16Related lectures
data/lecture/math/linear-algebra/norms-and-triangle-inequality.lecture.n.md data/lecture/math/linear-algebra/inner-product-space-basics.lecture.n.md data/lecture/math/linear-algebra/complex-inner-products-and-unitary-matrices.lecture.n.md data/lecture/math/linear-algebra/orthogonalization-basics.lecture.n.md data/lecture/math/linear-algebra/orthogonal-complements-and-projections.lecture.n.md data/lecture/math/linear-algebra/least-squares-basics.lecture.n.md17Related exercises
data/exercise/math/linear-algebra/complex-inner-products-and-unitary-matrices.exercise.n.md18Proof exercise: Cauchy-Schwarz and projection minimality
18.1Problem
In this proof exercise, work in a
For an inner product space and a nonzero vector , prove Cauchy-Schwarz and explain why the projection of onto minimizes distance to . Also prove the general subspace statement: if and , then is the point of closest to .
18.2Answer
For , consider
and choose . This gives
For projection, write
Then . For any ,
and the two summands are orthogonal, so
More generally, let and assume . For any ,
Since , the two summands are orthogonal. Hence
Therefore is the closest point in to .
18.3Explanation
The same orthogonality idea proves both the inequality and the closest-point property of projections, first for a one-dimensional span and then for an arbitrary subspace.
19Supplementary proof problem: least squares and normal equations
19.1Problem 14
For a real matrix and vector , prove that is a least-squares solution of if and only if the residual is orthogonal to , equivalently .
19.2Answer example
For any perturbation ,
The squared error is
If , then for every , so the error is at least . Conversely, if minimizes the error, the one-variable function has derivative 0 at for every , so . This is equivalent to .
19.3Explanation
The normal equation is the algebraic form of the geometric condition that the residual points perpendicular to the column space.