Worksheet for Lecture (due December 4) Name: Section 6 Inner product, length, and orthogonality u Definition Let u = u n product or dot product to be and v = v v n be vectors in R n We define their inner u v := u T v = ( ) u u n = v u + + v n u n v v n Example Compute u v and v u for u = 5 and v = u v = u T v = ( 5 ) = + 5 + = 6 + + = 9 v u = v T u = ( ) 5 = + 5 + = 6 + + = 9 Theorem Let u, v, w R n, and let c be a scalar Then (a) u v = v u (b) (u + v) w = u w + v w (c) (cu) v = c(u v) = u (cv) (d) u u, and u u = if and only if u = The length of a vector Let v = R n Its length (or norm) is v v n v = v v = v + + v n In particular, v = v v For any scalar c, we have cv = c v A vector v is called a unit vector if v = In general, for a nonzero vector v, we can normalize it to v so that we get a unit vector v
Example Let v = What is the length of v? Find a unit vector u in the same direction as v Solution v = v v = ( ) + ( ) + + = + 4 + 4 + = 9 v = We may normalize the vector v as / u = v = / / ( ) / Example Let W be the subspace of R spanned by x = Find a unit vector u that is a basis for W ( ) Solution We may multiply x by so that W is spanned by y = The length y = + = So we choose u = y ( ) / y = / ( ) / Note: we can alternatively choose another vector / Definition For u, v R n, the distance between u and v is dist(u, v) = u v Example Compute the distance between the vectors u = Solution Calculate u v = ( ) 7 ( ) ( ) 4 = u v = 4 + ( ) = 7 ( ) 7 and v = ( ) Example Compute the distance between the vectors u = u and v = v u u v v
Solution u v = u v u v u v dist(u, v) = u v = (u v ) + (u v ) + (u v ) Orthogonal vectors Two vectors u and v in R n are orthogonal (to each other) if u v = Justification: u is orthogonal to v if and only if dist(u, v) = dist(u, v) u v = u + v (u v) (u v) = (u + v) (u + v) u u + v v u v = u u + v v + u v u v = Theorem (The Pythagorean Theorem) Two vectors u, v are orthogonal if and only if u + v = u + v Justification: (u + v) (u + v) = u u + v v u u + v v + u v = u u + v v u v = Example For u = and v =, verify that Solution We compute We compute u + v + u v = u + v u + v = + = and u v = = u + v + u v = ( + + ) + ( + ( ) + ) = 4 + 9 + 9 + + + = 4 u + v = ( + + ) + ( + + ) = ( + + 4) + ( + 4 + ) = 4 Orthogonal Complements Let W V be a subspace A vector v is orthogonal to W if it is orthogonal to every vector in W If W = Span{w,, w r, this is equivalent to that v is orthogonal to each of w i
4 If v is orthogonal to every w i, then for a linear combination w = a w + + a r w r, we have v w = v (a w + + a r w r ) = a v w + + a r v w r = The set of all vectors that are orthogonal to W is called the orthogonal complement of W, and denoted by W (read W perp) Example In R, if W is a surface, then W is the line that is perpendicular to W Remark The orthogonal complement of W is W, namely, those vectors that are perpendicular to W is W Theorem Let A be an m n 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 A T : Solution Write Row(A) = Nul(A) and (Col(A)) = Nul(A T ) v A = v m Nul(A) is the set of vectors x, such that Ax = ; v v x Ax = x = v m v m x This means that the null space is exactly the x s that are orthogonal to every v i This means Row(A) = Nul(A) We get the other equality by replacing A by A T Span{ Example In R, find the orthogonal complement to W =, Solution If x = x x is orthogonal to W = Span{,, we have { x + x + = x + = ( ) ( ) ( ) ( ) / / /
5 So the orthogonal complement of W is { W = x x = x / / = / { / = Span / / Angle in R and R The formula is u v = u v cos θ Remark The cos θ is what the statistician calls the correlation coefficients ( ) ( ) 4 Example Find the angle between two vectors u = and v = Solution: We compute cos θ = u v u v = 4 + ( ) 4 + = 8 = 6 5 = 5 θ = arccos 5
6 True/False Questions () v v = v () For any scalar c, u (cv) = c(u v) () For a square matrix A, vectors in Col(A) are orthogonal to vectors in Nul(A) False Vectors in Nul(A) are orthogonal to Row(A) (4) If vectors v,, v p span a subspace W and if x is orthogonal to each v j for j =,, p, then x is in W (5) u v v u = (6) For any scalar c, cv = c v False We need to take absolute value on c: we need cv = c v (7) If x is orthogonal to every vector in a subspace W, then x is in W (8) If u + v = u + v, then u and v are orthogonal This is the Pythagoreans Theorem (9) For an m n matrix A, vectors in the null space of A are orthogonal to vectors in the row space of A () Suppose a vector y is orthogonal to vectors u and v Then y is orthogonal to u+v y u = and y v = imply that y (u + v) = Exercise Set u = 4 and v = Compute the following: () u v and v u () A unit vector in the direction of u () The distance dist(u, v) (4) The angle between the two vectors u and v
7 Solution () We have u v = u T v = ( 4 ) = ( ) + ( 4) + = v u = v T u = ( ) 4 = ( ) + ( 4) + = () u = u u = ( ) + 4 + = 5 We have u = u/ u = 4 = /5 4/5 5 () u v = 4 = 4 6 dist(u, v) = u v = 4 + ( 6) + ( ) = 6 + 6 + 4 = 56 = 4 (4) We have cos θ = u v u v = ( ) + ( 4) + + ( 4) + ( ) + + = 8 = 5 9 5 So θ = arccos( 5 ) Exercise In R, find the orthogonal complement to W =, 4 5 Solution If x = x x is orthogonal to W = Span{, 4, we have { x + x + = x + 4x + 5 = 5 ( ) ( ) ( ) ( ) 4 5 4 So the orthogonal complement of W is { W = x x = x = =