6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND...

21
6 6. 1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY

Transcript of 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND...

Page 1: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

6

6.1

© 2012 Pearson Education, Inc.

Orthogonality and Least Squares

INNER PRODUCT, LENGTH, AND ORTHOGONALITY

Page 2: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 2 © 2012 Pearson Education, Inc.

INNER PRODUCT

If u and v are vectors in , then we regard u and v as matrices.

The transpose uT is a matrix, and the matrix product uTv is a matrix, which we write as a single real number (a scalar) without brackets.

The number uTv is called the inner product of u and v, and it is written as .

The inner product is also referred to as a dot product.

n1n

1 n1 1

u v

Page 3: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 3 © 2012 Pearson Education, Inc.

INNER PRODUCT

If and ,

then the inner product of u and v is

.

1

2u=

n

u

u

u

1

2v

n

v

v

v

1

2

1 2 1 1 2 2n n n

n

v

vu u u u v u v u v

v

Page 4: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 4 © 2012 Pearson Education, Inc.

INNER PRODUCT

Theorem 1: Let u, v, and w be vectors in , and let c be a scalar. Then

a.

b.

c.

d. , and if and only if

Properties (b) and (c) can be combined several

times to produce the following useful rule:

n

u v v u (u v) w u w v w ( u) v (u v) u ( v)c c c u u 0 u u 0 u 0

1 1 1 1( u u ) w (u w) (u w)p p p pc c c c

Page 5: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 5 © 2012 Pearson Education, Inc.

THE LENGTH OF A VECTOR

If v is in , with entries v1, …, vn, then the square root of is defined because is nonnegative.

Definition: The length (or norm) of v is the nonnegative scalar defined by

and

Suppose v is in , say, .

nv v v v

v

2 2 2

1 2v v v nv v v 2

v v v

2 va

b

Page 6: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 6 © 2012 Pearson Education, Inc.

THE LENGTH OF A VECTOR If we identify v with a geometric point in the plane,

as usual, then coincides with the standard notion of the length of the line segment from the origin to v.

This follows from the Pythagorean Theorem applied to a triangle such as the one shown in the following figure.

For any scalar c, the length cv is times the length of v. That is,

v

c

v vc c

Page 7: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 7 © 2012 Pearson Education, Inc.

THE LENGTH OF A VECTOR

A vector whose length is 1 is called a unit vector.

If we divide a nonzero vector v by its length—that is, multiply by —we obtain a unit vector u because the length of u is .

The process of creating u from v is sometimes called normalizing v, and we say that u is in the same direction as v.

1/ v(1/ v ) v

Page 8: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 8 © 2012 Pearson Education, Inc.

THE LENGTH OF A VECTOR Example 1: Let . Find a unit vector u

in the same direction as v. Solution: First, compute the length of v:

Then, multiply v by to obtain

v (1, 2,2,0)

2 2 2 2 2v v v (1) ( 2) (2) (0) 9

v 9 3

1/ v1 1/ 3

2 2 / 31 1 1u v v

2 2 / 3v 3 3

0 0

Page 9: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 9 © 2012 Pearson Education, Inc.

DISTANCE IN

To check that , it suffices to show that .

Definition: For u and v in , the distance between u and v, written as dist (u, v), is the length of the vector

. That is,

u 12

u 1

2 2

22 1 2 2u u u 0

3 3 3

1 4 40 1

9 9 9

n

u v

n

dist (u,v) u v

Page 10: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 10 © 2012 Pearson Education, Inc.

DISTANCE IN

Example 2: Compute the distance between the vectors and .

Solution: Calculate

The vectors u, v, and are shown in the figure on the next slide.

When the vector is added to v, the result is u.

n

u (7,1) v (3,2)

2 2

7 3 4u v

1 2 1

u v 4 ( 1) 17

u v

u v

Page 11: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 11 © 2012 Pearson Education, Inc.

DISTANCE IN

Notice that the parallelogram in the above figure shows that the distance from u to v is the same as the distance from to 0.u v

n

Page 12: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 12 © 2012 Pearson Education, Inc.

ORTHOGONAL VECTORS Consider or and two lines through the origin

determined by vectors u and v. See the figure below. The two lines shown in the

figure are geometrically perpendicular if and only if the distance from u to v is the same as the distance from u to .

This is the same as requiring the squares of the distances to be the same.

2 3

v

Page 13: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 13 © 2012 Pearson Education, Inc.

ORTHOGONAL VECTORS Now

The same calculations with v and interchanged show that

2 2 2

2 2

dist(u, v) u ( v) u v

(u v) (u v)

= u (u v) v (u v)

= u u u v v u v v

= u v 2u v

Theorem 1(b)

Theorem 1(a), (b)

Theorem 1(a)

v

2 2 2

2 2

dist(u,v) u v 2u ( v)

= u v 2u v

Page 14: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 14 © 2012 Pearson Education, Inc.

ORTHOGONAL VECTORS

The two squared distances are equal if and only if , which happens if and only if .

This calculation shows that when vectors u and v are identified with geometric points, the corresponding lines through the points and the origin are perpendicular if and only if .

Definition: Two vectors u and v in are orthogonal (to each other) if .

The zero vector is orthogonal to every vector in because for all v.

2u v 2u v u v 0

u v 0

nu v 0

n0 v 0T

Page 15: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 15 © 2012 Pearson Education, Inc.

THE PYTHOGOREAN THEOREM

Theorem 2: Two vectors u and v are orthogonal if and only if .

Orthogonal Complements If a vector z is orthogonal to every vector in a

subspace W of , then z is said to be orthogonal to W.

The set of all vectors z that are orthogonal to W is called the orthogonal complement of W and is denoted by (and read as “W perpendicular” or simply “W perp”).

2 2 2u v u v

n

W

Page 16: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 16 © 2012 Pearson Education, Inc.

ORTHOGONAL COMPLEMENTS1. A vector x is in if and only if x is

orthogonal to every vector in a set that spans W.

2. is a subspace of .

Theorem 3: Let A be an matrix. The orthogonal complement of the row space of A is the null space of A, and the orthogonal complement of the column space of A is the null space of AT:

and

W

W n

m n

(Row ) Nul A A (Col ) Nul TA A

Page 17: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 17 © 2012 Pearson Education, Inc.

ORTHOGONAL COMPLEMENTS Proof: The row-column rule for computing Ax shows that if x

is in Nul A, then x is orthogonal to each row of A (with the rows treated as vectors in ).

Since the rows of A span the row space, x is orthogonal to Row A.

Conversely, if x is orthogonal to Row A, then x is certainly orthogonal to each row of A, and hence .

This proves the first statement of the theorem.

n

x 0A

Page 18: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 18 © 2012 Pearson Education, Inc.

ORTHOGONAL COMPLEMENTS

Since this statement is true for any matrix, it is true for AT.

That is, the orthogonal complement of the row space of AT is the null space of AT.

This proves the second statement, because

. Row Col TA A

Page 19: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 19 © 2012 Pearson Education, Inc.

ANGLES IN AND (OPTIONAL) If u and v are nonzero vectors in either or ,

then there is a nice connection between their inner product and the angle between the two line segments from the origin to the points identified with u and v.

The formula is ----(1)

To verify this formula for vectors in , consider the triangle shown in the figure on the next slide with sides of lengths, , , and .

2 32 3

u v u v cos

2

u v u v

Page 20: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 20 © 2012 Pearson Education, Inc.

ANGLES IN AND (OPTIONAL)

By the law of cosines,

which can be rearranged to produce the equations on the next slide.

2 3

2 2 2u v u v 2 u v cos

Page 21: 6 6.1 © 2012 Pearson Education, Inc. Orthogonality and Least Squares INNER PRODUCT, LENGTH, AND ORTHOGONALITY.

Slide 6.1- 21 © 2012 Pearson Education, Inc.

ANGLES IN AND (OPTIONAL)

The verification for is similar. When , formula (1) may be used to define the

angle between two vectors in . In statistics, the value of defined by (1) for

suitable vectors u and v is called a correlation coefficient.

2 32 2 2

2 2 2 2 2 2

1 2 1 2 1 1 2 2

1 1 2 2

1u v cos u v u v

21

( ) ( )2

u v

u u v v u v u v

u v u v

33n

ncos