Determine matrix A from linear transformations Let $T:R^3\rightarrow R^3$ be the linear transformation such that
$$
T
\left[
\begin{array}{c}
1\\
1\\
1\\
\end{array}
\right]
=\left[
\begin{array}{c}
-2\\
5\\
-2\\
\end{array}
\right],\,\,
T
\left[
\begin{array}{c}
1\\
1\\
0\\
\end{array}
\right]
=\left[
\begin{array}{c}
4\\
1\\
4\\
\end{array}
\right],\,\,
T
\left[
\begin{array}{c}
1\\
0\\
0\\
\end{array}
\right]
=\left[
\begin{array}{c}
1\\
-1\\
1\\
\end{array}
\right]
$$

a) Find a matrix $A$ such that $T(x)=Ax$ for every $x \in R^3$
b) Find a linearly independent set of vectors in $R^3$ that spans the range of $T$

I have absolutely no idea how to do these two questions and my textbook does not provide any similar examples. Could someone be kind enough to explain the logic behind answering these questions? Your help is appreciated! 

You should be able to see that the set of vectors 
$$ u_1=\left[
\begin{array}{c}
1\\
1\\
1\\
\end{array}
\right], u_2=\,\left[
\begin{array}{c}
1\\
1\\
0\\
\end{array}
\right], u_3 =\, \left[
\begin{array}{c}
1\\
0\\
0\\
\end{array}
\right] $$
spans $\mathbb{R^3}$. Let $X\in \mathbb{R^3}$ so we can write it as
$$ X = a \,u_1 + b \,u_2 + c\, u_3 .$$
where $a,b,c$ are the coordinates of the vector $X$ with respect the above basis. Apply the operator $T$ to the vector $X$ gives
$$ T(X) = aT(u_1)+ bT(u_2)+ c T(u_3) = a\left[
\begin{array}{c}
-2\\
5\\
-2\\
\end{array}
\right] + b\left[
\begin{array}{c}
4\\
1\\
4\\
\end{array}
\right]+ c \left[
\begin{array}{c}
1\\
-1\\
1\\
\end{array}
\right]= \left[ \begin{array}{ccc} -2 & 4 & 1 \\ 5 & 1 & -1 \\ -2 & 4 & 1 \end{array}\right] \left[
\begin{array}{c}
a\\
b\\
c\\
\end{array}
\right] = A X.$$
I let you finish the problem.
