10. Dot product, 2

10. Dot product, 2

Transposition

You may have noticed that the definition of the dot product looks a lot like matrix multiplication. In fact, it is a special case of matrix multiplication: v1w1++vnwn=(v1vn)(w1wn).

Technically, the matrix product gives a 1-by-1 matrix whose unique entry is the dot product, but let's not be too pedantic.

Here, we took the column vector v=(v1vn) and turned it on its side to get a row vector which we call the transpose of v , written: vT=(v1vn)

.

More generally, you can transpose a matrix:

Definition:

Given an m -by-n matrix M with entries Mij , we get an n -by-m matrix MT whose ij th entry is Mji , i.e. (MT)ij=Mji

(1234)T=(1324).

(123456)T=(142536) .

So the rows of M become the columns of MT .

With all this in place, we observe that the dot product vw is vTw .

Lemma:

(AB)T=BTAT .

Writing out the ij th entry of (AB)T using index notation, we get: (AB)Tij=(AB)ji=kAjkBki

Similarly expanding BTAT we get (BTAT)ij=k(BT)ik(AT)kj=kBkiAjk
The two expressions differ only by the order of the factors Ajk and Bki .

The order of these factors doesn't matter: Ajk and Bki are just numbers (entries of A and B ), so they commute. This is one reason index notation is so convenient: it converts expressions involving noncommuting objects like matrices into expressions involving commuting quantities (numbers).