# Find the matrix of the orthogonal projector on span

I need to find the matrix of the orthogonal projector on $$Span([1,1,-1],[1,-1,-1])$$. I had used Gram-Schmidt process on it and have $$Span([\frac{\sqrt{3}}{3},\frac{\sqrt{3}}{3}, -\frac{\sqrt{3}}{3}], [ \frac{\sqrt{6}}{6}, -\frac{\sqrt{6}}{3}, -\frac{\sqrt{6}}{6}])$$ and the matrix should be $$P = \left[\begin{matrix}\frac{\sqrt{3}}{3} & \frac{\sqrt{3}}{3} & -\frac{\sqrt{3}}{3}\\\frac{\sqrt{6}}{6} & -\frac{\sqrt{6}}{3} & -\frac{\sqrt{6}}{6} \\ 0 & 0 & 0 \end{matrix}\right]$$. I got this matrix from these reasonings: proj. of any vector $$x \in X$$ on some subspace $$U$$, if $$U$$ has ONB shuld be looking like $$P_U (x) = \sum_{i=1}^{k} (x,e_i)e_i$$. So in this example I have $$P_U (x) = (\frac{\sqrt{3}}{3} x_1 + \frac{\sqrt{3}}{3}x_2 - \frac{\sqrt{3}}{3}x_3)e_1 + (\frac{\sqrt{6}}{6}x_1 -\frac{\sqrt{6}}{3}x_2 -\frac{\sqrt{6}}{6}x_3)e_2$$ So this is equal to $$P*x$$, where $$P$$ -- matrix from above, and $$x$$ -- colomn-vector of our space. -- Where is the mistake? Can somebody help pls?

• The column space of this matrix is the $x$-$y$ plane, so it’s clearly wrong. If you show how you derived this matrix from the orthonormal basis that you computed, then someone will be able to tell you where your mistake was. Otherwise, we’re left to guess or read your mind. – amd Aug 14 at 20:14
• @amd I had updated my question – Just do it Aug 14 at 23:26

You didn’t go far enough with your solution. Your matrix $$P$$ certainly computes the orthogonal projection correctly, but what it computes are its coordinates relative to the orthonormal basis that you found (extended to span all of $$\mathbb R^3$$). To put it another way, you’re computing the $$(x,e_i)$$ part of $$(x,e_i)e_i$$, but neglecting to multiply by $$e_i$$. Using your matrix, $$Px=[(e_1,x),(e_2,x),0]^T$$, but what you need to end up with is $$(e_1,x)e_1+(e_2,x)e_2$$.

With the above in mind, the correct projection matrix is $$P = \begin{bmatrix}e_1&e_2\end{bmatrix} \begin{bmatrix}e_1^T\\e_2^T\end{bmatrix} = e_1e_1^T+e_2e_2^T,$$ that is, it’s the sum of individual projections onto the basis vectors as you’ve noted.

• I am neglecting to multiply by $e_i$ bcs $P_U (x) = \sum_{i=1}^{k} (x,e_i)e_i$ is a representation $x$ vector in basis of U. Is it incorrect? The coordinates of $x$ in this basis $e_i$ are equale to $(x,e_i)$. And I am not really understand, what are u doing after, why ur proj.matrix is just a scalar... – Just do it Aug 15 at 1:07
• @Justdoit It’s not a scalar. Don’t confuse the dot product $v^Tw$ of two vectors, which is a scalar, with their outer product $vw^T$, which is a matrix. – amd Aug 15 at 1:08
• ow, yep, u are right, it is not a scalar, sry( but I still don’t really understand how you got such a matrix – Just do it Aug 15 at 1:10
• It is not really clear for me: why I should to do something like this with vectors $e_1$ and $e_2$ – Just do it Aug 15 at 1:20
• @Justdoit Look at it this way: it’s the very same linear combination of the basis vectors that you wrote, but expressed in “bulk” matrix form. Expand $Px$ explicitly and see what you get. – amd Aug 15 at 1:29

Take $$u_1 = v_1 = (1, 1, -1)$$ and $$v_2 = (1, -1, -1)$$.

Applying Gram Schmidt, we have that $$u_2 = v_2 - \frac{1}{3}u_1 = (1, -1, -1) - \frac{1}{3}(1, 1, -1) = (\frac{2}{3}, \frac{-4}{3}, -\frac{2}{3})$$.

Orthonormalizing, we get $$e_1 = \frac{1}{\sqrt{3}}v_1$$ and $$e_2 = \frac{1}{\sqrt{\frac{8}{3}}} u_2$$

• The OP’s orthonormal basis is correct and is in fact identical to what you have here. That’s not where the error occurred. – amd Aug 14 at 20:17