Generic method to find a matrix whose null space is given I was given a null space of a matrix:
$$
N(A) = \operatorname{sp}\left\{\begin{pmatrix}
1 \\
0 \\
1 \\
\end{pmatrix}, \begin{pmatrix}
2 \\
-1 \\
1 \\
\end{pmatrix}
\right\}.
$$
I found the following thread: Finding a matrix with a given null space.
But I don't find it helpful because that it doesn't specify the generic method.
 A: I assume you're trying to find a $3 \times 3$ matrix $A$ with given null space $\operatorname{span}(v_1, v_2)$. Since the null space has dimension $2$, the rank of the matrix will be $1$, i.e. we can write
$$A = \begin{pmatrix} a_1 & a_2 & a_3\\ 0&0&0\\ 0&0&0 \end{pmatrix}$$
for some $a_1,a_2, a_3 \in \mathbb{R}$. Solving $A v_i = 0$ for $i = 1,2$ gives you
$$a_1 + a_3 = 0\\ 2a_1 - a_2 + a_3 = 0$$
which has solution space
$$\operatorname{span}\begin{pmatrix} 1\\ 1\\ -1\end{pmatrix}.$$
For example, 
$$A = \begin{pmatrix} 1 & 1 & -1\\ 0&0&0\\ 0&0&0 \end{pmatrix}$$
is a matrix with $\ker(A) = \operatorname{span}(v_1,v_2)$.
Of course, any matrix which can be transformed to such a matrix by elementary row and column operations has this null space as well.
A: The matrix, call it $A$, must have dimensions $n\times 3$. Call the columns $v_1$, $v_2$, $v_3$. We have
$$A\left[\begin{array}{c} 1\\ 0\\ 1\end{array}\right] = [v_1\quad v_2\quad v_3]\left[\begin{array}{c} 1\\ 0\\ 1\end{array}\right] = v_1 + v_3$$
so if $A$ has the desired null space, we must have $v_3 = -v_1$. We also have
$$A\left[\begin{array}{c} 2\\ -1\\ 1\end{array}\right] = [v_1\quad v_2\quad v_3]\left[\begin{array}{c} 2\\ -1\\ 1\end{array}\right] = [v_1\quad v_2\quad -v_1]\left[\begin{array}{c} 2\\ -1\\ 1\end{array}\right] = 2v_1 -v_2 -v_1 = v_1 - v_2$$
so we must have $v_2 = v_1$. That is, $A = [v_1\quad v_1\quad -v_1]$. 
We know that $(1, 0, 1)^T, (2, -1, 1)^T \in \operatorname{Nul}(A)$ and therefore their span is contained in the null space of $A$, but we haven't yet shown that it is in fact equal to the null space of $A$; in order to achieve this, we have to choose $v_1$ carefully. Provided $v_1 \neq 0$, $\{v_1\}$ is a basis for the column space of $A$, so $\operatorname{rank}(A) = \dim\operatorname{Col}(A) = 1$. By the rank-nullity theorem, $\dim\operatorname{Nul}(A) = 3 - 1 = 2$ and therefore $\operatorname{span}\{(1, 0, 1)^T, (2, -1, 1)^T\} = \operatorname{Nul}(A)$.
In conclusion, for any $n$, and any $v_1 \in \mathbb{R}^n\setminus\{0\}$, the $n\times 3$ matrix $A = [v_1\quad v_1\quad -v_1]$ has the desired null space.

If you take $n = 3$ and $v_1 = (1, 0, 0)^T$ you get the matrix as in Huy's answer.
If you take $n = 1$ and $v_1 = 1$, you get $A = [1\quad 1\quad -1]$. In this case, you can think of $A$ as a vector in $\mathbb{R}^3$. The condition that $(1, 0, 1)^T$ and $(2, 1, -1)^T$ are in the null space of $A$ is equivalent to saying that they are orthogonal to $A$. So $A$ is a vector orthogonal to both $(1, 0, 1)^T$ and $(2, 1, -1)^T$; in fact, $A$ is the cross product of these two vectors.
A: a generic method is likely to make use of the that for am $m \times $ matrix $A:R^n \rightarrow R^n$ the rowspace of $A$ and the null space are orthogonal complements.
in the case of $n = 3, ker(A) = span \left\{\pmatrix{1 \\0 \\1},\pmatrix{2 \\-1\\1}   \right\}$ a row vector that is orthogonal complement of $ker(A)$ in $R^3$ is $\pmatrix{1 & 1 & -1}^T$ therefore $$A = \pmatrix{1 & 1 & -1} \text{ or any nonzero multiple of this would do.}$$
