How do I write the matrix of the orthogonal projection spanned by these two vectors?

3k Views Asked by At

From Treil's Linear Algebra Done Wrong:

Apply Gram-Schmidt orthogonalization to the system of vectors $(1,2,3)^T, (1, 3, 1)^T$. Write the matrix of the orthogonal projection onto $2$-dimensional subspace spanned by these vectors.


Using Gram-Schmidt, I found an orthogonal basis to be $$\left\{(1,2,3), \left(\frac{2}{7}, \frac{11}{7}, -\frac{8}{7}\right)\right\}.$$

If I define the map $$T{\bf x}= \frac{({\bf x},{\bf v}_1)}{\|{\bf v}_1\|^2}{\bf v}_1+\frac{({\bf x},{\bf v}_2)}{\|{\bf v}_2\|^2}{\bf v}_2$$ and then find where the basis vectors of $\mathbb R^3$ map to, I believe can find the matrix. But this is a mess.

Is there an easier way?

3

There are 3 best solutions below

5
On

Faster way with $A=[v_1\, v_2]$

  • $P=A(A^TA)^{-1}A^T$

see here for the proof Writing projection in terms of projection matrix

0
On

If you rearrange your equation just a bit, you’ll have a formula for the projection matrix: $$\begin{align} \frac{({\bf x},{\bf v}_1)}{\|{\bf v}_1\|^2}{\bf v}_1+\frac{({\bf x},{\bf v}_2)}{\|{\bf v}_2\|^2}{\bf v}_2 &= {1 \over \mathbf v_1^T \mathbf v_1} \mathbf v_1^T \mathbf x\mathbf v_1 + {1 \over \mathbf v_2^T \mathbf v_2} \mathbf v_2^T \mathbf x\mathbf v_2 \\ &= {1 \over \mathbf v_1^T \mathbf v_1} \mathbf v_1\mathbf v_1^T \mathbf x + {1 \over \mathbf v_2^T \mathbf v_2} \mathbf v_2\mathbf v_2^T \mathbf x \\ &= \left({\mathbf v_1\mathbf v_1^T\over\mathbf v_1^T\mathbf v_1} + {\mathbf v_2\mathbf v_2^T\over\mathbf v_2^T\mathbf v_2}\right)\mathbf x\end{align}.$$ Each of the terms inside of the parentheses is a $3\times3$ matrix, the matrix of orthogonal projection onto the respective basis vector, in fact.

0
On

Computing $ A ( A^T A )^{-1} A^T $ by hand in this case is really not that big of an effort. All the entries are integers so computing $ A^T A $ is easy. Indeed, it is a symmetric matrix, so you only have to compute 3 of its entries, and you get the fourth one for free. Then, inverting a 2x2 matrix is easy: $ \left( \begin{array}{c c} \alpha_{0,0} & \alpha_{0,1} \\ \alpha_{0,1} & \alpha_{1,1} \end{array} \right)^{-1} = \frac{1}{\alpha_{0,0} \alpha_{1,1}- \alpha_{0,1}^2} \left( \begin{array}{c c} \alpha_{1,1} & -\alpha_{0,1} \\ -\alpha_{0,1} & \alpha_{0,0} \end{array} \right) $. If you leave the fraction aside until the very end, then you can compute almost all of $ A ( A^T A)^{-1} A^T $ with integers.