Dot product in matrix notation

The transpose of a matrix

Before describing the dot product in matrix notation, we briefly digress to make sure you know what the transpose of a matrix is.

We can transpose a matrix by switching its rows with its columns. We denote the transpose of matrix A by AT. For example, if

A = $\displaystyle \left[\vphantom{ \begin{array}{rrr} 1&2&3 4&5&6 \end{array} }\right.$$\displaystyle \begin{array}{rrr} 1&2&3 4&5&6 \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{rrr} 1&2&3 4&5&6 \end{array} }\right]$    

then the transpose of A is

AT = $\displaystyle \left[\vphantom{ \begin{array}{rr} 1&4 2&5 3&6 \end{array} }\right.$$\displaystyle \begin{array}{rr} 1&4 2&5 3&6 \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{rr} 1&4 2&5 3&6 \end{array} }\right]$.    

Since an n-dimensional vector x is represented by an n x 1 column matrix,

x = $\displaystyle \left[\vphantom{ \begin{array}{c} x_1 x_2 x_3 \vdots x_n \end{array} }\right.$$\displaystyle \begin{array}{c} x_1 x_2 x_3 \vdots x_n \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{c} x_1 x_2 x_3 \vdots x_n \end{array} }\right]$,    

the transpose xT is a 1 x n row matrix

xT = $\displaystyle \left[\vphantom{ \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array} }\right.$$\displaystyle \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array} }\right]$.    

The dot product as matrix multiplication

Given the rules of matrix multiplication, the product of a 1 x n matrix with an n x 1 matrix is a 1 x 1 matrix, i.e., a scalar. So if we multiply xT (a 1 x n matrix) with any n-dimensional vector y (viewed as an n x 1 matrix), we end up with a matrix multiplication equivalent to the familiar dot product of x . y:

xTy = $\displaystyle \left[\vphantom{ \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array} }\right.$$\displaystyle \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{ccccc} x_1& x_2& x_3& \cdots& x_n \end{array} }\right]$$\displaystyle \left[\vphantom{ \begin{array}{c} y_1 y_2 y_3 \vdots y_n \end{array} }\right.$$\displaystyle \begin{array}{c} y_1 y_2 y_3 \vdots y_n \end{array}$$\displaystyle \left.\vphantom{ \begin{array}{c} y_1 y_2 y_3 \vdots y_n \end{array} }\right]$ = x1y1 + x2y2 + x3y3 +...+ xnyn = x . y.    

Although we won't typically write a dot product as xTy, you may see it elsewhere. Moreover, this dot product forms the building block for the general matrix multiplication.



Duane Nykamp
nykamp@math.umn.edu
2005-08-30