# Finding the idempotent matrix

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!

• I don't think you need any fancy identities. Run it out for the vectors $(0,1)$ and $(1,0)$ and everything is determined. – Randall Sep 10 '18 at 2:33
• How would you determine those vectors? Part of me feels like I need a mathematical reason for choosing vectors – Billy Thorton Sep 10 '18 at 2:35
• I haven't written it out, but.... if $M=\begin{pmatrix}a & b \\c & d\end{pmatrix}$ then you get $a+2c=0$ and $b+2d=0$. But you also have $M^2=M$, so this gives other relations. – Randall Sep 10 '18 at 2:37
• Now that I'm curious enough to work on it, this approach is annoying. Interested in seeing a slicker approach. – Randall Sep 10 '18 at 2:39

Let $$M = I - \frac{1}{p^Tp}pp^T$$ You've got that $$(Mv)^Tp = v^TM^Tp= v^T (I - \frac{1}{p^Tp}pp^T)p) = v^T (p - p) =0$$ also $$M^2 = MM =(I - \frac{1}{p^Tp}pp^T)(I - \frac{1}{p^Tp}pp^T) = I - \frac{1}{p^Tp}pp^T = M$$

• Where did you get the first part of your solution? – Billy Thorton Sep 10 '18 at 2:48
• This is a projector onto the null-space of $p$. – Ahmad Bazzi Sep 10 '18 at 2:49
• This is the way. +1 – Randall Sep 10 '18 at 2:57

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.

• Okay, I think I understand the identity better, but I'm not sure how to apply it? How does this help in finding the idempotent matrix? – Billy Thorton Sep 10 '18 at 2:46
• Such an orthogonal projection $P = I - uu^T$ has the property $P^2 = P$. This property is called "idempotent". So, basically when you set up the matrix using above formula, the matrix you get will have exactly this property. – trancelocation Sep 10 '18 at 2:48
• I apologize, this might be a foolish question, but what do you mean when you say "set up the matrix"? – Billy Thorton Sep 10 '18 at 2:53
• Just give me a minute. Gonna add it to my answer. – trancelocation Sep 10 '18 at 2:54
• I was wondering, where did you solve for $u$? More specifically, I'm not sure how to solve for the $\frac{1}{\sqrt{5}}$? – Billy Thorton Sep 11 '18 at 2:34

Your matrix $M$ will be the orthogonal projection onto $\{p\}^\perp = \operatorname{span}\left\{\begin{bmatrix} 2 \\ -1\end{bmatrix}\right\}$.

In the orthonormal basis $B = \left\{\frac1{\sqrt5}\begin{bmatrix} 2 \\ -1\end{bmatrix}, \frac1{\sqrt5}\begin{bmatrix} 1 \\ 2\end{bmatrix}\right\}$ your matrix will look like $M_{(B)} = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}$.

To get how it looks like in the standard basis $E$, use the orthogonal transformation matrix $I_{(E,B)} = \frac1{\sqrt5}\begin{bmatrix} 2 & 1 \\ -1 & 2 \end{bmatrix}$.

Now we have

\begin{align} M_{(E)} &= I_{(E,B)}M_{(B)}I_{(B,E)} \\ &= I_{(E,B)}M_{(B)}\left(I_{(E,B)}\right)^t \\ &= \frac1{\sqrt5}\begin{bmatrix} 2 & 1 \\ -1 & 2 \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}\frac1{\sqrt5}\begin{bmatrix} 2 & -1 \\ 1 & 2 \end{bmatrix}\\ &= \frac15\begin{bmatrix} 4 & -2 \\ -2 & 1 \end{bmatrix} \end{align}

• How did you get $\frac{1}{\sqrt{5}}$ in your orthonormal basis? – Billy Thorton Sep 11 '18 at 2:33
• @BillyThorton I just normalized the orthogonal vectors $\begin{bmatrix} 2 \\ -1\end{bmatrix}$ and $\begin{bmatrix} 1 \\ 2\end{bmatrix}$. E.g. $$\left\|\begin{bmatrix} 2 \\ -1\end{bmatrix}\right\| = \sqrt{2^2 + (-1)^2} = \sqrt{5}$$ so $\frac1{\sqrt5}\begin{bmatrix} 2 \\ -1\end{bmatrix}$ has norm $1$. – mechanodroid Sep 11 '18 at 7:54

For the given vector $p=(1, 2)^T$ clearly the vector $q=(2,-1)^T$ is perpendicular. Now take a piece of paper plot these points, join them both to the origin, extending them both infinitely in both directions. Call the lines $L_p and L_q$.

Now consider a linear transformation of the plane that sends every vector $v$ to a point in $v'\in L_q$, moving in the direction parallel to $L_p$ (clearly $v'$ is the closest point in $L_q$ for $v$).

This is a linear transformation and its matrix (wrt the standard basis) will give you what you want.