The matrix $P$ is given by $$
P=\begin{pmatrix}
1&-1&1\\
0&2&1\\
0&0&-1
\end{pmatrix}.
$$
(a) State the eigenvalues of $P$. [1]
(b) Use the characteristic equation of $P$ to find $P^{-1}$. [4]
The $3\times3$ matrix $A$ has distinct non-zero eigenvalues $a$, $\frac12$, $2$, with corresponding eigenvectors $$
\begin{pmatrix}1\\0\\0\end{pmatrix},\qquad
\begin{pmatrix}-1\\2\\0\end{pmatrix},\qquad
\begin{pmatrix}1\\1\\-1\end{pmatrix},
$$ respectively.
(c) Find $A^{-1}$ in terms of $a$. [5]