TITLE: Matrices with eigenvalues 0 and 1
QUESTION [10 upvotes]: How can you describe all $2\times 2$ matrices whose eigenvalues are 0 and 1?
My attempt: 
I know that 0 and 1 has to be solutions of the characteristic polynomial. And I've considered some examples like $$\begin{pmatrix}0&0\\0&1\end{pmatrix},\begin{pmatrix}1&0\\0&0\end{pmatrix} \text{ etc.}$$but I haven't found any regularity. But I also know from linear algebra that a matrix $A$ satisfying $A^2=A$ has only eigenvalues 0 and/or 1. Are there any more matrices? What do they have to satisfy?

REPLY [3 votes]: This is a partial answer that suggests how to parametrize such matrices explicitly.  
The other answers are more elegant and tell the story more succinctly, but they construct the answers non-uniquely.  (There are different matrices that you can conjugate a given Jordan normal form by and still obtain the same matrices:  $P^{-1} J P = Q^{-1} J Q$ is possible with $P \ne Q$.)

First a little result about the characteristic polynomial $p_A(\lambda) = \det(A - \lambda I)$ for a $2 \times 2$ matrix $A$:
$$
p_A(\lambda) = \lambda^2 - (\operatorname{tr} A) \lambda + \det A,
$$
where $\operatorname{tr} A = a + d$ is the trace.  Check this from the definition if you're not familiar with it.
Now, proceed by cases.  Suppose that $\lambda = 1$ is the only eigenvalue.  Then,
$$
p_A(\lambda) = (\lambda - 1)^2 = \lambda^2 - 2\lambda + 1.
$$
So, we know that
$$
\left\{
\begin{align}
\operatorname{tr} A &= 2 \\
\det A &= 1
\end{align}
\right.
$$
With
$$
A = \begin{bmatrix} a & b \\ c & d \end{bmatrix},
$$
$$
\left\{
\begin{align}
a + d &= 2 \\
ad - bc &= 1
\end{align}
\right..
$$
Taking advantage of the trace equation to reduce the number of parameters, let's make the substitution $a = 1 + t$ and $d = 1 - t$.  Now the determinant equation becomes $(1 + t)(1 - t) - bc = 1$ or
$$
bc = t^2.
$$
Either $b = 0$, in which case, $t = 0$, as well, and $c$ is free to take any value:
$$
\begin{bmatrix} 1 & 0 \\ c & 1 \end{bmatrix}.
$$
Or $b \ne 0$, so $c = -\frac{t^2}{b}$, so we have:
$$
\begin{bmatrix} 1 + t & b \\ -\tfrac{t^2}{b} & 1 + t \end{bmatrix}.
$$
The space of possibilities in $(b, c)$-plane consists of both axes (corresponding to having $t = 0$, hence $1$ on the diagonal) together with the second and fourth quadrants (corresponding to $t \ne 0)$.

A similar analysis can give an explicit description of the other cases for the possibilities of the eigenvalues.  (Note that this idea generalizes beyond your $\lambda \in \{0, 1\}$ assumption.)