Wize University Linear Algebra Textbook > Orthogonality

Orthonormal Basis and Gram-Schmidt Process

0:00 / 0:00

Orthonormal Basis

Orthogonal Set

A set of vectors is said to be an orthogonal set if every pair of vectors in the set is orthogonal.
Wize Concept
Recall that two vectors u\vec u and v\vec v are orthogonal if and only if their dot product is 0.
uv=0    uv\vec u \cdot \vec v =0 \iff \vec u \perp\vec v

Example
The set {[111],[110],[112]}\left\{ \begin{bmatrix} 1\\ -1\\ 1\\ \end{bmatrix} , \begin{bmatrix} -1\\ -1\\ 0\\ \end{bmatrix} , \begin{bmatrix} -1\\ 1\\ 2\\ \end{bmatrix} \right\} is an orthogonal set.
PAGE BREAK

Orthonormal Set

A set of vectors is said to be orthonormal if:
  1. It is an orthogonal set
  2. Every vector in the set is a unit vector (a vector of length 1)
Example
{[1/31/31/3],[1/21/20],[1/61/62/6]}\left\{ \left[\begin{array}{r} 1/\sqrt3\\ -1/\sqrt3\\ 1/\sqrt3\\ \end{array}\right] , \left[\begin{array}{r} -1/\sqrt2\\ -1/\sqrt2\\ 0\\ \end{array}\right] , \left[\begin{array}{r} -1/\sqrt6\\ 1/\sqrt6\\ 2/\sqrt6\\ \end{array}\right] \right\} is an orthonormal set.
Here we have turned each of the vectors from the previous example into a normal vector.

Create unit vectors by normalizing each vector vi\vec v_i in the set (divide by its length): 1vivi\dfrac{1}{\|\vec v_i\|}\vec v_i.
Wize Concept
The standard basis in every real vector space Rn\mathbb{R}^n is an orthonormal basis.
E.g. {[10],[01]}\left\{ \begin{bmatrix} 1\\ 0\\ \end{bmatrix}, \begin{bmatrix} 0\\ 1\\ \end{bmatrix} \right\} is an orthornormal basis for R2\reals^2.

0:00 / 0:00

Example: Orthonormal Sets

Part A)

Show that {(1,0,1,0),(0,1,0,1),(1,0,1,0),(0,1,0,1)}\{(1,0,1,0),(0,1,0,1),(-1,0,1,0),(0,-1,0,1)\} is an orthogonal set.
Let v1=(1,0,1,0), v2=(0,1,0,1), v3=(1,0,1,0), v4=(0,1,0,1)\vec v_1=(1,0,1,0),\ \vec v_2=(0,1,0,1),\ \vec v_3=(-1,0,1,0),\ \vec v_4=(0,-1,0,1), then:
v1v2=0v1v3=0v1v4=0\vec v_1\cdot \vec v_2=0 \qquad \vec v_1\cdot v_3=0\qquad \vec v_1\cdot \vec v_4=0
v2v3=0v2v4=0\vec v_2\cdot \vec v_3=0 \qquad \vec v_2\cdot \vec v_4=0
v3v4=0\vec v_3\cdot \vec v_4=0
Since each pair or vectors is orthogonal, the given set is orthogonal.

Part B)

Normalize each vector to obtain an orthonormal set.
Each vector in the set has a norm of 2\sqrt{2}, so multiply every vector by the scalar 12\dfrac{1}{\sqrt{2}}.
The orthonormal set is:
{(12,0,12,0),(0,12,0,12),(12,0,12,0),(0,12,0,12)}\left\{ \left(\dfrac{1}{\sqrt{2}},0,\dfrac{1}{\sqrt{2}},0\right), \left(0,\dfrac{1}{\sqrt{2}},0,\dfrac{1}{\sqrt{2}}\right), \left(-\dfrac{1}{\sqrt{2}},0,\dfrac{1}{\sqrt{2}},0\right), \left(0,-\dfrac{1}{\sqrt{2}},0,\dfrac{1}{\sqrt{2}}\right) \right\}
0:00 / 0:00

Gram-Schmidt Process

The Gram-Schmidt process transforms any basis into an orthonormal basis using projections.

Wize Concept
Recall: Given two vectors u\vec u and v\vec v, the projection of u\vec u onto v\vec v is a vector parallel to v\vec v:
projvu=(uvvv)v\boxed{\quad \text{proj}_{\normalsize \vec v}\vec u= \left(\dfrac{\vec u\cdot \vec v}{\vec v \cdot\vec v}\right)\vec v \quad}
Subtracting this vector from u\vec u, we can create a vector that is orthogonal to v\vec v:
perpvu=uprojvu\boxed{\quad \text{perp}_{\normalsize \vec v} \vec u = \vec u - \text{proj}_{\vec v}\vec u \quad}

PAGE BREAK

Gram-Schmidt Process

Given a basis {u1,u2,u3,,un}\{\vec u_1,\vec u_2,\vec u_3,\dots,\vec u_n\}, we can create an orthonormal basis {v1,v2,v3,,vn}\{\vec v_1,\vec v_2,\vec v_3,\dots,\vec v_n\} as follows:
Step 1
Let v1=u1\vec v_1=\vec u_1.
Step 2
  • Project u2\vec u_2 onto v1\vec v_1: projv1u2\qquad \colorTwo{\text{proj}_{\normalsize \vec v_1}\vec u_2}
  • Subtract the projection from u2\vec u_2 to find the perpendicular component: v2=u2projv1u2\qquad \vec v_2 = \vec u_2 - \colorTwo{\text{proj}_{\normalsize \vec v_1}\vec u_2}
Step 3
  • Project u3\vec u_3 onto the the previously found vectors vi\vec v_i and add them all up: projv1u3+projv2u3\qquad \colorTwo{\text{proj}_{\normalsize \vec v_1}\vec u_3 + \text{proj}_{\normalsize \vec v_2}\vec u_3}
  • Subtract this sum of projections from u3\vec u_3 to find the perpendicular component: v3=u3(projv1u3+projv2u3)\qquad \vec v_3=\vec u_3 - \colorTwo{(\text{proj}_{\normalsize \vec v_1}\vec u_3 + \text{proj}_{\normalsize \vec v_2}\vec u_3)}
  • Repeat Step 3 until you've created the vector vn\vec v_n: vn=un(projv1un+projv2un+projv3un++projvn1un)\qquad \vec v_n=\vec u_n - (\text{proj}_{\normalsize \vec v_1}\vec u_n + \text{proj}_{\normalsize \vec v_2}\vec u_n + \text{proj}_{\normalsize \vec v_3}\vec u_n+\ldots+ \text{proj}_{\normalsize \vec v_{n-1}}\vec u_n)
Step 4
Normalize: for every vector vi\vec v_i, rewrite as 1vivi\dfrac{1}{\|v_i\|} \vec v_ i
0:00 / 0:00

Example: Gram-Schmidt Process

Let U=span{(2,1,1),(5,1,3),(1,1,9)}U=\text{span}\{(2,1,-1),(-5,1,3),(1,1,9)\} be a subspace of R3\mathbb{R}^3.
Use the Gram-Schmidt process to find an orthonormal basis for UU.
Define u1=(2,1,1), u2=(5,1,3), u3=(1,1,9)\vec u_1=(2,1,-1),\ \vec u_2=(-5,1,3),\ \vec u_3=(1,1,9)
We now apply the Gram-Schmidt process:
Step 1
Let v1=u1=(2,1,1)\vec v_1=\vec u_1=(2,1,-1)
Step 2
Project u2\vec u_2 onto v1\vec v_1, and subtract this projection from u2\vec u_2:
projv1u2=u2v1v1v1v1=(5,1,3)(2,1,1)(2,1,1)(2,1,1)(2,1,1)=126(2,1,1)=(4,2,2)\text{proj}_{\normalsize \vec{v}_1}\vec{u}_2 =\dfrac{\vec{u}_2\cdot\vec{v}_1}{\vec{v}_1\cdot\vec{v}_1}\vec{v}_1 =\dfrac{(-5,1,3)\cdot(2,1,-1)}{(2,1,-1)\cdot(2,1,-1)}(2,1,-1) =\dfrac{-12}{6}(2,1,-1)=(-4,-2,2)
v2=u2projv1u2=(5,1,3)(4,2,2)=(1,3,1)\vec v_2=\vec u_2-\text{proj}_{\normalsize \vec v_1}\vec u_2=(-5,1,3)-(-4,-2,2)=(-1,3,1)
We can check that this new vector v2\vec v_2 is indeed orthogonal to v1\vec v_1:
v1v2=(2,1,1)(1,3,1)=0\vec v_1\cdot \vec v_2=(2,1,-1)\cdot(-1,3,1)=0
Step 3
Project u3\vec u_3 onto both v1\vec v_1 and v2\vec v_2, and subtract these projections from u3\vec u_3:
projv1u3=u3v1v1v1v1=(1,1,9)(2,1,1)(2,1,1)(2,1,1)(2,1,1)=66(2,1,1)=(2,1,1)\text{proj}_{\normalsize \vec v_1}\vec u_3=\dfrac{\vec u_3\cdot\vec v_1}{\vec v_1\cdot\vec v_1}\vec v_1 =\dfrac{(1,1,9)\cdot(2,1,-1)}{(2,1,-1)\cdot(2,1,-1)}(2,1,-1) =\dfrac{-6}{6}(2,1,-1) =\left(-2,-1,1\right)
projv2u3=u3v2v2v2v2=(1,1,9)(1,3,1)(1,3,1)(1,3,1)(1,3,1)=1111(1,3,1)=(1,3,1)\text{proj}_{\normalsize \vec v_2}\vec u_3 =\dfrac{\vec u_3\cdot\vec v_2}{\vec v_2\cdot\vec v_2}\vec v_2 =\dfrac{(1,1,9)\cdot(-1,3,1)}{(-1,3,1)\cdot(-1,3,1)}(-1,3,1) =\dfrac{11}{11}(-1,3,1) =(-1,3,1)
v3=u3(projv1u3+projv2u3)=(1,1,9)(2,1,1)(1,3,1)=(4,1,7)\vec v_3 =\vec u_3-(\text{proj}_{\normalsize \vec v_1}\vec u_3+\text{proj}_{\normalsize \vec v_2}\vec u_3) =(1,1,9)-(-2,-1,1)-(-1,3,1) =(4,-1,7)
We now have an orthogonal basis for UU:
{(2,1,1),(1,3,1),(4,1,7)}\{(2,1,-1),(-1,3,1),(4,-1,7)\}
Step 4
To normalize, we need to know the length/norm of each vector:
(2,1,1)=6,(1,3,1)=11,(4,1,7)=66\lVert (2,1,-1) \rVert = \sqrt{6},\qquad \lVert (-1,3,1) \rVert = \sqrt{11},\qquad \lVert (4,-1,7)\rVert = \sqrt{66}
Divide each vector in the basis by its norm to obtain an orthonormal basis for UU:
{(26,16,16),(111,311,111),(466,166,766)}\left\{ \left( \dfrac{2}{\sqrt{6}},\dfrac{1}{\sqrt{6}},-\dfrac{1}{\sqrt{6}} \right), \left( -\dfrac{1}{\sqrt{11}},\dfrac{3}{\sqrt{11}},\dfrac{1}{\sqrt{11}} \right), \left( \dfrac{4}{\sqrt{66}},-\dfrac{1}{\sqrt{66}},\dfrac{7}{\sqrt{66}} \right) \right\}
checklist
Mark Yourself Question
  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

Practice: Gram-Schmidt Process

Use the Gram-Schmidt process to create an orthonormal basis for the following subspace WW of R4\mathbb{R}^4.
W=span{u1,u2,u3}W=\text{span}\{\vec u_1,\vec u_2,\vec u_3\} where u1,u2,u3\vec u_1,\vec u_2, \vec u_3 are the columns of the matrix:
A=[136112134110]A=\left[\begin{array}{rrr} 1&3&6\\ 1&1&2\\ 1&3&4\\ 1&1&0 \end{array}\right]

Note: WW is the column space of the matrix AA.
Extra Practice