How to find matrix of orthogonal projection from gram-schmidt orthogonalization

I'm having a little difficulty understanding Gram-Schmidt orthogonalization. I have a problem to apply Gram-Schmidt orthogonalization to the system of vectors $$(1,1,1)^T, (1,2,1)^T$$ then write the matrix of the orthogonal projection onto 2-dimensional subspace spanned by these vectors. After applying gram-schmidt I found $$v_1 = (1,1,1)^T, v_2 = (-\frac{1}{3}, \frac{2}{3}, \frac{1}{3})^T$$. I'm not sure what to do next to find the matrix of the orthogonal projection onto 2-dimensional subspace spanned by these vectors. Also, what exactly does gram-schmidt orthogonalization find? I'm just a little confused.

• To start off , you should normalize your new vectors Commented Apr 26, 2015 at 17:51
• okay so v_1 = $1/\sqrt{3}(1,1,1)^T and v_2 =$1/\sqrt{2/3}(-1/3,2/3,1/3)^T$Commented Apr 26, 2015 at 18:01 2 Answers Hint; your final vectors are not correct. The point of GS it to get an orthogonal set of vectors. Are yours orthogonal? You are starting off with two non orthogonal vectors , that is$v_1=( 1 , 1 , 1)$and$v_2= ( 1 , 2 ,1)$The GS algorithm proceeds as follows; let$w_1=(1,1,1)$then we define $$w_2= v_2- \frac{\langle v_1 , w_1 \rangle}{\langle w_1 , w_1 \rangle} w_1$$ $$w_2=(1,2,1)-(4/3,4/3,4/3)=(-1/3,2/3,-1/3)$$ and it can be shown now that the set $$S=\{w_1,w_2\}$$ is orthogonal and also spans the same subspace as the original vectors v. If we normalize S to say $$S_n=\{(1/3,1/3,1/3),(\frac{-1}{\sqrt6},\sqrt{\frac{2}{3}},\frac{-1}{\sqrt6})\}$$ In general to find the projection matrix P, you first consider the matrix A with your vectors from$S_n$as columns, that is $$A=\begin{bmatrix} 1/3 & \frac{-1}{\sqrt6} \\ 1/3 & \sqrt{\frac{2}{3}} \\ 1/3 & \frac{-1}{\sqrt6} \\ \end{bmatrix}$$ that is, we will have the orthogonal projection matrix equal to,$P=A(A^{T}A)^{-1}A^{T}$• oops, I think I must have mistyped the second vector. And that makes more sense now the point of GS. how can you find the matrix for the projection though with these though? Commented Apr 26, 2015 at 18:04 • @TheStrangeQuark Great, and I will try to update it with more info soon Commented Apr 26, 2015 at 18:05 • Yes, I want to write the matrix of the orthogonal projection onto 2-dimensional subspace spanned by these vectors Commented Apr 26, 2015 at 18:22 • Where does that final equation come from? Commented Apr 26, 2015 at 23:15 • I won't exactly post the derivation here, but you can find it on online. Anyways, it has to do with the orthogonal decomposition, Commented Apr 26, 2015 at 23:43 Gram-Schmidt finds, given a basis of a subspace, an orthonormal basis of this subspace. Its main tool is the following formula, which defines the orthogonal projection of a vector$\vec v$onto another vector$\vec u$: $$p_{\vec u}(\vec v)=\frac{(\vec u,\vec v)}{(\vec u,\vec u)}\vec u.$$ What you should do: Find an orthonormal basis of your subspace and complete it in an orthonormal basis of$\mathbf R^3$. In this orthonormal basis, the matrix of the orthogonal projection on the subspace (generated by the first two vectors) is simply: $$B=\begin{bmatrix} 1&0&0\\0&1&0\\0&0&0 \end{bmatrix}$$ Now the matrix of the projection in the original basis is given by: $$A=PBP^{-1}$$ where$P$is the change of basis matrix from the original basis to the new one. • But I only have 2 vectors, so P won't be a square matrix? Commented Apr 26, 2015 at 22:54 • You have to complete the orthogonal basis of the subspace into an orthogonal basis of$\mathbf R^3$first. Thus you'll have a$3\times3\$ matrix. Commented Apr 26, 2015 at 23:22
• So I have to first find a change of basis matrix for this and the standard basis of R3? Commented Apr 26, 2015 at 23:24
• That's it, @StrangeQuark… Commented Apr 26, 2015 at 23:25
• For some reason I'm blanking on how to do this. Why wouldn't that be a 2x3 matrix too, or it would have an all 0 column which makes it not invertable Commented Apr 26, 2015 at 23:35