Stat Trek

Teach yourself statistics

Stat Trek

Teach yourself statistics

Vector Multiplication

The multiplication of a vector by a vector produces some interesting results, known as the vector inner product and as the vector outer product.

Prerequisite: This material assumes familiarity with matrix multiplication.

Vector Inner Product

Assume that a and b are vectors, each with the same number of elements. Then, the inner product of a and b is s.

a'b = b'a = s

where
      a and b are column vectors, each having n elements,
      a' is the transpose of a, which makes a' a row vector,
      b' is the transpose of b, which makes b' a row vector, and
      s is a scalar; that is, s is a real number - not a matrix.

Note this interesting result. The product of two matrices is usually another matrix. However, the inner product of two vectors is different. It results in a real number - not a matrix. This is illustrated below.

a =    
1
2
3
  b =    
4
5
6

Then,

a'b = 1*4 + 2*5 + 3*6 = 4 + 10 + 18 = 32

Thus, the inner product of a'b is equal to 32.

Note: The inner product is also known as the dot product or as the scalar product.

Vector Outer Product

Assume that a and b are vectors. Then, the outer product of a and b is C.

ab'= C

where
      a is a column vector, having m elements,
      b is a column vector, having n elements,
      b' is the transpose of b, which makes b' a row vector, and
      C is a rectangular m x n matrix

Unlike the inner product, the outer product of two vectors produces a rectangular matrix, not a scalar. This is illustrated below.

a =    
v
w
  b =    
x
y
z

Then,

C    =    ab'    =    
v * x v * y v * z
w * x w * y w * z

Notice that the elements of Matrix C consist of the product of elements from Vector A crossed with elements from Vector B. Thus, Matrix C winds up being a matrix of cross products from the two vectors.

Test Your Understanding

Problems

Consider the vectors shown below - a, b, and c

a =    
0
1
b =    
2
3
c =    
4
5
6

Using a, b, and c, answer the questions below.

1. Find a'b, the inner product of a and b.
2. Find bc', the outer product of b and c.
3. True or false: bc' = cb'

Solutions

  1. The term a'b is an inner product, which is equal to 3. The solution appears below.

    a'b   =    
    0 1
        *    
    2
    3

    a'b   =     0*2 + 1*3    =    3

  2. The term bc' is an outer product. Here, it is a 2 x 3 matrix, as shown below.

    bc'   =    
    2
    3
        *    
    4 5 6

    bc'   =    
    2*4 2*5 2*6
    3*4 3*5 3*6
        =    
    8 10 12
    12 15 18

  3. The statement bc' = cb' is false.

    Note that b is a 2 x 1 vector and c is a 3 x 1 vector. Therefore, bc' is a 2 x 3 matrix, and cb' is a 3 x 2 matrix. Because bc' and cb' have different dimensions, they cannot be equal.