I want to know some very basics of Gram-Schmidt algorithm used to create orthonormal set of vectors. I tried to search on internet but got confused. So kindly help me.

  1. Is Gram-Schmidt algorithm applied only to a set of linearly independent vectors?
  2. Does that mean, linearly dependent vectors can not be made othornormal?
  3. Suppose we have a matrix of linearly independent vectors of size


, where m is no. of rows and n is no. of columns,then will all the vectors be made orthonormal, if

(i). m > n

(ii). m < n

(iii). m = n

or a subset of the set of vectors?

  1. Does matlab function ,qr, works for linearly dependent as well as independent set of vectors?

1 Answer 1


1.) No. Gram-Schmidt can be applied to a set of linearly dependent vectors (and it is useful to do so).

2.) A set of linearly dependent vectors cannot be made orthonormal, but it can be made /orthogonal/, so Gram-Schmidt is still useful and still applies to linearly dependent sets. It's just the normalization process that we can't do. If Gram-Schmidt (forgetting normalization for now) is applied to a set of linearly dependent vectors, you will get an orthogonal set that has the same span as the original. Note: orthogonal, not orthonormal, because if your set has $m$ vectors, and spans a subspace of dimension $n$, Gram-Schmidt will give you the zero vector for $v_{n+1}, ... , v_{m}$. This set is still orthogonal by definition, but I can't multiply the zero vector by a scalar to give it unit length. However, I can just throw away $v_{n+1}, ... , v_{m}$, and /then/ it can be made orthonormal, as the remaining vectors are orthogonal and nonzero, and at that point I get an orthonormal basis for the subspace spanned by my linearly dependent set.

3.) This is answered by (1) and (2). However, your question here is hard for me to interpret, because if you are viewing the vectors as columns of the matrix, you can't have $m$ linearly independent vectors when your matrix has $n$ rows when $m > n$.

  • $\begingroup$ Thanks a lot for such a nice explanation. BTW have you heard about orthogonal matching pursuit algorithm? $\endgroup$
    – Navdeep
    Commented Apr 28, 2017 at 2:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .