If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Gram-Schmidt process example

Using Gram-Schmidt to find an orthonormal basis for a plane in R3. Created by Sal Khan.

## Want to join the conversation?

• What exactly IS an orthonormal basis? Is it the basis of V as well? How is u1 orthonormal to V1 if it lies on the same plane?
• Orthonormal means that the vectors in the basis are orthogonal(perpendicular)to each other, and they each have a length of one. For example, think of the (x,y) plane, the vectors (2,1) and (3,2) form a basis, but they are neither perpendicular to each other, or of length one. The vectors (1,0) and (0,1) however each have a length of one, and they are perpendicular to each other. They form an orthonormal basis for the (x,y) plane. So to answer your second question the orthonormal basis is a basis of v as well, just one that has been changed to be orthonormal. To answer your third question, think again of the orthonormal vectors (1,0) and (0,1) they both lie in the x,y plane. In fact two vectors must always lie in the plane they span.
• wouldn't it just be easier to take v1, v2- proj(v2),v3-proj(v3), etc first, then normalize it later?
• That's the way a lot of books do it, and it definitely is easier.
• , Why is √(3/2) the same as √(2/3)?
• He is saying that ||y2|| = √3/2
But then at he is finding the value of u2
which is ( 1/ ||y2|| ) * y2
So
1 / √3/2 = √2/3
• What are some practical uses of Gram-Schmidt?
• What's happening in the first 3 minutes of this video ? It seems magical in a way. We are starting off with an abstract idea x1 + x2 + x3 = 0 and from there we suddenly get to a subspace set of vectors with actual numbers. What set of videos should I watch to get more of an intuition about this ?
• x1+x2+x3=0 means 1.c1+1.c2+1.c3=0 (assuming x1=c1, x2=c2, and x3=c3 on the lines of what Sal did) means [1 1 1].[c1 c2 c3]=0 means A.c = b means A = [1 1 1] and c = [c1 c2 c3] and b = 0.
So, what we have here is a 1x3 matrix A. So, m = 1, and n = 3.
Setting b = 0 finds c that projects A onto its nullspace. Now, since we have one equation and 3 unknowns (m < n), we have many solutions. The special solution is:
c2[-1 1 0] + c3[-1 0 1]. (Sal used c1 and c2 respectively).
Setting c2 and c3 to different values gives many solutions.
The vectors [-1 1 0] and [-1 0 1] are linearly independent vectors in the nullspace of A.
A is a rank 1 matrix, since there is only one pivot variable c1 and two free variables c2 and c3. So, we have rank(A) = r = 1.
dim(colspace(A)) = dim(rowspace(A)) = r = 1
colspace is subspace of R1
rowspace is subspace of R3
dim(nullspace(A)) = n-r = 3-1 = 2, subspace of R3
dim(leftnullspace(A)) = m-r = 1-1 = 0, subspace of R1

The rowspace of A is a linear combination of rows of A. A has only 1 row [1 1 1]. Its linear combination is a line passing through origin and [1 1 1]. It is a 1-dimensional line in R3. It is orthogonal to the nullspace spanned by [-1 1 0] and [-1 0 1]. The equation of nullspace is c1 = -c2 - c3, means c1 + c2 + c3 = 0 means x1+x2+x3=0.
Sal actually chose a plane which is a nullspace of A=[1 1 1].
• At
There is y2 = v2 - Projv1v2 = [-1,0,1]-([-1,0,1]·√½[-1,1,0]) as I understood it that should have been all because y2 = [-1,0,1] and Projv1v2 = [-1,0,1]·√½[-1,1,0] but then Sal adds a multiplication of √½[-1,1,0] can someone please explain why?
• To get the projection you need to multiply the magnitude of the projection by a unit vector in the direction of the vector being projected upon; otherwise all you have is a scalar.
• At doesn't Sal mean that the entire right side of the equation after V2 is the projection?
• can the span can be written as C1(X1 + X2 + X3 ) = ax^2 + bx + c and then rref to get the span
• This is a pretty dumb question but, why is it that you can use the first vector to find the unit vector u1, but cannot use v2 to find its unit vector u2, and that you are required to do all those steps?
(1 vote)
• Because there is no guarantee that v₂ is orthogonal to v₁.

We're trying to find a bunch of unit vectors that are all orthogonal to one another. There are infinitely many sets of such vectors, because any such set can be rotated however we like to generate another set of orthogonal unit vectors.

So we can choose the direction of the first vector essentially at random, and then find vectors orthogonal to it. The choice of the first vector determines which orthogonal set we end up with.