next up previous index
Next: 2 Unary Operations Up: 1 Binary Operations Previous: 1 Addition and subtraction   Index


2 Matrix multiplication

Matrices are conformable for multiplication if and only if the number of columns in the first matrix equals the number of rows in the second matrix. This means that adjacent columns and rows must be of the same order. For example, the matrix product $_{3}{\bf A}_{2} \times$ $_{2}{\bf B}_{1}$ may be calculated; the result is a $3 \times 1$ matrix. In general, if we multiply two matrices $_{i}{\bf A}_{j} \times$ $_{j}{\bf
B}_{k}$, the result will be of order $i \times k$. Matrix multiplication involves calculating a sum of cross products among rows of the first matrix and columns of the second matrix in all possible combinations.

\begin{displaymath}\mbox{e.g.}
\left( \begin{array}{rr} 1 & 4\ 2 & 5 \ 3 & 6...
...gin{array}{rr} 9 & 19\ 12 & 26\ 15 & 33 \end{array} \right)
\end{displaymath}

This is written

\begin{displaymath}{\bf AB} = {\bf C}
\end{displaymath}

The only exception to the above rule is multiplication by a single number called a scalar. Thus, for example,

\begin{displaymath}2 \left( \begin{array}{rr} 1 & 4\ 2 & 5 \ 3 & 6 \end{array}...
...egin{array}{rr} 2 & 8\ 4 & 10 \ 6 & 12 \end{array} \right)
\end{displaymath}

by convention this is often written as

\begin{displaymath}
2 {\bf A} = {\bf C}.
\end{displaymath}

Although convenient and often found in the literature, we do not recommend this style of matrix formulation, but prefer use of the kronecker product. The kronecker product of two matrices, symbolized $\bf A \otimes \bf B$ is formed by multiplying each element of A by the matrix B. If A is a scalar, every element of the matrix B is multiplied by the scalar. The simplest example of matrix multiplication is to multiply a vector by itself. If we premultiply a column vector ($n\times 1$) by its transpose[*], the result is a scalar called the inner product. For example, if

\begin{displaymath}{\bf a}^{\prime} = \left( \begin{array}{rrr} 1 & 2 & 3 \end{array} \right)
\end{displaymath}

then the inner product is

\begin{displaymath}{\bf a}^{\prime}{\bf a} =
\left( \begin{array}{rrr} 1 & 2 &...
...1 \ 2 \ 3 \end{array} \right) \\
= 1^{2}+2^{2}+3^{2} = 14
\end{displaymath}

which is the sum of the squares of the elements of the vector $\bf a$. This has a simple graphical representation when $\bf a$ is of dimension $2 \times 1$ (see Figure 4.1).

Figure 4.1: Graphical representation of the inner product $\bf a'a$ of a $(2\times 1)$ vector $\bf a$, with ${\bf a}'=(x y)$. By Pythagoras' theorem, the distance of the point $V$ from the origin $O$ is $\sqrt{x^2+y^2}$, which is the square root of the inner product of the vector.
\begin{figure}
\centerline{\psfig{figure=matalgf1.eps,height=3in}}
\end{figure}


next up previous index
Next: 2 Unary Operations Up: 1 Binary Operations Previous: 1 Addition and subtraction   Index
Jeff Lessem 2002-03-21