You are on page 1of 31

Orthogonality & The Gram-

Schmidt Procedure
Dr. Sara Hassan Kamel
Orthogonality
 What are orthogonal vectors?
 The angle between two orthogonal
vectors = 90◦
 Also  Dot product = 0

v1  v2  v v2  0
T
1

v1  v 2  v1 . v 2 cos
 v1 . v 2 cos90  0 0

2 Dr. Sara Hassan Kamel


Orthogonality
 What are orthogonal vectors?
 The angle between two orthogonal
vectors = 90◦
 Also  Dot product = 0
v2
1  2
v1    v2   
 2 1 
v1
v1  v2  v v2  1 2  (2) 1  0
T
1
3 Dr. Sara Hassan Kamel
Orthogonality
 Orthogonal vs. Orthonormal
 Orthogonal = perpendicular vectors “θ = 90”
 Orthonormal = orthogonal + unit vectors

 Norm of a vector:
 v1 
v 
v  2 v  v12  v22  ...  vn2
 2

  • This is called the “Euclidean norm” or the “ℓ2-norm”


vn  • There are other types of “norms”
4 Dr. Sara Hassan Kamel
Orthogonality
 Orthogonal vs. Orthonormal
 Orthogonal = perpendicular vectors “θ = 90”
 Orthonormal = orthogonal + unit vectors

 Unit vector  Norm = 1  u 1

 To get a unit vector u in the same direction as the


vector v  v
v
5 Dr. Sara Hassan Kamel
Orthogonality
 Orthogonal Sets
 The set S = {v1, v2, …vn } is an orthogonal set if
vi  v j  v v j  0
T
i for all i  j

6 Dr. Sara Hassan Kamel


Orthogonality
 Orthogonal Sets
 The set S = {v1, v2, …vn } is an orthogonal set if
vi  v j  v v j  0
T
i for all i  j

 If we have N vectors, how many dot products do we


need to compute to check if they are an orthogonal
set?
NC
2
7 Dr. Sara Hassan Kamel
Orthogonality
 Orthonormal Sets
 The set S = {v1, v2, …vn } is an orthogonal set if
vi  v j  v v j  0
T
i for all i  j
where v1  v 2  ...  v n  1  unit vectors

 Example: 1 0 0 


1 2 
      
1 2  0, 1, 0 
v1    v2    0 0 1 
1 2   1 2        
8 Dr. Sara Hassan Kamel
Orthogonality
 Orthogonal & Orthonormal Basis
 If the vectors in a basis form an orthogonal
set, we say that it’s an “orthogonal basis”
 If they are ALSO unit vectors, then it’s an
“orthonormal basis”
independent
Spanning Set Basis

orthogonal
Unit
Orthonormal vectors Orthogonal
Basis Basis
9 Dr. Sara Hassan Kamel
Orthogonality
 Orthogonal & Orthonormal Basis
 If the vectors in a basis form an orthogonal
set, we say that it’s an “orthogonal basis”
 If they are ALSO unit vectors, then it’s an
“orthonormal basis”
independent
Spanning Set Basis

orthogonal
Unit ?
Orthonormal vectors Orthogonal
Basis Basis
10 Dr. Sara Hassan Kamel
Gram-Schmidt Procedure
 Gram-Schmidt Procedure

Gram Schmidt Laplace

11 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Orthogonal Projection
 We want to project the vector x onto y

projy x   x cos 
y
y

Length
(magnitude) Direction
(unit vector)

12 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Orthogonal Projection
 We want to project the vector x onto y

projy x   x cos 
y
y
 x  y  y
  x 
 y
 x.y 
 xy 
 y
 y2 
 
13 Dr. Sara Hassan Kamel
Gram-Schmidt Procedure
 Orthogonal Projection
 We want to project the vector x in the direction
orthogonal to y
projy x  x  projy x
 xy 
 x   2 y
 y 
 

14 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.

15 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.
v2 w2
STEPS:

w1  v1 v1 w1

 v w 
w 2  projw1 v 2  v 2   2 2 1 w1
 w 
 1 
16 Dr. Sara Hassan Kamel
Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.

Independent Orthogonal
vectors vectors

17 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.

STEPS:
w1  v1
 v w 
w 2  projw1 v 2  v 2   2 2 1 w1
 w 
 1 
 v w   v w 
w 3  projspan{w1 ,w 2 } v 3  v 3   3 1 w   3 2 
w2
 w 2
 1
 w 2

 1   2 
18 Dr. Sara Hassan Kamel
Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.

STEPS:

w1  v1
w 2  projw1 v 2  v 2  projw1 v 2
w 3  projspan{w1 ,w 2 } v 3  v 3  projw1 v 3  projw 2 v 3

19 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Gram-Schmidt Procedure
 Applied to a set of independent vectors to get a set of
orthogonal vectors that span the same space.

STEPS: For a set of N independent vectors {v1, v2, …, vN}

w1  v1
n 1
w n  v n   projw k v n for n  2,3,...N
k 1

20 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

 First: {v1, v2, v3} is a spanning set


 Check independence  {v1, v2, v3} is an independent set
 Are they orthogonal? NO  v1 ● v2 = 3 ≠ 0
 We need to use the Gram-Schmidt Procedure

21 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1  v w 
1 w 2  projw1 v 2  v 2   2 2 1 w1
w1  v1     w 
1  1 

1

22 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1  v w 
1 w 2  projw1 v 2  v 2   2 2 1 w1
w1  v1     w 
1  1 

1

23 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1  3
1 1
w1    w2   
1 1
  
1 1  v w   v w 
w3  projspan{w1 ,w2 } v3  v3   3 1 w   3 2 
w2
 w 2
 1
 w 2

 1   2 
24 Dr. Sara Hassan Kamel
Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1  3  v w   v w 
1 1 w3  v3   3 2 1 w1   3 2 2 w 2
w1     w   w 
1 w2     1   2 
1
  
1 1

25 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1  3 0
1 1  2
w1    Orthogonal
1 w2    w3   
1 1 Basis for V
    
1 1 1

26 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1 1 1 1 / 4 


1 1 1  
w1    u1 
w1

1   1   1 / 4 
1 w1 12  12  12  12 1 4 1 1 / 4 
    
1 1 1 1 / 4 

27 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

 3  3  3  3 / 12 
1 1 1  
w2    u2 
w2

1   1     1/ 12 
1 w2 (3) 2  12  12  12  1  12  1   1 / 12 
     
   
1  1   1 / 12 
1

28 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

0 0 0  0 


  2  2  2  2 / 6 
w3   
w3 1   1   
u3  
1 w3 0  (2)  1  1  1 
2 2 2 2
6  1   1/ 6 
       
1  1   1/ 6 
1

29 Dr. Sara Hassan Kamel


Gram-Schmidt Procedure
 Example: If V = span{v1, v2, v3}, construct an
orthonormal basis for V

v1 = v2 = v3 =

1 / 4  3 / 12   0 
     2 / 6 
u1  
1/ 4
u2   1/ 12 
u3   
1 / 4  1/ 12   1/ 6 
     
1 / 4   1 / 12   1 / 6 
Orthonormal
Basis for V
30 Dr. Sara Hassan Kamel
Review Questions
 Which of the following statements are true?
 Any orthogonal set is an independent set
 A vector space has only one orthonormal basis
 Any set of orthogonal vectors in ℝ3 is a basis for
ℝ3
 If {v1, v2, v3} is a basis for V, and x is orthogonal to
each of v1, v2 and v3, then x is orthogonal to all
vectors in V
Any vector in V  w = c1v1 + c2v2 +c3 v3
x ● w = x ● (c1v1 + c2v2 +c3 v3)
= c1(x ● v1) + c2(x ● v2) + c3(x ● v3) = 0
31 Dr. Sara Hassan Kamel

You might also like