What is the dimension of $S$? 
Let $A\in M_{m\times n}(\mathbb{R})$. Let $S$ be a subspace of $M_{n\times p}(\mathbb{R})$ defined by $S=\{X    \in M_{n\times p}(\mathbb{R}) \;|\;AX=0\}$. What is the dimension of $S$?

My attempt is: If we consider the linear map $X \rightarrow TX$ and use rank-nullity theorem then we get $\dim S=np - rank\; A$
 A: $S$ can be written as the $p$-fold product of $\ker(A)$ (since it consists of $p$ columns, each in $\ker(A)$). Thus, the dimension of $S$ is $p$ times that of $\ker(A)$. By rank-nullity, this gives the correct answer as $p (n - \text{rank}(A))$.
A: The rank-nullity theorem here gives $\dim S = np - \operatorname{rank} T$. You've made the implicit assumption that $\operatorname{rank} T=\operatorname{rank} A$.
However that implicit assumption is wrong (unless $p=1$). Instead, we have $\operatorname{rank} T = p\cdot \operatorname{rank} A$.
This is most easily seen by writing $X$ as column vector by just concatenating all columns, and $T$ as matrix acting on it. Then you find
$$X=\begin{pmatrix}
x_{11} \\ x_{21} \\ \vdots \\ x_{n1} \\ x_{21} \\ \vdots \\ x_{np}
\end{pmatrix}$$
or shorter, if denoting with $c_k$ the $k$-th column,
$$X=\begin{pmatrix} c_1 \\ \vdots \\ c_p \end{pmatrix}.$$
Now by the rules of matrix multiplication, we see that $A$ acts on each column separately, thus we get
$$T = \begin{pmatrix}
A \\
 & A \\
 & & \ddots \\
 & & & A
\end{pmatrix}.$$
There are $p$ copies of $A$ in that matrix, therefore the rank of $T$ is $p\operatorname{rank} A$
