I am faced with the problem:
Let $p$ $=$ $\begin{pmatrix} 1\\2 \end{pmatrix}.$ Find the idempotent matrix M such that $Mv$ is orthogonal to $p$ for any $2 \times 1$ vector $v$.
I understand that that I can use the matrix identity
$[I - uu^T]v$ = component of $v \perp u$, for a unit vector $u$ and any vector $v$
However, I'm really not sure how to apply the identity - especially to a problem like this. Would someone be able to help me both understand the identity better and how to apply it in this scenario? Thanks for your help in advanced!
If you set $u = \frac{1}{|p|}p$, then $$(u^Tv)u$$ is the orthogonal projection of $v$ onto the subspace (here a line) spanned by $p$. Note that $(u^Tv)$ is a scalar and $(u^Tv)u$ can be rewritten as $$(u^Tv)u = (uu^T)v$$ Now, $$v- (uu^T)v = (I-uu^T)v$$ means subtracting the component of $v$ in direction of $p$ to obtain the remaining component of $v$ in the direction orthogonal to $p$.
(Here you may think, for example, of the decomposition of a force or velocity or any other vector $v$ into two orthogonal components, where the direction $p$ of one component is already given.)
Edit after comment (setting up the matrix):
$$u = \frac{1}{\sqrt{5}} \begin{pmatrix} 1 \\ 2\end{pmatrix} \Rightarrow uu^T = \frac{1}{\sqrt{5}} \begin{pmatrix} 1 \\ 2\end{pmatrix} \cdot \frac{1}{\sqrt{5}} \begin{pmatrix} 1 & 2\end{pmatrix} = \frac{1}{5} \begin{pmatrix} 1 & 2 \\ 2 & 4\end{pmatrix}$$ So, you get $$I - uu^T = \begin{pmatrix} 1 & 0 \\ 0 & 1\end{pmatrix} - \frac{1}{5} \begin{pmatrix} 1 & 2 \\ 2 & 4\end{pmatrix} = \frac{1}{5}\begin{pmatrix} 4 & -2 \\ -2 & 1\end{pmatrix} $$ You can check, that this matrix $P = I - uu^T$ has the property $P^2 = P$, hence is idempotent.