Determine the rank of a matrix given its nullspace In the book Introduction to Linear Algebra of Gilbert Strang, there is a question:
"If $Nullspace(A) =$ all multiples of $x = (2,1,0,1)$. What is the reduced row echelon form of A and what is its rank?"
In the solution, the author wrote:
"If $N(A) =$ line through $x = (2, 1, 0, 1)$, A has three pivots (4 columns and 1 special solution). Its reduced echelon form can be R =
$$
    \begin{matrix}
    1 & 0 & 0 &-2 \\
    0 & 1 & 0 & -1 \\
    0 & 0 & 1 & 0 \\
    \end{matrix}
$$
(and can add zero rows) "
However, I see that R can also be:
$$
    \begin{matrix}
    1 & -1 & 0 &-1 \\
    \end{matrix}
$$
and in this case, A only has rank 1. 
My question is what is the correct answer? And if the solution of the book is true, why can we conclude that A has three pivots given its nullspace = line through x =(2,1,0,1) ?
Thank you all!
 A: According to the rank-nullity theorem, $\text{rank}(A)+\dim\ker(A)=\dim V$, where $V$ is the domain of the linear transformation. We need $$\text{rank}(A)=\dim V-1$$If the domain of $A$ is entire $\Bbb R^4,\text{rank}(A)=3$. Thus the rows of $A$ comprise of three linearly independent vectors in $\Bbb R^4$ orthogonal to $x$ and their linear multiples. Note that $A$ may have any number of rows $\ge3$.
Your solution could be correct, but you need to then specify why $\text{rank}(A)=1$ is a valid choice. You need $\dim V=2$, i.e. the domain of $A$ is not entire $\Bbb R^4$ but a $2$-dimensional subspace $S$ of $\Bbb R^4$. Moreover, a basis of $S$ contains $x$ and a vector $v\in\Bbb R^4$ orthogonal to $x$. One candidate is $v=(1,-1,0,-1)$.
A: It's a given that the null space of $A$ is $span(x), x=(2,1,0,1)$. Therefore, $Ax=0$, where $0$ is the zero vector.
Hence, $A$ must have $4$ columns, my the matrix multiplication rule. 
Now the maximal column rank of $A$ is $4$.
Since the nullity if $A$ is $1$, column rank of $A = 4-1 = 3 =$ Row rank of $A$
Hence, the matrix must have $3$ rows.
