Description of the Gram-Schmidt procedure to formulate orthonormal bases.
The Gram-Schmidt algorithm or procedure is used to find an orthonormal basis for the subspace
, even if
is not linearly independent. The algorithm is formally defined as follows:
-
Inputs : Set of vectors
.
-
Outputs : Orthonormal basis elements
that span the same space:
.
-
Procedure:
- Take the first element of the set and divide it by its norm (that is,
normalize the element):
- Take the second element and subtract the projection into the first basis element:
Normalize the result
:
It is easy to check that
and
are orthonormal:
Thus,
and
are orthonormal.
- The second step is repeated for each additional element;
element follows the following formula:
When the set
includes linearly dependent vectors, some of the unnormalized vectors
, as the projections will cancel out with some elements of
. As a result, the number of vectors needed will be higher than the dimensionality of the space; in other words, the dimensionality of
will be smaller than the cardinality of the set
.
Example 1 Let
, where
,
and
.
We can therefore write the set of quadratic functions as
, and
, where
. Recall that for this space, the inner product is written as
We obtain a basis for
using the Gram-Schmidt procedure: it requires us to compute several norms and inner products on the way.
- Solve for
and so
.
- Solve for
It is easy to check that
has unit norm and is orthogonal to
.
- Solve for
We can check that