Skip to content
Glacius
Linear algebraConcept reference

Column combinations

The column view expresses a matrix–vector product as the sum of matrix columns weighted by the matching input entries.

On this page 7 sections
  1. Overview
  2. For A=beginbmatrix1&23&-1endbmatrix, read each column downward
  3. The column view groups the same products as row dot products
  4. Input weights can be negative, zero, or any real numbers
  5. Key takeaway
  6. Sources & further reading
  7. Concept connections

01For A=beginbmatrix1&23&-1endbmatrix, read each column downward#

For A=[1231]A=\begin{bmatrix}1&2\\3&-1\end{bmatrix}, read each column downward. The columns are c1=(1,3)c_1=(1,3) and c2=(2,1)c_2=(2,-1); each contains both output coordinates.

Use input (2,1)(2,-1) with columns c1=(1,3)c_1=(1,3) and c2=(2,1)c_2=(2,-1). Weight the first column by 2 and subtract the second.

2c1c2=(0,7)2c_1-c_2=(0,7)
Check your reasoning

A has rows (1,3)(1,3) and (2,4)(2,4). Input is (2,1)(2,-1). Choose the column sum for AxAx.

  1. A2(1,3)(2,4)2(1,3)-(2,4)
  2. B2(1,2)(3,4)2(1,2)-(3,4)
  3. C(1,2)2(3,4)(1,2)-2(3,4)
Show answer and explanation
2(1,2)(3,4)2(1,2)-(3,4)

Use 2 times column 1 minus column 2.

02The column view groups the same products as row dot products#

The column view groups the same products as row dot products. In the first output of 2(1,3)(2,1)2(1,3)-(2,-1), the first coordinates give 212=02\cdot1-2=0. The second coordinates give 23(1)=72\cdot3-(-1)=7.

Check your reasoning

Columns: c1=(1,3)c_1=(1,3), c2=(2,1)c_2=(2,-1). Input (0,2)(0,2). A learner drops both columns. Repair the sum.

  1. Ac1+2c2c_1+2c_2
  2. B0c1+0c20c_1+0c_2
  3. C0c1+2c20c_1+2c_2
Show answer and explanation
0c1+2c20c_1+2c_2

Drop only column 1.

03Input weights can be negative, zero, or any real numbers#

Input weights can be negative, zero, or any real numbers. They do not need to sum to one. This diagram shows both weighted columns contributing to the same output.

Column c1=(1,3) is weighted by 2, giving (2,6). The second column c2=(2,−1) is weighted by −1, giving (−2,1), translated to the first arrow’s tip. Their sum is Ax=(0,7). Equal coordinate units preserve the construction.Column c1=(1,3) is weighted by 2, giving (2,6). The second column c2=(2,−1) is weighted by −1, giving (−2,1), translated to the first arrow’s tip. Their sum is Ax=(0,7). Equal coordinate units preserve the construction.
Figure 1Column c1=(1,3) is weighted by 2, giving (2,6). The second column c2=(2,−1) is weighted by −1, giving (−2,1), translated to the first arrow’s tip. Their sum is Ax=(0,7). Equal coordinate units preserve the construction.
Link to this figure ↗Download SVGDownload PNG
Check your reasoning

Per unit: P adds (1,0)(1,0); Q adds (2,1)(2,1). A command uses 3 units of P and −1 unit of Q. Choose its sum.

  1. A3(1,0)(2,1)3(1,0)-(2,1)
  2. B(1,0)3(2,1)(1,0)-3(2,1)
  3. C3(1,2)(0,1)3(1,2)-(0,1)
Show answer and explanation
3(1,0)(2,1)3(1,0)-(2,1)

Use weights 3 and −1.

Key takeaway

Read the columns top to bottom. Weight each by its matching input entry, then add.

  • Express a matrix-vector product as a combination of its columns.

Sources & further reading

  1. [1]

Reference this concept

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

Glacius. “Column combinations.” Math behind ML. /learn/la-column-view