Professional Documents
Culture Documents
√
square-root function of g (i.e., a = k g, for some
Height h Gender g constant k). Is your answer in part (b) reasonably
(in Inches above (1 = “Female,” Weight w close to this form?
5 Feet) 0 = “Male”) (in Pounds)
40. Consider the data in the following table.
2 1 110
12 0 180
5 1 120 a D
11 1 160 Mean Distance from Period of
6 0 160 the Sun (in Revolution
Planet Astronomical Units) (in Earth Years)
Orthogonality and Least Squares
Properties (b) and (c) express the fact that T ( f ) = h f, gi is a linear transfor-
mation from V to R, for a fixed g in V .
Roughly speaking, an inner product space behaves like Rn as far as addition,
scalar multiplication, and the dot product are concerned.
EXAMPLE 1 Consider the linear space C[a, b] consisting of all continuous functions whose do-
main is the closed interval [a, b], where a < b. See Figure 1.
a b
Figure 1
Z b
h f, gi = f (t)g(t) dt.
a
The verification of the first three axioms for an inner product is straightforward. For
example,
Z b Z b
h f, gi = f (t)g(t) dt = g(t) f (t) dt = hg, f i.
a a
The verification of the last axiom requiresR b a bit of calculus. We leave it as Exercise 1.
Recall
Pm that the Riemann integral a f (t)g(t) dt is the limit of the Riemann
sum i=1 f (tk )g(tk )1t, where the tk can be chosen as equally spaced points on
the interval [a, b]. See Figure 2.
Orthogonality and Least Squares
f (t)
g (t)
t0 = a t1 t2 … tm = b
Figure 2
Then
f (t1 ) g(t1 )
m f (t2 )
g(t2 )
Z b X
h f, gi = f (t)g(t) dt ≈ f (tk )g(tk )1t = · . 1t
..
. ..
a k=1
f (tm ) g(tm )
for large m. Rb
This approximation shows that the inner product h f, gi = a f (t)g(t) dt for
functions is a continuous version of the dot product: The more subdivisions you
choose, the better the dot product on the right will approximate the inner product
h f, gi. J
EXAMPLE 2 Let ℓ2 be the space of all “square-summable” infinite sequences, that is, sequences
xE = (x0 , x1 , x2 , . . . , xn , . . .)
P∞ 2
such that i=0 x i = x02 + x12 + · · · converges. In this space we can define the inner
product
∞
X
hEx , Ey i = xi yi = x0 y0 + x1 y1 + · · · .
i=0
(Show that this series converges.) The verification of the axioms is straightforward.
J
EXAMPLE 3 The trace of a square matrix is the sum of its diagonal entries. For example,
1 2
trace = 1 + 4 = 5.
3 4
In Rn×m , the space of all n × m matrices, we can define the inner product
hA, Bi = trace(A T B).
We will verify the first and fourth axioms.
hA, Bi = trace(A T B) = trace (A T B)T = trace(B T A) = hB, Ai
To check that hA, Ai > 0 for nonzero A, write A in terms of its columns:
| | |
A = vE1 vE2 . . . vEm .
| | |
Orthogonality and Least Squares
Now we have
− vE1T −
− vE T − | | |
T 2
hA, Ai = trace(A A) = trace vE1 vE2 . . . vEm
..
.
| | |
T
− vEm −
kEv1 k2
... ...
. . . kEv2 k2 . . .
= trace .
.. .. ..
.. . . .
. . . kEvm k2
If A is nonzero, then at least one of the column vectors vEi is nonzero, so that
the sum kEv1 k2 + kEv2 k2 + · · · + kEvm k2 is positive, as desired. J
We can introduce the basic concepts of geometry for an inner product space
exactly as we did in Rn for the dot product.
We can define the distance between two elements of an inner product space as
the norm of their difference:
dist( f, g) = k f − gk.
Consider a function f in the space C[a, b], with the inner product defined in
Example 1. In physics, the quantity k f k2 can often be interpreted as energy. For
example, it describes the acoustic energy of a periodic sound wave f (t) and the
elastic potential energy of a uniform string with vertical displacement f (x). See
Figure 3. The quantity k f k2 may also measure thermal or electric energy.
Displacement f (x)
Vertical
displacement at x A string attached
at (a, 0) and (b, 0)
x
a x b
Figure 3
Orthogonality and Least Squares
R1
EXAMPLE 4 In the inner product space C[0, 1] with h f, gi = 0 f (t)g(t) dt, find k f k for
f (t) = t 2 .
Solution
s r
Z 1
p 1
kfk = h f, f i = t 4 dt =
0 5 J
EXAMPLE 5 Show that f (t) = sin(t) andRg(t) = cos(t) are orthogonal in the inner product
2π
space C[0, 2π] with h f, gi = 0 f (t)g(t) dt.
Solution
Z 2π 2π
1 2
h f, gi = sin(t) cos(t) dt = sin (t) = 0 J
0 2 0
EXAMPLE 6 Find the distance between f (t) = t and g(t) = 1 in C[0, 1].
Solution
s s 1
Z 1
1 1
disth f, gi = (t − 1)2 dt = (t − 1) = √
3
0 3 0 3 J
The results and procedures discussed for the dot product generalize to arbitrary
inner product spaces. For example, the Pythagorean theorem holds; the Gram–
Schmidt process can be used to construct an orthonormal basis of a (finite di-
mensional) inner product space; and the Cauchy–Schwarz inequality tells us that
|h f, gi| ≤ k f k kgk, for two elements f and g of an inner product space.
Orthogonal Projections
In an inner product space V , consider a finite dimensional subspace W with or-
thonormal basis g1 , . . . , gm . The orthogonal projection projW f of an element f of
V onto W is defined as the unique element of W such that f −projW f is orthogonal
to W . As in the case of the dot product in Rn , the orthogonal projection is given by
the following formula.
Orthogonality and Least Squares
s
Z b 2
dist( f, g) = k f − gk = f (t) − g(t) dt
a
is least.
The requirement that
Z b 2
f (t) − g(t) dt
a
(am, bm)
f (t)
(ak, bk)
(a1, b1)
bk − g(ak) f (t) − g(t)
g(t)
g(t)
ak a t b
Figure 4 (a) Discrete least-squares condition: (b) Continuous least-squares condition:
Pm 2 Rb 2
k=1 ( bk − g(ak ) ) is minimal. a ( f (t ) − g(t ) ) dt is minimal.
EXAMPLE 7 Find the linear function of the form g(t) = a + bt that best fits the function
f (t) = et over the interval from −1 to 1, in a continuous least-squares sense.
Solution
We need to find proj P1 f . We first find an orthonormal basis of P1 for the given
inner product; then we will use Theorem 5.3. In general, we have to use the Gram–
Schmidt process to find an orthonormal basis of an inner product space. Because
the two functions 1, t in the standard basis of P1 are orthogonal already, or
Z 1
h1, ti = t dt = 0,
−1
Orthogonality and Least Squares
f (t) = et
proj P1 f
−1 1
Figure 5
Fourier Analysis7
In the space C[−π, π], we introduce an inner product that is a slight modification
of the definition given in Example 1:
1 π
Z
h f, gi = f (t)g(t) dt.
π −π
The factor 1/π is introduced to facilitate the computations. Convince yourself that
this is indeed an inner product. Compare with Exercise 7.
More generally, we can consider this inner product in the space of all piece-
wise continuous functions defined in the interval [−π, π]. These are functions f (t)
that are continuous except for a finite number of jump-discontinuities [i.e., points
c where the one-sided limits lim− f (t) and lim+ f (t) both exist, but are not equal].
t→c t→c
Also, it is required that f (c) equal one of the two one-sided limits. Let us consider
the piecewise continuous functions with f (c) = lim− f (t). See Figure 6.
t→c
For a positive integer n, consider the subspace Tn of C[−π, π] that is defined
as the span of the functions 1, sin(t), cos(t), sin(2t), cos(2t), . . . , sin(nt), cos(nt).
The space Tn consists of all functions of the form
7
Named after the French mathematician Jean-Baptiste-Joseph Fourier (1768–1830), who developed
the subject in his Théorie analytique de la chaleur (1822), where he investigated the conduction of
heat in very thin sheets of metal. Baron Fourier was also an Egyptologist and government
administrator; he accompanied Napoléon on his expedition to Egypt in 1798.
Orthogonality and Least Squares
f (t)
t
c
Orthogonality and Least Squares
Orthogonality and Least Squares
Ak Piano The fundamental frequency (corresponding to the vibration shown at the bottom
of Figure 7) gives us the first harmonic of f (t), while the overtones (with frequen-
cies that are integer multiples of the fundamental frequency) give us the other terms
k of the harmonic series. The quality of a tone is in part determined by the relative
1 2 3 4 5 6
amplitudes of the harmonics. When you play concert A (440 Hertz) on a piano,
the first harmonic is much more prominent than the higher ones, but the same tone
Ak Violin played on a violin gives prominence to higher harmonics (especially the fifth). See
Figure 8. Similar considerations apply to wind instruments; they have a vibrating
column of air instead of a vibrating string.
k The human ear cannot hear tones whose frequencies exceed 20,000 Hertz. We
1 2 3 4 5 6
pick up only finitely many harmonics of a tone. What we hear is the projection of
Figure 8 f (t) onto a certain Tn .
EXAMPLE 8 Find the Fourier coefficients for the function f (t) = t on the interval −π ≤ t ≤ π:
1 π
Z
bk = h f, sin(kt)i = sin(kt)t dt
π −π
π
1 π
Z
1 1
= − cos(kt)t +
cos(kt) dt (integration by parts)
π k −π k −π
2
− if k is even
k
=
2 if k is odd
k
2
= (−1)k+1 .
k
All ck and a0 are zero, since the integrands are odd functions.
The first few Fourier polynomials are
f 1 = 2 sin(t),
f 2 = 2 sin(t) − sin(2t),
2
f 3 = 2 sin(t) − sin(2t) + sin(3t),
3
2 1
f 4 = 2 sin(t) − sin(2t) + sin(3t) − sin(4t).
3 2
See Figure 9. J
f4
f2
Figure 9
Orthogonality and Least Squares
How do the errors k f − f n k and k f − f n+1 k of the nth and the (n + 1)st Fourier
approximation compare? We hope that f n+1 will be a better approximation than f n ,
or at least no worse:
k f − f n+1 k ≤ k f − f n k.
This is indeed the case, by definition: f n is a polynomial in Tn+1 , since Tn is con-
tained in Tn+1 , and
k f − f n+1 k ≤ k f − gk,
for all g in Tn+1 , in particular for g = f n . In other words, as n goes to infinity, the
error k f − f n k becomes smaller and smaller (or at least not larger). Using somewhat
advanced calculus, we can show that this error approaches zero:
lim k f − f n k = 0.
n→∞
Combining the last two “shaded” equations, we get the following identity:
Orthogonality and Least Squares
EXERCISES 5
GOAL Use the idea of an inner product, and apply the and
basic results derived earlier for the dot product in Rn to
inner product spaces. hhA, Bii = trace(AB T ).
1. In C[a, b], define the product See Example 3 and Exercises 4 and 5.
Z b 7. Consider an inner product hv, wi in a space V , and a
h f, gi = f (t)g(t) dt. scalar k. For which choices of k is
a
hhv, wii = khv, wi
Show that this product satisfies the property
an inner product?
h f, f i > 0
8. Consider an inner product hv, wi in a space V . Let w
for all nonzero f . be a fixed element of V . Is the transformation T (v) =
2. Does the equation hv, wi from V to R linear? What is its image? Give a
geometric interpretation of its kernel.
h f, g + hi = h f, gi + h f, hi
9. Recall that a function f (t) from R to R is called
hold for all elements f , g, h of an inner product space?
Explain. even if f (−t) = f (t), for all t,
5. Is hhA, Bii = trace(AB T ) an inner product in Rn×m ? 11. The angle between two nonzero elements v and w of an
(The notation hhA, Bii is chosen to distinguish this prod- inner product space is defined as
uct from the one considered in Example 3 and Exer- hv, wi
cise 4.) ∡(v, w) = arccos .
kvkkwk
6. a. Consider an n × m matrix P and an m × n matrix In the space C[−π, π] with inner product
Q. Show that
1 π
Z
h f, gi = f (t)g(t) dt,
trace(P Q) = trace(Q P). π −π
b. Compare the following two inner products in Rn×m : find the angle between f (t) = cos(t) and g(t) =
cos(t + δ), where 0 ≤ δ ≤ π. Hint: Use the formula
hA, Bi = trace(A T B), cos(t + δ) = cos(t) cos(δ) − sin(t) sin(δ).
Orthogonality and Least Squares
12. Find all Fourier coefficients of the absolute value func- 20. Consider the inner product
tion
T 1 2
f (t) = |t|. hEv , wi
E = vE E
w
2 8
13. For a function f in C[−π, π], consider the sequence of in R2 . See Exercise 19.
all its Fourier coefficients,
1
a. Find all vectors in R2
that are perpendicular to
(a0 , b1 , c1 , b2 , c2 , . . . , bn , cn , . . .). 0
with respect to this inner product.
Is this infinite sequence in ℓ2 ? If so, what is the rela- b. Find an orthonormal basis of R2 with respect to this
tionship between inner product.
k f k (the norm in C[−π, π]) 21. If kEv k denotes the standard norm in Rn , does the for-
and mula
k(a0 , b1 , c1 , b2 , c2 , . . .)k (the norm in ℓ2 )? hEv , wi E 2 − kEv k2 − kwk
E = kEv + wk E 2
The inner product space ℓ2 was introduced in
define an inner product in Rn ?
Example 2.
22. If f (t) is a continuous function, what is the relationship
14. Which of the following is an inner product in P2 ?
between
Explain.
!Z "2
a. h f, gi = f (1)g(1) + f (2)g(2) Z 1
2 1
b. hh f, gii = f (1)g(1) + f (2)g(2) + f (3)g(3) f (t) dt and f (t) dt ?
0 0
15. For which values of the constants b, c, and d is the fol-
lowing an inner product in R2 ? Hint: Use the Cauchy–Schwarz inequality.
23. In the space P1 of the polynomials of degree ≤1, we
x1 y
, 1 = x1 y1 + bx1 y2 + cx2 y1 + d x2 y2 define the inner product
x2 y2
1
Hint: Be prepared to complete a square. h f, gi = f (0)g(0) + f (1)g(1) .
2
16. a. Find an orthonormal basis of the space P1 with in- Find an orthonormal basis for this inner product space.
ner product
Z 1 24. Consider the linear space P of all polynomials, with in-
h f, gi = f (t)g(t) dt. ner product
0 Z 1
b. Find the linear polynomial g(t) = a + bt that best h f, gi = f (t)g(t) dt.
0
approximates the function f (t) = t 2 on the interval
[0, 1] in the (continuous) least-squares sense. Draw For three polynomials f , g, and h we are given the fol-
a sketch. lowing inner products:
17. Consider a linear space V . For which linear transforma-
tions T from V to Rn is
h·i f g h
hv, wi = T (v) · T (w)
↑ f 4 0 8
Dot product
g 0 1 3
an inner product in V ? h 8 3 50
Orthogonality and Least Squares
25. Find the norm kEx k of You are not asked to prove the foregoing assertions
1 1 1
for arbitrary n, but work out the case n = 2: Find a1 , a2
xE = 1, , , . . . , , . . . in ℓ2 . and w1 , w2 , and show that the formula
2 3 n Z 1
(ℓ2 is defined in Example 2.) f (t) dt = w1 f (a1 ) + w2 f (a2 )
−1
26. Find the Fourier coefficients of the piecewise continu- holds for all cubic polynomials.
ous function
( 32. In the spaceZ C[−1, 1], we introduce the inner product
−1 if t ≤ 0 1 1
f (t) = h f, gi = f (t)g(t)dt.
1 if t > 0. 2 −1
a. Find ht n , t m i, where n and m are positive integers.
Sketch the graphs of the first few Fourier polynomials.
b. Find the norm of f (t) = t n , where n is a positive
27. Find the Fourier coefficients of the piecewise continu- integer.
ous function c. Applying the Gram–Schmidt process to the standard
basis 1, t, t 2 , t 3 of P3 , construct an orthonormal
(
0 if t ≤ 0
f (t) = basis g0 (t), . . . , g3 (t) of P3 for the given inner
1 if t > 0. product.
28. Apply Theorem 5.6 to your answer in Exercise 26. g0 (t) g3 (t)
d. Find the polynomials ,..., . (Those are
g0 (1) g3 (1)
29. Apply Theorem 5.6 to your answer in Exercise 27. the first few Legendre polynomials, named after the
30. Consider an ellipse E in R2 centered at the origin. Show great French mathematician Adrien-Marie Legen-
that there is an inner product h·, ·i in R2 such that E dre, 1752–1833. These polynomials have a wide
consists of all vectors xE with kEx k = 1, where the norm range of applications in math, physics, and engineer-
is taken with respect to the inner product h·, ·i. ing. Note that the Legendre polynomials are normal-
ized so that their value at 1 is 1.)
31. Gaussian integration. In an introductory calculus e. Find the polynomial g(t) in P3 that best approx-
course, you may have seen approximation formulas for 1
integrals of the form imates the function f (t) = on the inter-
1 + t2
val [−1, 1], for the inner product introduced in this
Z b n
X exercise. Draw a sketch.
f (t) dt ≈ wi f (ai ),
a i=i 33. a. Let w(t) be a positive-valued function in C[a, b],
where b > a. Verify that the rule h f, gi =
where the ai are equally spaced points on the inter- Rb
val (a, b), and the wi are certain “weights” (Riemann a w(t) f (t)g(t)dt defines an inner product on
sums, trapezoidal sums, and Simpson’s rule). Gauss has C[a, b].
shown that, with the same computational effort, we can b. If
R b we chose the weight function w(t) so that
get better approximations if we drop the requirement a w(t)dt = 1, what is the norm of the constant
that the ai be equally spaced. Next, we outline his ap- function f (t) = 1 in this inner product space?
proach.
34. In the space C[−1, R 11], 2 p
we define the inner
Consider the space Pn with the inner product
productp h f, gi = −1 π 1 − t 2 f (t)g(t) dt =
Z 1 2
R 1
π −1 1 − t 2pf (t)g(t) dt. See Exercise 33; here we
h f, gi = f (t)g(t) dt. 2
−1 let w(t) = π 1 − t 2 . [This function w(t) is called
a Wigner semicircle distribution, after the Hungarian
Let f 0 , f 1 , . . . , f n be an orthonormal basis of this physicist and mathematician E. P. Wigner (1902–1995),
space, with degree( f k ) = k. (To construct such a ba- who won the 1963 Nobel Prize in Physics.] Since this
sis, apply the Gram–Schmidt process to the standard is not a course in calculus, here are some inner prod-
basis 1, t, . . . , t n .) It can be shown that f n has n distinct ucts that will turn out to be useful: h1, t 2 i = 1/4,
roots a1 , a2 , . . . , an on the interval (−1, 1). We can find ht, t 3 i = 1/8, and ht 3 , t 3 i = 5/64.
“weights” w1 , w2 , . . . , wn such that R1
a. Find −1 w(t)dt. Sketch a rough graph of the weight
Z 1 n
X function w(t).
f (t) dt = wi f (ai ), b. Find the norm of the constant function f (t) = 1.
−1 i=1
c. Find ht 2 , t 3 i; explain. More generally, find ht n , t m i
for all polynomials of degree less than n. In fact, much for positive integers n and m whose sum is odd.
more is true: This formula holds for all polynomials d. Find ht, ti and ht 2 , t 2 i. Also, find the norms of the
f (t) of degree less than 2n. functions t and t 2 .
Orthogonality and Least Squares
e. Applying the Gram–Schmidt process to the stan- 35. In this exercise, we compare the inner products and
dard basis 1, t, t 2 , t 3 of P3 , construct an orthonor- norms introduced in Problems 32 and 34. Let’s denote
mal basis g0 (t), . . . , g3 (t) of P3 for the given inner the two norms by k f k32 and k f k34 , respectively.
product. [The polynomials g0 (t), . . . , g3 (t) are the a. Compute ktk32 and ktk34 . Which is larger? Explain
first few Chebyshev polynomials of the second kind, the answer conceptually. Graph the p weight func-
named after the Russian mathematician Pafnuty tions w32 (t) = 21 and w34 (t) = π2 1 − t 2 on the
Chebyshev (1821–1894). They have a wide range of same axes. Then graph the functions w32 (t)t 2 and
applications in math, physics, and engineering.] w34 (t)t 2 on the same axes.
f. Find the polynomial g(t) in P3 that best approxi- b. Give an example of a continuous function f (t) such
mates the function f (t) = t 4 on the interval [−1, 1], that k f k34 > k f k32 .
for the inner product introduced in this exercise.
Exercises
TRUE OR FALSE?
1. If T is a linear transformation from Rn to Rn such 17. If A and B are symmetric n × n matrices, then AB B A
that T (Ee1 ), T (Ee2 ), . . . , T (Een ) are all unit vectors, then must be symmetric as well.
T must be an orthogonal transformation.
18. If matrices A and B commute, then matrices A T and
2. If A is an invertible matrix, then the equation (A T )−1 = B T must commute as well.
(A−1 )T must hold.
19. There exists a subspace V of R5 such that dim(V ) =
3. If matrix A is orthogonal, then matrix A2 must be or- dim(V ⊥ ), where V ⊥ denotes the orthogonal comple-
thogonal as well. ment of V .
4. The equation (AB)T = A T B T holds for all n × n ma- 20. Every invertible matrix A can be expressed as the prod-
trices A and B. uct of an orthogonal matrix and an upper triangular
matrix.
5. If A and B are symmetric n × n matrices, then A + B
must be symmetric as well. 21. The determinant of all orthogonal 2 × 2 matrices is 1.
1
6. If matrices A and S are orthogonal, then S −1 AS is or- 22. If A is any square matrix, then matrix 2 (A − A T ) is
thogonal as well. skew-symmetric.
7. All nonzero symmetric matrices are invertible. 23. The entries of an orthogonal matrix are all less than or
equal to 1.
8. If A is an n × n matrix such that A A T = In , then A
must be an orthogonal matrix. 24. Every nonzero subspace of Rn has an orthonormal
basis.
9. If uE is a unit vector in Rn , and L = span(E u ), then
3 −4
proj L (Ex ) = (Ex · uE )Ex for all vectors xE in Rn . 25. is an orthogonal matrix.
4 3
10. If A is a symmetric matrix, then 7A must be symmetric
as well. 26. If V is a subspace of Rn and xE is a vector in Rn , then
vector projV xE must be orthogonal to vector xE − projV xE .
11. If xE and Ey are two vectors in Rn , then the equation
27. If A and B are orthogonal 2 × 2 matrices, then AB =
kEx + Ey k2 = kEx k2 + kEy k2 must hold.
B A.
12. The equation det(A T ) = det(A) holds for all 2 × 2 ma-
28. If A is a symmetric matrix, vector vE is in the image of A,
trices A.
and wE is in the kernel of A, then the equation vE · w
E =0
13. If matrix A is orthogonal, then A T must be orthogonal must hold.
as well.
29. The formula ker(A) = ker(A T A) holds for all matri-
14. If A and B are symmetric n × n matrices, then AB must ces A.
be symmetric as well.
30. If A T A = A A T for an n × n matrix A, then A must be
15. If matrices A and B commute, then A must commute orthogonal.
with B T as well.
31. There exist orthogonal 2×2 matrices A and B such that
E then the matrix
16. If A is any matrix with ker(A) = {0}, A + B is orthogonal as well.
A A T represents the orthogonal projection onto the im- 32. If kAEx k ≤ kEx k for all xE in Rn , then A must represent
age of A. the orthogonal projection onto a subspace V of Rn .