Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
22 views

Norm and Inner Products in R Math 130 Linear Algebra

The document discusses norms and inner products in Rn. It defines the norm (length) of a vector v as the square root of the sum of the squares of its components. The inner product of two vectors v and w is defined as the sum of the products of their corresponding components. It is shown that the square of the norm of a vector v is equal to the inner product of v with itself. Orthogonal vectors have an inner product (and thus cosine of the angle between them) equal to 0. Matlab commands for computing norms, inner products, and the angle between vectors are provided.

Uploaded by

Cody Sage
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Norm and Inner Products in R Math 130 Linear Algebra

The document discusses norms and inner products in Rn. It defines the norm (length) of a vector v as the square root of the sum of the squares of its components. The inner product of two vectors v and w is defined as the sum of the products of their corresponding components. It is shown that the square of the norm of a vector v is equal to the inner product of v with itself. Orthogonal vectors have an inner product (and thus cosine of the angle between them) equal to 0. Matlab commands for computing norms, inner products, and the angle between vectors are provided.

Uploaded by

Cody Sage
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Norm and inner products in Rn Math 130 Linear Algebra

D Joyce, Fall 2012 So far weve concentrated on the operations of addition and scalar multiplication in Rn and, more generally, in abstract vector spaces. There are two other algebraic operations on Rn we mentioned early in the course, and now its time to look at them in more detail. One of them is the length of a vector, more commonly called the norm of a vector. The other is a kind of multiplication of two vectors called the inner product or dot product of two vectors. Theres a connection between norms and inner products, and well look at that connection. Today well restrict our discussion of these concepts to Rn , but later well abstract these concepts to dene inner product spaces in general. The norm, or length, v of a vector v. Consider a vector v = (v1 , v2 ) in the plane R2 . By the Pythagorean theorem of plane geometry, the distance (v1 , v2 ) between the point (v1 , v2 ) and the origin (0, 0) is (v1 , v2 ) =
2 2 v1 + v2 .

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 that cv = |c| v when c is a real number and v is a real vector. Theres also a triangle inequality for norms vw v + w . You can prove it geometrically in low dimensions, but well prove it algebraically in higher dimensions. The inner product v|w of two vectors. These are also commonly called dot products and denoted with the alternate notation v w. Well start by dening inner products algebraically, then see what they mean geometrically. The inner product v|w of two vectors v and w in Rn is the sum of the products of corresponding coordinates, that is, v|w = (v1 , v2 , . . . , vn )|(w1 , w2 , . . . , wn )
n

= v1 w1 + v2 w2 + vn wn =
k=1

vk wk

Notice right away that we can interpret the square of the length of the vector as an inner prodThus, we dene the length or norm of a vector v = uct. Since (v1 , v2 ) as being 2 2 2 v 2 = v1 + v2 + + vn , v = (v1 , v2 ) =
2 2 v1 + v2 .

therefore

v 2 = v|v . The norm of a vector is sometimes denoted |v| Because of this connection between norm and inner rather than v . n product, we can often reduce computations involvNorms are dened for R as well ing length to simpler computations involving inner v = (v1 , v2 , . . . , vn ) products. The inner product acts like multiplication in a n 2 2 2 2 lot of ways, but not in all ways. First of all, the in= v1 + v2 + + vn = vk . ner product of two vectors is a scalar, not another k=1 1

vector. That means you cant even ask if its associative because the expression u|v |w doesnt even make sense; u|v is a scalar, so you cant take its inner product with the vector w. But aside from associativity, inner products act a lot like ordinary products. For instance, inner products 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 vector is 0 v|0 = 0.

c2 = a2 + b2 2ab cos . Now, start with two vectors v and w, and place them 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 is w v. Now we can use the law of cosines to see that

! rrr w rr v r rr j I  v     w   

2 v w cos . Furthermore, inner products and scalar products have a kind of associativity, namely, if c is a scalar, We can convert the distances to inner products to simplify this equation. then cu|v = c u|v = u|cv . w v 2 = w v|w v These last few statements can be summarized by = w|w 2 w|v + v|v saying that inner products are linear in each coor= w 2 2 w|v + v 2 dinate, or that inner products are bilinear opera= v + w tions. Now, if we subtract v 2 + w 2 from both sides of our equation, and then divide by 2, we get

wv

The inner product of two vectors and the cosine of the angle between them. For this v|w = v w cos . discussion, well restrict our attention to dimension 2 since we know a lot of plane geometry. That gives us a way of geometrically interpreting The law of cosines for oblique triangles says that the inner product. We can also solve the last equagiven a triangle with sides a, b, and c, and angle tion for cos , between sides a and b, cos =
r rr

v|w , v w

c r rr r


r 

which will allow us to do trigonometry by means of linear algebra. Note that = arccos v|w v w .

  b  

Orthogonal vectors. The word orthogonal is synonymous with the word perpendicular, but for >> norm (v) some reason is preferred in many branches of mathematics. Well write w v if the vectors w and v ans = are orthogonal, or perpendicular. 13 >> dot(u,v) ans = 63
f f f    w    I 

vf

w f f

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

costheta = 0.9692 Two vectors are orthogonal if the angle between them is 90 . Since the cosine of 90 is 0, that means >> acos(costheta) w v if and only if w|v = 0 ans = 0.2487 Vectors in Matlab. You can easily nd the length of a vector in Matlab; where the length of a vector is called its norm. Lets nd the length Thus, the angle between the vectors (3, 4) and of two vectors and the angle between them using (5, 12) is 0.2487 radians. the formula Math 130 Home Page at http://math.clarku.edu/~djoyce/ma130/ v|w = arccos . v w Note that arccosines are computed with the acos function, and inner products with the dot function >> u = [3 4] u = 3 >> norm(u) ans = 5 >> v = [5 12] v = 5 12 3 4

You might also like