Discriminating Row Vectors and Column Vectors

linear algebramatricesvectors

I've read this post: Row vector vs. Column vector and while it helped me understand that the differences seems to be dependent on what you're trying to do, I still find myself struggling to tell the difference between a matrix of column vectors and a matrix of row vectors.

If I have a matrix:
$$
\begin{bmatrix}
1 & 2 \\
3 & 4 \\
\end{bmatrix}
$$

Is the first matrix two column vectors,
\begin{bmatrix} 1 \\ 3 \end{bmatrix} and
\begin{bmatrix} 2 \\ 4 \end{bmatrix} ?

Or is it two row vectors [ 1 2 ] and [ 3 4 ]?

I've noticed that in the Coursera course I'm taking when it asks me to do matrix multiplication, the left matrix is row vectors, and the right matrix is column vectors. Is that always the convention or is there some way of knowing?

Best Answer

The matrix consists of $2$ rows and $2$ columns. We can write the matrix is an element of $\mathbb{R}^{2 \times 2}$.

As for your question regarding matrix multiplication, it is the definition of the matrix multiplication that we define if $C=AB$, where $A\in \mathbb{R}^{m \times p}$ and $B\in \mathbb{R}^{p \times n}$, then $C\in \mathbb{R}^{m \times n}$ where $C_{ij}=\sum_{k=1}^pA_{ik}B_{kj}$, fixing $i$ and $j$, notice that as we increment $k$, we travel along the $i$-th row of $A$ and the $j$-th column of $B$>


Remark: if you want to compute

$$\begin{bmatrix}1 & 2 \\ 3 & 4 \end{bmatrix}\begin{bmatrix}2 \\ 3\end{bmatrix},$$

From the definition, we compute $$\begin{bmatrix} \begin{bmatrix} 1 & 2 \end{bmatrix}\begin{bmatrix}2 \\ 3\end{bmatrix} \\ \begin{bmatrix} 3 & 4 \end{bmatrix}\begin{bmatrix}2 \\ 3\end{bmatrix} \end{bmatrix}$$

but you can also verify that it is equal to $$2\begin{bmatrix} 1 \\ 3\end{bmatrix} + 3\begin{bmatrix} 2 \\ 4\end{bmatrix}.$$

Related Question