The Gram-Schmidt algorithm is a recursive algorithm for turning a basis for some subspace into an orthonormal basis . By theorem, we have the vectors in :

and where the vectors :