You are on page 1of 3

S T

7
# $ W≠4X
xÕ y = 1 2 3 4 WU 3 V = 7 ≠ 8 + 9 ≠ 8 = 0.
X

≠2

Example:
5 6 Let 5 6
1 2
x= and y = .
2 ≠1

Now inner product between the vectors x and y is

xÕ y = 0

This means that vectors form a right angle.

Right angle

Note: Vectors u and v are called orthonormal, if vectors are unit vectors (||u|| = ||v|| = 1) and vectors are
also orthogonal (i.e. inner product between the vectors is zero uÕ v = 0).

Example: Consider vectors

5 6 5 6
1 2
x= and y =
2 ≠1

Next we will form normalized vectors u and v.

Normalized vector of x is a vector in the same direction but with norm 1. Normalized vector is denoted as
x
u=
||x||

S 1 T
5 6 Ô
x 1 1
= U 25 V
W X
u= =Ô
||x|| 5 2 Ô
5

35
and normalized vector of y is called as v

S 2 T
5 6
Ô
y 1 2
= U ≠15 V
W X
v= =Ô
||y|| 5 ≠1 Ô
5

Now vectors u and v are also orthogonal since uÕ v = 0. This is obvious since we noriced in a previous exmple
that vectors x and y are orthogonal and that normalization does not change direction. Since vectors u and v
are unit vectors and orthogonal they are orthonormal.

# R example of orthonormal vector


# Define vector x
x <- c(1,2)
# compute the length of the vector x
sqrt(x%*%x)

## [,1]
## [1,] 2.236068
# Create normalized vector of x that is called as u
u <- x/sqrt(x%*%x)

## Warning in x/sqrt(x %*% x): Recycling array of length 1 in vector-array arithmetic is deprecated.
## Use c() or as.vector() instead.
u

## [1] 0.4472136 0.8944272


# Define vector y
y <- c(2,-1)
# Create normalized vector of y that is called as v
v <- y/sqrt(y%*%y)

## Warning in y/sqrt(y %*% y): Recycling array of length 1 in vector-array arithmetic is deprecated.
## Use c() or as.vector() instead.
v

## [1] 0.8944272 -0.4472136


# Vectors u and v are orthonormal if inner product between the vectors is zero.
u%*%v

## [,1]
## [1,] 0

36
Note: The set of vectors {u1 , u2 , ..., up } is called orthogonal set of vectors if all possible pairs of vectors are
orthogonal. In other words

uiÕ uj = 0 ’ i ”= j.

Example: In this example we investigate if the set of vectors is orthogonal.

Consider the set of three vectors {u1 , u2 , u3 }, where

# $
u1T = 3 1 1 ,

# $
u2T = ≠1 2 1

and

# $
u3T = ≠1/2 ≠2 7/2

We investigate if the vector pairs are orthogonal.

Are vectors u1 and u2 orthogonal?

u1T u2 = 3 · (≠1) + 1 · 2 + 1 · 1 = 0
Yes they are, since inner product between the vectors is zero.

Pair u1 and u3 is also orthogonal since

u1T u3 = 3 · (≠1/2) + 1 · (≠2) + 1 · 7/2 = 0.


and the vectors u2 and u3 are also orthogonal since

u2T u3 = ≠1 · (≠1/2) + 2 · (≠2) + 1 · 7/2 = 0.

We confirmed that all possible pairs of vectors are orthogonal so the set of vectors {u1 , u2 , u3 } is orthogonal.

Note: The set of vectors is orthonormal if the set of vectors is orthogonal and all vectors are unit vectors.
To be more precise the set of vectors {u1 , u2 , ..., up } is orthonormal if

;
1, if i = j
uiT uj =
0, if i =
” j

37

You might also like