What is the Gram-Schmidt process?

We use the Gram-Schmidt process to calculate an orthogonal basis u1,u2,.....,un\vec{u_{1}}, \vec{u_{2}}, ..... , \vec{u_{n}} that spans the same space from the given set of linearly independent vectors v1,v2,.....,vn\vec{v_{1}}, \vec{v_{2}}, ..... , \vec{v_{n}}.

Background

Before getting started with the Gram-Schmidt process, here are a few things that we need to recall:

Concept Example
Vector inner product Let x=[abc]\vec{x} = \begin{bmatrix} a \\ b \\ c \\ \end{bmatrix} , y=[def]\vec{y} = \begin{bmatrix} d \\ e \\ f \\ \end{bmatrix} \newline x,y=ad+be+cf=ad+be+cf\langle \vec{x} , \vec{y} \rangle = a\cdot d + b\cdot e + c\cdot f = ad + be + cf
Vector norm Let x=[123]\vec{x} = \begin{bmatrix} -1 \\ 2 \\ 3 \\ \end{bmatrix} \newline x,x=(1)(1)+22+33=14\langle \vec{x} , \vec{x} \rangle = \sqrt{(-1)\cdot(-1) + 2\cdot2 + 3\cdot3} = \sqrt{14}

Note: An orthogonal set contains non-zero vectors v1,v2,.....,vnV\vec{v_{1}}, \vec{v_{2}}, ..... , \vec{v_{n}} \in V . Both are orthogonal to each other—vi,vj=0\langle \vec{v_{i}} , \vec{v_{j}} \rangle = 0 for iji \neq j.

Process

Suppose the arbitrary set of linearly independent vectors v1,v2,.....,vnV\vec{v_{1}}, \vec{v_{2}}, ..... , \vec{v_{n}} \in V span RnR^n. To calculate its orthogonal basis u1,u2,.....,un\vec{u_{1}}, \vec{u_{2}}, ..... , \vec{u_{n}} that spans the same space, we perform the following steps:

Step 1

We calculate the first vector, u1\vec{u_{1}}in the following way:

Step 2

We calculate the second vector, u2\vec{u_{2}}, in the following way:

Step 3

We calculate the third vector, u3\vec{u_{3}}, in the following way:

Step 4

We calculate the nthn^{th} vector, un\vec{u_{n}}, in the following way:

The vectors u1,u2,.....,un\vec{u_{1}}, \vec{u_{2}}, ..... , \vec{u_{n}} form the orthogonal basis for RnR^n.

Example

Find an orthogonal basis for the following vectors that span R3R^3:

Step 1

The vector u1\vec{u_{1}} equals the following:

Step 2

The vector u2\vec{u_{2}} equals the following:

We get the following equation upon calculation:

Step 3

The vector u3\vec{u_{3}} equals the following:

We get the following equation upon calculation:

Solution

The following vectors have been calculated using the Gram-Schmidt process that forms the orthogonal basis for R3R^3:

Orthonormal basis

Using the Gram-Schmidt process, an orthonormal basis x1,x2,....,xnx_{1}, x_{2}, ...., x_{n} can be calculated from any given set of linearly independent vectors.

Note: An orthonomal set has non-zero vectors x1,x2,.....,xnX\vec{x_{1}}, \vec{x_{2}}, ..... , \vec{x_{n}} \in X with a norm equal to one—xi=1||x_{i}|| = 1.

Procedure

To calculate an orthonormal basis, we follow the steps below:

  • We convert the given set of vectors into an orthogonal basis using the Gram-Schmidt process.

  • We divide the resulting vectors by their norm to achieve an orthonormal basis.

Example

Let's use the previous example:

The orthogonal set of vectors achieved for VV is as follows:

The orthonormal vectors will be calculated in the following way:

Quiz

To help you completely grasp the Gram-Schmidt process, here are a few questions with solutions:

Question 1

Find an orthogonal basis for the following vectors that span V:V:\newline v1=[111],v2=[101],v3=[112]\vec{v_{1}} = \begin{bmatrix} 1 \\ -1 \\ 1 \\ \end{bmatrix}, \vec{v_{2}} = \begin{bmatrix} 1 \\ 0 \\ 1 \\ \end{bmatrix}, \vec{v_{3}} = \begin{bmatrix} 1 \\ 1 \\ 2 \\ \end{bmatrix}

Show Answer
Question 2

Find an orthonormal basis for the following vectors that span V:V:\newline v1=[122],v2=[102],v3=[001]\vec{v_{1}} = \begin{bmatrix} 1 \\ 2 \\ 2 \\ \end{bmatrix}, \vec{v_{2}} = \begin{bmatrix} -1 \\ 0 \\ 2 \\ \end{bmatrix}, \vec{v_{3}} = \begin{bmatrix} 0 \\ 0 \\ 1 \\ \end{bmatrix}

Show Answer

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved