Friday, November 17, 2017

Inner Product, Length, and Orthogonality

*The Inner Product: if u and v are vectors in the real numbers, then we regard u and v as n x 1 matrices. The transpose u^T is a 1 x m matrix, and the matrix product u^Tv is a 1 x 1 matrix, which we write as a single real number (a scalar) without brackets. The number u^Tv is called the inner product of u and v, and often it is written as u*v. This inner product, is also known as the dot product. 

Example One: Compute u*v and v*u for u = [2, -5, -1] and v = [3,2,-3]. 
u*v = u^Tv =  (2)(3) + (-5)(2) + (-1)(-3) = (-1)
v*u = v^Tu = (3)(2) + (2)(-5) + 3)(-1) = (-1)

Theorem One: Let u, v and w be vectors in the real numbers, 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 > or equal to 0, and u*u = 0 if and only if u = 0

*The length of a Vector: The length (or norm) of v is the non negative scalar //v// defined by 
//v// = sqrt (v*v) = sqrt (v1 + v2 +.....+ vn) and //v//^2 = v*v.

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 1/ //v// - we obtain a unit vector u because the length of us is (1/ //v//)//v//. The process creating u from v is sometimes called normalizing v, and we say that u is in the same direction as v. 

Example Two: Let v = (-1, -2, 2, 0). Find a unit vector u in the same direction as v. 
First compute the length of v: 
//v//^2 = v*v = (1)^2 + 2)^2 + (2)^2 +)^2 = 9
//v// = sqrt(9) = 3. 
Then, multiply v by 1/ //v// to obtain: 
u = 1/ //v// *v =1/3(v) =1/3 [1,-2,2,0] = [1/3, -2/3, 2/3, 0]
To check that //u// =1, it suffices to show that //u//^2 = 1. 
//u//^2 = u*u = (1/3)^2 + (2/3)^2 + (2/3)^2 + (0)^2
                     = 1/9 + 4/9 + 4/9 + 0 =1

For u and v in real numbers, the distance between u and v, written as dist(u,v), is the length of the vector u-v. That is, dist(u,v) = //u-v//.

Two vectors u and v in the real numbers are orthogonal to each other if u*v = 0.

Theorem Two: The Pythagorean Theorem: 
Two vectors u and v are orthogonal if and only if //u+v//^2 = //u//^2 + //v//^2.

If a vector z is orthogonal to every vector in a subspace W of all the real numbers, then z is said to be orthogonal to W. The set of all vectors z that are orthogonal to W is called the orthogonal component of W and is denoted by W (perp). 

Theorem Three: Let A be an m x 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 transpose: (Row A) (perp) = Nul A and (Col A) (perp) = Nul A transpose. 

If u and v are nonzero vectors in either R^2 or R^3, then there is a nice connection between their inner product and the angle theta between the two line segments from the origin to the points identified with u and v. The formula is u*v = //u// //v// cos (theta).


Examine Problem
Mark each statement True of False and Justify your answer. 
a.) v*v = //v//^2
b.) For any scalar c, u*(cv) = c(u*v)
c.) If the distance from u to v equals the distance from u to -v, then u and v are orthogonal. 
d.)For a square matrix A, vectors in Col A are orthogonal to vectors in Nul A. 
e.) For an m x n matrix A vectors, in the null space of A are orthogonal to vectors in the row space of A.