Determining a linear transformation from the eigenvectors. Sorry for flooding the board but I'm doing a catching up on Linear Algebra.
I am given two eigenspaces, . They respectively correspond to eigenvalues $λ1 = 1$ and $λ2 = 2$. I'm required to find a linear transformation given the eigenspaces.
I have a few ideas. I'm aware of the formula $P^{-1}AP = D$. $D$ is the matrix formed by the eigenvalues. We can have $P$ and $P^1$ by arranging the the eigenvectors as a matrix (I can only do that since they are linear independent), and inverting it after. 
Thing is, I don't know how to compute A. I've tried to set a matrix such that its rows were $(a b c)$ but that didn't seem to work out when multiplied by $P^{-1}$. Is this method correct? If so, what am I doing wrong and what other procedures could I have done instead?
Thanks!
 A: The best way to answer the question is the following.
$E_1$ as above has dim =1, and its basis is given by the vector $(1,1,1)$.
$E_2$ has dimension 2, and two basis vectors are $(1,-1,0)$ and $(0,1,1)$.
Then $A(1,1,1)=(1,1,1)$
$A(1,-1,0)=(2,-2,0)$
$A(0,1,1)=(0,2,2)$.
Can you write the matrix of $A$ with respect to the basis $(1,1,1),(0,1,1),(1,-1,0)$?
Can you then write $A$ with respect to the standard basis vectors, by doing a change of basis?
A: You are kind of mixing two things. One is to find a linear transformation, another one is to find a matrix. 
A linear transformation is defined by its action on a basis. Here $E_1$ has dimension $1$ and $E_2$ has dimension $2$. And they are orthogonal to each other, so by joining two basis, one from each subspace, we get a basis for $\mathbb R^3$. 
$E_1$ is the span of $(1,1,1)$, and $E_2$ is spanned for example by $(1,-1,0)$ and $(0,1,-1)$.   So if we define $T$ by 
$$T(1,1,1)=(1,1,1),\ \ T(1,-1,0)=2(1,-1,0), \ \ T(0,1,-1)=2(0,1,-1),
$$
we get a linear transformation with the desired eigenspaces. 
To make this into a matrix representation in the canonical basis, write $T=P_1+2P_2$, where $P_1$ is the projection onto $E_1$ and $E_2$ is the projection onto $E_2$. Note that $P_2=I-P_1$. And $P_1$ is given by 
$$
P_1\begin{bmatrix}a\\ b\\ c\end{bmatrix}=\frac13\left\langle\begin{bmatrix}a\\ b\\ c\end{bmatrix},\begin{bmatrix}1\\ 1\\ 1\end{bmatrix}\right\rangle\,\begin{bmatrix}1\\ 1\\ 1\end{bmatrix}=\frac{a+b+c}3\,\begin{bmatrix}1\\ 1\\ 1\end{bmatrix}=\frac13\,\begin{bmatrix}a+b+c\\ a+b+c\\ a+b+c\end{bmatrix}.
$$
With respect to the canonical basis, 
$$
P_1=\frac13\,\begin{bmatrix}1&1&1\\1&1&1\\1&1&1\end{bmatrix},
$$
and 
$$
P_2=I-P_1=\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}-\frac13\,\begin{bmatrix}1&1&1\\1&1&1\\1&1&1\end{bmatrix}
=\begin{bmatrix}2/3&-1/3&-1/3\\-1/3&2/3&-1/3\\-1/3&-1/3&2/3\end{bmatrix}.
$$
Finally, the matrix representation of $T$ in the canonical basis is 
$$
T=P_1+2P_2=\begin{bmatrix}5/3 &-1/3&-1/3\\ -1/3&5/3&-1/3\\ -1/3&-1/3&5/3\end{bmatrix}
$$
A: As Martin Argerami points out, $E_1$ is spanned by $(1,1,1)^T$. Best way to find the basis for $E_2$ is to set one component zero and one other equal to $1$ and find the third component.
Thus, $E_2$ is spanned by $(1, 1, 0)^T$ and $(0,1,1)^T$. Thus we have the following eigenvalue, eigenvector pairs
$$\lambda = 1, e = \pmatrix{1\\1\\1}\\
\lambda = 2, e = \pmatrix{1\\1\\0}\\
\lambda = 2, e = \pmatrix{0\\1\\1}
$$
Letting $E$ the matrix with eigenvectors, $D$ the diagonal matrix of eigenvalues, we have
$$
E = \pmatrix{1&1&0\\1 &1&1\\1&0&1}, D = \pmatrix{1&0&0\\ 0&2&0\\0&0&2}
$$
We get the answer as
$$
E \, D\, E^{-1} = \pmatrix{1&1&-1\\-1&3&-1\\-1&1&1}$$
A: Here's how I consruct the matrix $A$:
First, note that $E_1$ is the subspace of $\Bbb R^3$ generated by the vector $\mathbf v = (1, 1, 1)^T$.  So we can take $\mathbf v_1$ to be an eigenvector associated with eigenvalue $1$.  Next, note that $E_2$ is the subspace of $\Bbb R^3$ normal to $\mathbf n = (1, -1, 1)^T$, and that $\mathbf v_2 = (1, 0, -1)^T$ and $\mathbf v_3 = (1, 1, 0)^T$ both satisfy $\langle \mathbf n, \mathbf v_i \rangle = 0$, where $i = 2, 3$.  We thus take $\mathbf v_2$, $\mathbf v_3$ to be eigenvectors associated to the eigenvalue $2$.  Note that $\mathbf v_2$ and $\mathbf v_3$ are in fact easily seen to be linearly independent, since if $a, b \in \Bbb R$ with $a\mathbf v_2 + b\mathbf v_3 = 0$, we have $(a + b, b, -a) = (0, 0, 0)$, showing $a = b = 0$.  Thus $\mathbf v_2, \mathbf v_3$ span $E_2$.  In fact, all the $\mathbf v_i$, $1 \le i \le 3$ are linearly independent, as may be seen by looking at the determinant of the matrix $V$ whose columns are the $\mathbf v_i$:
$\det V = \det [\mathbf v_1 \;\mathbf v_2 \; \mathbf v_3] = \det \begin{bmatrix} 1 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & -1 & 0 \end{bmatrix} = 1. \tag{1}$
Now, whatever the matrix $A$ may be, we have $A\mathbf v_1 = \mathbf v_1$ and $A\mathbf v_i = 2 \mathbf v_i$ for $i = 2, 3$.  It is thus easily seen that if we left multiply $V$ by $A$ we obtain
$AV = [A\mathbf v_1 \; A \mathbf v_2 \; A \mathbf v_3] = [\mathbf v_1 \; 2 \mathbf v_2 \; 2 \mathbf v_3]; \tag{2}$
(2) is evident from the ordinary rules of matrix multiplication.  Furthermore, it is easy to see that
$[\mathbf v_1 \; 2 \mathbf v_2 \; 2 \mathbf v_3] = [\mathbf v_1 \; \mathbf v_2 \; \mathbf v_3] \begin{bmatrix} 1 & 0 &  0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix} = VD, \tag{3}$
where
$D = \begin{bmatrix} 1 & 0 &  0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{bmatrix}. \tag{4}$
The key trick here is the realization that, while $A$ brings out eigenvalue factors via left multiplication of $V$, $D$ does so via right multiplication.  Thus we have
$AV = VD, \tag{5}$
whence
$A = VDV^{-1}; \tag{6}$
it is also easy to see that
$V^{-1} = \begin{bmatrix} 1 & -1 & 1 \\ 1 & -1 & 0 \\ -1 & 2 & -1 \end{bmatrix}; \tag{7}$
bringing all this together yields
$A = \begin{bmatrix} 1 & 2 & 2 \\ 1 & 0 & 2 \\ 1 & -2 & 0 \end{bmatrix} \begin{bmatrix} 1 & -1 & 1 \\ 1 & -1 & 0 \\ -1 & 2 & -1 \end{bmatrix} = \begin{bmatrix} 1 & 1 & -1 \\ -1 & 3 & -1 \\ -1 & 1 & 1 \end{bmatrix}. \tag{8}$
Again, from this point of view the key idea is that though $A$ multiplies $V$ on the left, $D$ multiplies $V$ on the right.
Hope this helps.  Cheerio,
and as always,
Fiat Lux!!!
