The Two Views of a Matrix

The next major character in our story. A grid of numbers, and so much more.

We’ve spent the last four lessons building a solid intuition for vectors. We know they are the fundamental atoms of our data. Now, we introduce the next major character in our story: the Matrix.

Just like with vectors, there are two primary ways to think about a matrix. One is simple and practical, the other is abstract and incredibly powerful. Mastering the ability to switch between these two views is the next giant leap in your linear algebra journey.

View #1: The Data Scientist's View (A Container for Data)

A matrix is simply a grid of numbers, arranged in rows and columns. It's a spreadsheet. A matrix is a collection of vectors. You can view it as a stack of row vectors:

A=[123504]A = \begin{bmatrix} 1 & -2 \\ 3 & 5 \\ 0 & 4 \end{bmatrix}
  • row 1 = [1, -2]
  • row 2 = [3, 5]
  • row 3 = [0, 4]

This view is essential for organizing datasets, but it doesn't tell us what a matrix *does*.

View #2: The Physicist's View (A Linear Transformation)

This is the most important and mind-expanding idea in all of linear algebra. A matrix is a function that transforms space. It takes in a vector and spits out a new vector. Let's take a simple 2x2 matrix and a vector:

A=[2003],v=[12]A = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix}, \quad v = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

When we multiply A by v, we get a new vector:

Av=[26]A \cdot v = \begin{bmatrix} 2 \\ 6 \end{bmatrix}

The matrix A took the input vector and stretched space by a factor of 2 on the x-axis and by a factor of 3 on the y-axis.

The Connection Between the Views

How does a simple grid of numbers (View #1) contain the instructions for a complex spatial transformation (View #2)? The secret lies in the columns of the matrix.

The columns of a matrix tell you where the basis vectors land after the transformation.

Let's look at a matrix M and our standard basis vectors i=[1,0]i = [1, 0] and j=[0,1]j = [0, 1]:

M=[3112]M = \begin{bmatrix} 3 & -1 \\ 1 & 2 \end{bmatrix}
  • The first column, [3,1][3, 1], is exactly where the first basis vector, ii, ends up after being transformed by M.
  • The second column, [1,2][-1, 2], is where the second basis vector, jj, lands.

Because the transformation is "linear", knowing where the basis vectors land tells us everything we need to know about how the entire space is transformed.

Summary: Your Two New Lenses for Matrices
  • Data Container: A matrix is a grid of numbers, perfect for organizing datasets. This is how we store information.
  • Transformation: A matrix is a function that transforms space. It takes input vectors and produces output vectors. This is how we process information.