inner1

Upload: cody-sage

Post on 04-Apr-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 inner1

    1/3

    Norm and inner products in Rn

    Math 130 Linear AlgebraD Joyce, Fall 2012

    So far weve concentrated on the operations ofaddition and scalar multiplication in Rn and, moregenerally, in abstract vector spaces.

    There are two other algebraic operations on Rn

    we mentioned early in the course, and now its timeto look at them in more detail.

    One of them is the length of a vector, more com-

    monly called the norm of a vector. The other is akind of multiplication of two vectors called the in-ner productor dot productof two vectors. Theres aconnection between norms and inner products, andwell look at that connection.

    Today well restrict our discussion of these con-cepts to Rn, but later well abstract these conceptsto define inner product spaces in general.

    The norm, or length, v of a vector v. Con-sider a vector v = (v1, v2) in the plane R

    2. By the

    Pythagorean theorem of plane geometry, the dis-tance (v1, v2) between the point (v1, v2) and theorigin (0, 0) is

    (v1, v2) =

    v21

    + v22.

    Thus, we define the length or norm of a vector v =(v1, v2) as being

    v = (v1, v2) =

    v21

    + v22.

    The norm of a vector is sometimes denoted |v|rather than v.

    Norms are defined for Rn as well

    v = (v1, v2, . . . , vn)

    =

    v21

    + v22

    + + v2n

    =

    nk=1

    v2k.

    In many ways, norms act like absolute values.For instance, the norm of any vector is nonnegative,and the only vector with norm 0 is the 0 vector.Like absolute values, norms are multiplicative in

    the sense thatcv = |c| v

    when c is a real number and v is a real vector.Theres also a triangle inequality for norms

    v w v + w.

    You can prove it geometrically in low dimensions,but well prove it algebraically in higher dimen-sions.

    The inner product v|w of two vectors.These are also commonly called dot products anddenoted with the alternate notation v w.

    Well start by defining inner products alge-braically, then see what they mean geometrically.

    The inner product v|w of two vectors v and win Rn is the sum of the products of correspondingcoordinates, that is,

    v

    |w

    = (v1, v2, . . . , vn

    )|(w1, w2, . . . , wn

    )= v1w1 + v2w2 + vnwn =

    nk=1

    vkwk

    Notice right away that we can interpret thesquare of the length of the vector as an inner prod-uct. Since

    v2 = v21

    + v22

    + + v2n,

    therefore

    v2

    = v|v.Because of this connection between norm and innerproduct, we can often reduce computations involv-ing length to simpler computations involving innerproducts.

    The inner product acts like multiplication in alot of ways, but not in all ways. First of all, the in-ner product of two vectors is a scalar, not another

    1

  • 7/29/2019 inner1

    2/3

    vector. That means you cant even ask if its as-sociative because the expression u|v|w doesnteven make sense; u|v is a scalar, so you cant takeits inner product with the vector w.

    But aside from associativity, inner products acta lot like ordinary products. For instance, innerproducts are commutative:

    u|v = v|u.

    Also, inner products distribute over addition,

    u|v + w = u|v + u|w,

    and over subtraction,

    u|v w = u|v u|w,

    and the inner product of any vector and the 0 vec-tor is 0

    v|0 = 0.

    Furthermore, inner products and scalar productshave a kind of associativity, namely, ifc is a scalar,then

    cu|v = cu|v = u|cv.

    These last few statements can be summarized bysaying that inner products are linear in each coor-dinate, or that inner products are bilinear opera-tions.

    The inner product of two vectors and the

    cosine of the angle between them. For thisdiscussion, well restrict our attention to dimension2 since we know a lot of plane geometry.

    The law of cosines for oblique triangles says thatgiven a triangle with sides a, b, and c, and angle between sides a and b,

    a

    b

    rrrrrrrr

    c

    c2 = a2 + b2 2ab cos .

    Now, start with two vectors v and w, and placethem in the plane with their tails at the same point.Let be the angle between these two vectors. The

    vector that joins the head of v to the head of w isw v. Now we can use the law of cosines to seethat

    !

    v

    I

    w

    rrrrrrrrj

    w v

    w v2 = v2 + w2 2v w cos .

    We can convert the distances to inner products tosimplify this equation.

    w v2 = w v|w v

    = w|w 2w|v + v|v

    = w2 2w|v + v2

    Now, if we subtract v2 + w2 from both sidesof our equation, and then divide by 2, we get

    v|w = v w cos .

    That gives us a way of geometrically interpretingthe inner product. We can also solve the last equa-tion for cos ,

    cos = v|w

    v w,

    which will allow us to do trigonometry by means oflinear algebra. Note that

    = arccos

    v|w

    v w

    .

    2

  • 7/29/2019 inner1

    3/3

    Orthogonal vectors. The word orthogonal issynonymous with the word perpendicular, but forsome reason is preferred in many branches of math-ematics. Well write w v if the vectors w and vare orthogonal, or perpendicular.

    fffffffw

    v

    I

    w

    Two vectors are orthogonal if the angle between

    them is 90. Since the cosine of 90 is 0, that means

    w v if and only if w|v = 0

    Vectors in Matlab. You can easily find thelength of a vector in Matlab; where the lengthof a vector is called its norm. Lets find the lengthof two vectors and the angle between them usingthe formula

    = arccos v|w

    v w

    .

    Note that arccosines are computed with the acosfunction, and inner products with the dot function

    > > u = [ 3 4 ]

    u =

    3 4

    >> norm(u)

    ans =

    5

    >> v = [5 12]

    v =

    5 12

    >> norm (v)

    ans =

    13

    >> dot(u,v)

    ans =

    63

    >> costheta = dot(u,v)/(norm(u)*norm(v))

    costheta =

    0.9692

    >> acos(costheta)

    ans =

    0.2487

    Thus, the angle between the vectors (3, 4) and(5, 12) is 0.2487 radians.

    Math 130 Home Page athttp://math.clarku.edu/~djoyce/ma130/

    3

    http://math.clarku.edu/~djoyce/ma130/http://math.clarku.edu/~djoyce/ma130/