markdown
Inner products, orthogonality, and projection - Basic Exercisesmd cdd36d5
exercise/math/linear-algebra/inner-products-orthogonality-and-projections.exercise.n.md

Inner products, orthogonality, and projection - Basic Exercises

date2026-07-14document_iddoc_e7e37224d1d66361b4d851136c6b9a5fdescription内積、ノルム、直交、Gram-Schmidt の直交化、射影、最小二乗法を確認する基本演習である。prerequisitesノルムと三角不等式 / 内積空間の基本 / 直交化の基本 / 直交補空間と射影 / 最小二乗法の基本type問題演習content_typeexercisestatusactiverelateddata/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.md
mathlinear-algebraexerciseinner-productprojectionleast-squares

These exercises use the inner product内積ないせき to measure length and angle, and they check orthogonalization, projection, and least squares both computationally and conceptually.

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

1Exercise plan

An inner product内積ないせき adds lengths and angles to a vector space. A projection射影しゃえい drops an unreachable point to the closest point inside a subspace部分空間ぶぶんくうかん. Before computing, check orthogonality and whether a vector used in a denominator is nonzero.


In these exercises, compute the inner product内積ないせき before drawing geometric conclusions. Orthogonality means the inner product is zero, the norm comes from ||x||2=<x,x>, and projection coefficients come from dividing by the squared norm of the direction vector.

For projection and least-squares problems, the residual is the diagnostic. If p is the projection of x onto a subspace, then x-p must be orthogonal to every vector in that subspace. For a least-squares solution of Axb, this becomes AT(b-Ax)=0, equivalently the normal equations ATAx=ATb.

2Problem 1

For u=(1,2)T and v=(3,-1)T, find u,v, u, and v, and decide whether u and v are orthogonal直交ちょっこう.

2.1Answer example

u,v=1·3+2(-1)=1,

and

u=5,v=10.

Since u,v0, they are not orthogonal.

2.2Explanation

Orthogonality is judged by the inner product, not by the visual appearance of components.


3Problem 2

For a=(1,0)T and b=(2,0)T, confirm a+b=a+b and explain equality.

3.1Answer example

a+b=(3,0)T=3,

while a=1 and b=2. Equality holds because the vectors point in the same direction.

3.2Explanation

This is the equality case of the triangle inequality三角不等式さんかくふとうしき.


4Problem 3

Apply Gram-Schmidt orthogonalization直交化ちょっこうか to

x1=(1,1,0)T,x2=(1,0,1)T.

4.1Answer example

Let u1=x1=(1,1,0)T. Then

u2=x2-x2,u1u1,u1u1=(101)-12(110)=(12-121).

4.2Explanation

Because u1,u1=20, division is allowed. Orthogonalization subtracts the component in the u1 direction.


5Problem 4

For y=(2,1)T and u=(1,1)T, find the orthogonal projection of y onto span(u).

5.1Answer example

projuy=y,uu,uu=32(11)=(3232).

5.2Explanation

The formula cannot be used for u=0 because the denominator would be 0.


6Problem 5

For A=(1,1)T and b=(2,0)T, find the least-squares solution最小二乗解さいしょうにじょうかい of Ax=b and explain the projection relation.

6.1Answer example

The normal equation正規方程式せいきほうていしき is ATAx=ATb. Since ATA=2 and ATb=2, x=1. The approximating vector is

Ax=(1,1)T.

6.2Explanation

The vector b is not in Col(A), so the least-squares method chooses the closest point in the column space.


7Problem 6

In R2, define

x1=|x1|+|x2|,x=max{|x1|,|x2|}.

Check that they are norms.

7.1Answer example

Both are nonnegative and vanish only at 0. For a scalar c,

cx1=|c|x1,cx=|c|x.

Also,

x+y1[PARSE ERROR: Undefined("Command(\"le\")")]x1+y1

by the scalar triangle inequality, and for i=1,2,

|xi+yi|[PARSE ERROR: Undefined("Command(\"le\")")]x+y,

so x+y[PARSE ERROR: Undefined("Command(\"le\")")]x+y.

7.2Explanation

A norm is any length function satisfying nonnegativity, homogeneity同次性どうじせい, and the triangle inequality.


8Problem 7

For u=(1,2)T, v=(2,4)T, and w=(1,-1)T, decide when equality holds in Cauchy-Schwarz for (u,v) and (u,w).

8.1Answer example

Since v=2u, equality holds for (u,v). Since w is not a scalar multiple of u, equality does not hold for (u,w).

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 v=2u, so equality holds for (u,v); w is not a scalar multiple of u, so equality fails for (u,w).


9Problem 8

Let

U=span{(1,1,0)T,(1,0,1)T}.

Find the projection of y=(1,2,3)T onto U and a basis of U.

9.1Answer example

Let u1=(1,1,0)T, u2=(1,0,1)T, and p=au1+bu2. The condition y-pu1,u2 gives

2a+b=3,a+2b=4.

Thus a=23 and b=53, so

p=(732353).

A vector orthogonal to both generators is n=(1,-1,-1)T, so {n} is a basis of U.

9.2Explanation

Projection onto a subspace is found by making the residual orthogonal to every direction in the subspace.


10Problem 9

For

A=(101112),b=(122),

solve the normal equations and check residual orthogonality.

10.1Answer example

ATA=(3335),ATb=(56).

Solving gives α=76 and β=12. The least-squares solution is (7/6,1/2)T. The residual is

r=(-1613-16),

and ATr=0.

10.2Explanation

The residual is orthogonal to the column space exactly when the approximating point is closest.


11Problem 10

For M=(2001), define x,yM=xTMy. Confirm this is an inner product.

11.1Answer example

The matrix M is symmetric, and

x,xM=2x12+x22,

which is positive for x0. 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 xTNy with N=(100-1) is not an inner product.

12.1Answer example

For e2=(0,1)T,

e2TNe2=-1,

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 complex inner products複素内積ふくそないせき and unitary matricesユニタリ行列ぎょうれつ. The only fact needed here is this: because of conjugate symmetry共役対称性きょうやくたいしょうせい, a complex inner product must make z,z a nonnegative real number.

data/exercise/math/linear-algebra/complex-inner-products-and-unitary-matrices.exercise.n.md

14Problem 12

On C, explain why (z,w)=zw is not a complex inner product複素内積ふくそないせき.

14.1Answer example

Taking z=i gives (i,i)=i2=-1. A complex inner product must have z,z[PARSE ERROR: Undefined("Command(\"ge\")")]0 real.

14.2Explanation

Complex inner products need conjugation and conjugate symmetry to make squared lengths nonnegative real numbers.


15Problem 13

For u=(1,0)T, v=(0,1)T, and w=(2,0)T, confirm strict and equality cases of the triangle inequality.

15.1Answer example

u+v=2<2=u+v,

while

u+w=3=u+w.

The first pair points in different directions; the second pair lies on the same positive ray.

This is a boundary case for the triangle inequality三角不等式さんかくふとうしき. Except for zero-vector cases, equality appears when the two vectors are positive scalar multiples of each other. If the directions differ, the broken-line length is longer than the direct distance.


18Proof exercise: Cauchy-Schwarz and projection minimality

18.1Problem

In this proof exercise, work in a real inner product space実内積空間じつないせきくうかん. The complex case requires tracking conjugates and is treated in the later complex inner product exercises.

For an inner product space and a nonzero vector u, prove Cauchy-Schwarz and explain why the projection of y onto span(u) minimizes distance to y. Also prove the general subspace statement: if pU and v-pU, then p is the point of U closest to v.

18.2Answer

For u0, consider

0[PARSE ERROR: Undefined("Command(\"le\")")]x-tu2=x2-2tx,u+t2u2

and choose t=x,u/u,u. This gives

|x,u|2[PARSE ERROR: Undefined("Command(\"le\")")]x2u2.

For projection, write

p=y,uu,uu.

Then y-pu. For any cuspan(u),

y-cu=(y-p)+(p-cu),

and the two summands are orthogonal, so

y-cu2=y-p2+p-cu2[PARSE ERROR: Undefined("Command(\"ge\")")]y-p2.

More generally, let pU and assume v-pU. For any qU,

v-q=(v-p)+(p-q).

Since p-qU, the two summands are orthogonal. Hence

v-q2=v-p2+p-q2[PARSE ERROR: Undefined("Command(\"ge\")")]v-p2.

Therefore p is the closest point in U to v.

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 A and vector b, prove that x is a least-squares solution of Axb if and only if the residual r=b-Ax is orthogonal to Col(A), equivalently ATr=0.

19.2Answer example

For any perturbation h,

b-A(x+h)=r-Ah.

The squared error is

r-Ah2=r2-2r,Ah+Ah2.

If rCol(A), then r,Ah=0 for every h, so the error is at least r2. Conversely, if x minimizes the error, the one-variable function r-tAh2 has derivative 0 at t=0 for every h, so r,Ah=0. This is equivalent to ATr=0.

19.3Explanation

The normal equation is the algebraic form of the geometric condition that the residual points perpendicular to the column space.


raw .n.md をコピー
loc をコピー (filepath:line ~ line)
copy share link
copy encoded share link
path をコピー
copy share link
copy encoded share link
copy share link
copy encoded share link
タブを全て閉じる