Skip to content
Glacius
Linear algebraConcept reference

Outer products

The outer product of column vectors u and v is the matrix uv transpose, with entry (i,j) equal to u_i times v_j.

On this page 7 sections
  1. Overview
  2. Understand the idea
  3. Column times row gives uv^T, a matrix
  4. Check your understanding
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01Understand the idea#

For column vectors uu and vv, the outer product uvTuv^T pairs every entry of uu with every entry of vv.

An outer-product table has row factors u=(2,-1) and column factors v=(3,0,4). Its rows are (6,0,8) and (-3,0,-4). The zero column factor produces an entire zero column.An outer-product table has row factors u=(2,-1) and column factors v=(3,0,4). Its rows are (6,0,8) and (-3,0,-4). The zero column factor produces an entire zero column.
Figure 1Each cell is its row factor times its column factor.
Link to this figure ↗Download SVGDownload PNG

Let u=(2,1)u=(2,-1) and v=(3,0,4)v=(3,0,4). Row 1 is 2 times vTv^T, giving (6,0,8)(6,0,8). Row 2 is 1-1 times vTv^T, giving (3,0,4)(-3,0,-4).

These two rows form

uvT=(608304)uv^T=\begin{pmatrix}6&0&8\\-3&0&-4\end{pmatrix}

If uu has mm entries and vv has nn, then uvTuv^T has mm rows and nn columns.

At row i and column j,

(uvT)ij=uivj(uv^T)_{ij}=u_i v_j

Each cell contains one product. The two vector lengths may differ.

Check your reasoning

Column vectors u=(2,3)u=(-2,3) and v=(4,1)v=(4,-1) form uvTuv^T. Find entry (2,1)(2,1).

Show answer and explanation
12

Row 2 uses 3; column 1 uses 4. Their product is 12.

02Column times row gives uv^T, a matrix#

Column times row gives uvTuv^T, a matrix. With equal lengths, row times column gives the scalar uTvu^Tv.

In uvTuv^T, a zero entry of uu makes a whole zero row. A zero entry of vv makes a whole zero column.

Check your reasoning

Batches have 2 and 5 kits. Each kit uses 3 pins and 4 clips. Choose row 2 (pins, clips).

  1. A(5,9)(5,9)
  2. B(6,8)(6,8)
  3. C(15,20)(15,20)
Show answer and explanation
(15,20)(15,20)

Five kits need 15 pins and 20 clips.

03Check your understanding#

Check your reasoning

uu has 2 entries; vv has 3. Both are columns. Repair the claimed 3×23\times2 shape of uvTuv^T.

  1. A2×32\times3
  2. B1×11\times1
  3. CUndefined.
Show answer and explanation
2×32\times3

Two rows from uu; three columns from vv.

Key takeaway

First vector: rows. Second vector: columns. Multiply each pair.

  • Build an outer-product matrix from all row-column pairs.

Sources & further reading

  1. [1]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “Outer products.” Math behind ML. /learn/la-outer