-1
$\begingroup$

I'm trying to figure out if this matrix operation is possible:

$\begin{bmatrix}1&2\\3&7\end{bmatrix}\times\begin{bmatrix}1\\5\end{bmatrix}$

I know that in order to do that I need to find the dimensions of each matrix. How would I do that? What are the dimensions?

3 Answers 3

4

The dimension of each matrix is just how many numbers it has down and across, respectively. So your first matrix has dimension $2\times 2$ because it has the form $\pmatrix{*&*\\*&*}$ -- it doesn't matter what the four numbers in it is, just that they are arranged in this shape -- and the second matrix has dimension $2\times 1$ because it has the form $\pmatrix{*\\*}$.

Because the second dimension of the first matrix is the same as the first dimension of the second matrix, they can be multiplied.

  • 0
    Thanks @henning-makholm it took me today to finally figure out the dimension of a matrice... Thanks again2016-07-05
1

Yes. If the size of first factor is $m\times p$ and the second is $p\times n$, the size of the product is $m\times n$.

0

Conformable matrices

Two matrices must be conformable if they are to be multiplied. Their dimensions must be compatible. For example, $ \mathbf{AB} = \mathbf{C} $ we must have $ \mathbf{A} \in \mathbb{C}^{m\times \color{red}{n}}, \qquad \mathbf{B}\in \mathbb{C}^{\color{red}{n}\times p} $ The number of columns in $\mathbf{A}$ must match the number of rows in $\mathbf{B}$. The resulting matrix looses knowledge of the dimension $n$, and $ \mathbf{C} \in \mathbb{C}^{m\times p} $

Think of it this way: if $\mathbf{A}$ is mom, and $\mathbf{B}$ is dad, the child matrix $\mathbf{C}$ has mom's height and dad's width.

Dot products

We can see the need for conformability we looking at matrices as a collection of vectors. The matrix on the left, $\mathbf{A}$, has $m$ row vectors of length $\color{red}{n}$; the matrix on the right, $\mathbf{B}$, has $p$ column vectors of length $\color{red}{n}$

$ \mathbf{A} = \left( \begin{array}{cc} r^{T}_{1} \\ r^{T}_{2} \\ \vdots \\ r^{T}_{n} \\ \end{array} \right), \qquad \mathbf{B} = \left( \begin{array}{cccc} c_{1} & c_{2} & \dots & c_{n} \end{array} \right) $ The matrix product is expressed in terms of dot products: $ \mathbf{AB} = \left( \begin{array}{cc} r^{T}_1 c_{1} & r^{T}_1 c_{2} & \dots & r^{T}_1 c_{p} \\ r^{T}_2 c_{1} & r^{T}_2 c_{2} & \dots & r^{T}_2 c_{p} \\ \vdots & \vdots & & \vdots \\ r^{T}_m c_{1} & r^{T}_m c_{2} & \dots & r^{T}_m c_{p} \\ \end{array} \right) =\mathbf{C} $


Your example: $ \left( \begin{array}{cc} 1 & 2 \\ 3 & 7 \\ \end{array} \right) % \left( \begin{array}{c} 1 \\ 5 \\ \end{array} \right) = \left( \begin{array}{c} 1 \cdot 1 + 2 \cdot 5 \\ 3 \cdot 1 + 7 \cdot 5 \\ \end{array} \right) = \left( \begin{array}{c} 11 \\ 38 \\ \end{array} \right) $